How does it work?
The MP3 2 Click is equipped with the KT403A as a main integrated circuit, micro SD card connector, and 3.5mm Audio Jack connector. Basically, it is a complete solution for a DAP (digital audio player) on a Click board, which can be controlled over the UART communication interface, using RX and TX pins of the mikroBUS™ socket. The default baud rate is 9600bps and it is customizable.
On the MP3 2 Click, KT403A serves as a brain. It is complete SOC, which integrates16-bit MCU, audio decoder, and a 24-bit DSP. It also integrates the complete SD card interface and therefore, this click board contains the connector onboard for an external micro SD card. Thanks to that, the user can insert a fair amount of memory if the long, continuous playback time is needed.
MP3 2 Click has two status indication LEDs, onboard. The first one is named “SD Card” and it serves as an indication that the SD Card is present in the slot. The other one is “Chip Correct” and it indicates that the SD Card is correct and that the communication between the KT403A and the SD Card sucseeded. Besides the indicatora, there is one 3.5mm headphone jack onboard, so that MP3 2 Click can be connected directly to the next stage of the music playback system, ie. audio amplifier.
Using the predefined command set, MP3 2 Click can be fully controlled. One can Play/Pause a song, play a specific track, change a Volume Up and Volume Down between 0% and 100%, play the next or the previous song, repeat the current song, and more. Besides that, several sound effects are also supported, mentioned for different types of music: Normal, Jazz, Classic, Pop, and Rock.
This Click board™ can be supplied and interfaced with both 3.3V and 5V without the need for any external components. The onboard SMD jumper labeled as VCC SEL allows voltage selection for supply IC, but this Click Board™ communication interface and is designed to be operated only with a 3.3V logic level.
Specifications
Type
MP3
Applications
Digital music players, camcorders, speakers, headphones, toys, and more.
On-board modules
KT403A serial MP3 module, from Shenzhen Qianle Microelectronics Technology Co. Ltd.
Key Features
MP3 Player, Streaming support for MP3 and WAV.
Interface
UART
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on MP3 2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Left | Power Supply Voltage Selection: Left position 3V3, right position 5V |
LD2 | CHIP CORRECT | – | Chip correct LED indicator |
LD3 | SD CON | – | SD Card connect LED indicator |
Software Support
We provide a library for the MP3 2 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control MP3 2 Click board. A library performs the communication with the KT403A chip which integrate 16-bit MCU, and audio decoder, a DSP especial for decoding via UART interface.
Key functions:
void mp32_play_mode ( void )
– Play mode function.void mp32_play_next ( void )
– Play next function.void mp32_volume_up ( void )
– Volume up function.
Examples description
The application is composed of three sections :
- System Initialization – Initializes UART, RST pin as output and begins to write log.
- Application Initialization – Initialization driver enables – UART, reset the device, set specify a device play tracks inside ( SD Card ), set volume lvl ( 50% ), set equalizer to normal mode and set commmand for specifying a track to play.
- Application Task – (code snippet) This is an example which demonstrates the use of MP3 2 Click board. Waits for valid user input and executes functions based on set of valid commands. Results are being sent to the Usart Terminal where you can track their changes.
- Commands : ‘c’ – command list ‘p’ – play ‘o’ – pause ‘s’ – stop ‘n’ – play next ‘l’ – play previous ‘+’ – volume up ‘-‘ – volume down
void application_task ( ) { char received_data; if ( UART_Rdy_Ptr() ) { received_data = UART_Rd_Ptr( ); switch ( received_data ) { case 'c' : { command_list( ); break; } case 'p' : { mp32_play_mode( ); mikrobus_logWrite( " >>> Play", _LOG_LINE ); break; } case 'o' : { mp32_pause_mode( ); mikrobus_logWrite( " >>> Pause", _LOG_LINE ); break; } case 's' : { mp32_stop_mode( ); mikrobus_logWrite( " >>> Stop", _LOG_LINE ); break; } case 'n' : { mp32_play_next( ); mikrobus_logWrite( " >>> Play next", _LOG_LINE ); break; } case 'l' : { mp32_play_previous( ); mikrobus_logWrite( " >>> Play previous", _LOG_LINE ); break; } case '+' : { mp32_volume_up( ); mikrobus_logWrite( " >>> Volume Up", _LOG_LINE ); break; } case '-' : { mp32_volume_down( ); mikrobus_logWrite( " >>> Volume Down", _LOG_LINE ); break; } default : { command_list( ); break; } } } Delay_ms( 1000 ); }
Key functions:
command_list( )
– Display the list of commands.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.