MOTG-MP3
End-of-Life Notice
This product has reached End-of-Life. For anyone who are still interested in this product or a similar configuration, please contact our sales team.
Description
MOTG-MP3 is an audio sound module that can play MP3 audio files stored on a micro-SD card, such as voice and music.
The MOTG-MP3 features an onboard 16-bit MCU, specifically designed for hardware audio decoding by 4D Systems.
It features an onboard mono amplifier capable of driving a 4-ohm 3-watt speaker. It also features stereo DAC output for connecting directly to headphones or an external amplifier.
In short, the MOTG-MP3 offers a very flexible, compact and low-cost embedded audio solution for many applications.
Features
- Features SOMO II 16-bit MCU by 4D Systems
- Supports 5V power supply only
- Supports bit rates 11172-3 & ISO1381303
- Sample rates from 8Khz to 48Khz
- 24-bit DAC audio output
- Supports 2-Wire 3.3V TTL UART interface
- Mono-amplified Speaker output
- On-board micro-SD memory card connector
Before Getting Started
Out of the box, the chipset's UART pins are not connected to the UMI of the MOTG.
MOTG-MP3 hardware allows the UART pins to be connected to either TX, RX or GPIO1, GPIO2 of the UMI. This is could be achieved by shorting the respective sides of solder bridges SB1 and SB2 with a blob of solder, using a soldering iron. This must be done by the User.
Unless the designer intends to use two UART MOTGs on a gen4-MOTG-AC2 or gen4-MOTG-AC4 board, the UART pins should be directed to TX, RX of the UMI as shown above.
When two UART MOTGs are being used on a gen4-MOTG-AC2 or gen4-MOTG-AC4 board, the UART pins of one of the MOTGs should be diverted to GPIO1 and GPIO2 of the UMI, as shown below. This prevents both MOTGs from using the same pins of the gen4 display module for UART communication.
Pin and Solder Bridges
Pin Description
Pin | Symbol | Description |
---|---|---|
1 | 3.3V | Not Connected |
2 | GND | Supply Ground |
3 | RX | Asynchronous Serial Receive Pin |
4 | TX | Asynchronous Serial Transmit Pin |
5 | GPIO5 | Busy Signal |
6 | N/C | Not Connected |
7 | N/C | Not Connected |
8 | GPIO2 | RX Bypass Pin |
9 | GPIO1 | TX Bypass Pin |
10 | N/C | Not Connected |
11 | N/C | Not Connected |
12 | N/C | Not Connected |
13 | N/C | Not Connected |
14 | N/C | Not Connected |
15 | GND | Supply Ground |
16 | 5.0V | 5V Input Supply |
Note
GPIO 5 indicates if the Audio is playing. It can be used to trigger an external amplifier. Low indicates Audio output is occurring. High indicates no Audio output. SB3 requires to be shorted to use this functionality.
The designer can choose if the UART pins of the MOTG should be connected to either TX, RX or GPIO1, GPIO2 of the UMI. This is could be achieved by shorting the respective sides of solder bridges SB1 and SB2. This is discussed in detail in the Before Getting Started section.
Solder Bridge Description
The MOTG-MP3 also has three solder bridges. The functionality of those solder bridges is described in the table below. These are soldered by the User.
Solder Bridge | Description |
---|---|
SB1 | TX Selector |
SB2 | RX Selector |
SB3 | Enable Busy Pin |
SPK+, SPK- provides a differential amplified output to a single speaker. Connect these pins to a 4/8/16/32-ohm speaker, at a max of 3 watts when powered from a 5V supply. An 8-ohm 2.5W speaker is recommended.
DC_R and DAC_L provide the Left and Right audio outputs, capable of driving headphones directly or small speakers or fed into an external amplifier. To use these signals, wires or pins can be soldered to these pads by the User.
Serial Commands
The SERIAL-MODE provides a simple 2-wire TTL Serial UART interface to any micro-controller capable of interfacing to a 5.0V TLL Serial UART system that can be configured to output the simple protocol required to communicate with the MOTG-MP3.
- Baud Rate: 9600 bps
- Data bits: 8
- Stop Bits: 1
- Parity bit: none
- Flow Control: none
The MOTG-MP3 audio operations such as PLAY, PAUSE, STOP, NEXT, PREVIOUS
and VOLUME
etc are all available to the host micro-controller to control using a simple set of bytes sent to the MOTG-MP3, along with many more, which can be found under the Valid Commands listed below.
Command format: the format of the serial commands is as follows
FORMAT: $S, CMD, Feedback, Para1, Para2, Checksum1, Checksum2, $0
$S | Start Character $S is 0x7E in HEX | Not Every command starts with this |
CMD | Command Code | Every command has a unique command code, which determines the operation |
Feedback | Command Feedback | Specifies whether the feedback is required by the host microcontroller in reply to the command. 1 = Feedback, 0 =Parameter #1 No Feedback |
Para1 | Parameter #1 | First parameter of the specific Command Code |
Para2 | Parameter #2 | Second parameter of the specific Command Code |
Checksum1 | Checksum #1 | First byte of the checksum. The checksum calculation is shown below |
Checksum2 | Checksum #2 | Second byte of the checksum. The checksum calculation is shown below. |
$0 | End Character $0 is 0xEF in HEX | Every command ends with this |
Checksum Calculation:
- The checksum is calculated using the following formula.
-
Checksum (2 bytes) = 0xFFFF - (CMD + Feedback + Para1 + Para2) + 1
Valid Commands:
All commands shown below have Feedback turned off so there will be no data sent from the MOTG-MP3 after the command has been sent from the microcontroller (except for the Query commands which are requesting data).
Function | Serial Command | Description |
---|---|---|
NEXT | 7E 01 00 00 00 FF FF EF |
If no track is currently playing, issuing the NEXT command will start playing the first track copied to the media. If the MOTG-MP3 is currently playing a song or has previously played a song, this will play the next song in the order copied on to the media. |
PREVIOUS | 7E 02 00 00 00 FF FE EF |
If no track is currently playing, issuing the PREVIOUS command will start playing the last track copied to the media. If the MOTG-MP3 is currently playing a song or has previously played a song, this will play the previous song in the order copied on to the media. |
SPECIFY TRACK # | 7E 03 00 00 01 FF FC EF 7E 03 00 00 02 FF FB EF 7E 03 00 00 0A FF F3 EF |
Start playing the first track copied to the media. This will start playing the second track copied to the media. This will start playing the tenth track copied to the media. |
VOLUME + | 7E 04 00 00 00 FF FC EF |
This will increase the volume by 1 (0 – 30 range, level 20 is default power on setting) |
VOLUME - | 7E 05 00 00 00 FF FB EF |
This will decrease the volume by 1 (0 – 30 range, level 20 is default power on setting ) |
VOLUME # | 7E 06 00 00 1E FF DC EF 7E 06 00 00 05 FF F5 EF |
This will set the volume to be 30 (30 is the Max). This will set the volume to be 5 |
SPECIFY EQ | 7E 07 00 00 01 FF F8 EF 7E 07 00 00 04 FF F5 EF |
This will set the EQ to pop. This will set the EQ to classic. (0/1/2/3/4/5 Normal, Pop, Rock, Jazz, Classic, Bass) |
REPEAT A TRACK | 7E 08 00 00 01 FF F7 EF 7E 08 00 00 02 FF F6 EF 7E 08 00 00 1F FF D9 EF |
This will repeat the first track copied to the media. This will repeat the second track copied to the media. This will repeat the thirty first track copied to the media. |
PLAY SOURCE | 7E 09 00 00 02 FF F5 EF |
This will set the MOTG-MP3 to play from a micro-SD Card |
RESET | 7E 0C 00 00 00 FF F4 EF |
This will reset the MOTG-MP3, to be in its powered-on state |
PLAY | 7E 0D 00 00 00 FF F3 EF |
Play the audio track selected (if selected) else the first track copied on to the media |
PAUSE | 7E 0E 00 00 00 FF F2 EF |
Pause the current playing audio Track. If PLAY command is then sent, the audio track will resume from where it was paused. |
SPECIFY FOLDER & TRACK | 7E 0F 00 01 01 FF EF EF 7E 0F 00 01 0A FF E6 EF 7E 0F 00 63 FF FE 8F EF |
This will start playing Folder 1 from Track 1. This will start playing Folder 1 from Track 10. This will start playing Folder 99 from Track 255 |
CONTINUOUS | 7E 11 00 00 01 FF EE EF |
This will enable continuous mode (disable RANDOM TRACK and REPEAT CURRENT if previously enabled), which will play all songs on the memory card, one after the other. Start track with PLAY. |
STOP | 7E 16 00 00 00 FF EA EF |
Stop the current playing audio Track. If PLAY command is then sent, the audio track will start from the beginning. |
RANDOM TRACK | 7E 18 00 00 00 FF E8 EF |
This will enable Random Mode (disable CONTINUOUS and REPEAT CURRENT if previously enabled), which plays random tracks one after the other, continuously. Start track with PLAY. |
REPEAT CURRENT | 7E 19 00 00 00 FF E7 EF |
This will enable the repeat play mode (disable CONTINUOUS and RANDOM TRACK if previously enabled), which repeats the currently playing track, so it will play over and over continuously. Track must be playing before this command is sent. |
SINGLE PLAY | 7E 19 00 00 01 FF E6 EF |
This will disable CONTINUOUS, RANDOM TRACK or REPEAT CURRENT modes if previously enabled, which is how the module starts up by default. This will allow one song to play and then stop. Start track with PLAY. |
QUERY VOLUME | 7E 43 00 00 00 FF BD EF |
Query the current volume. |
QUERY EQ | 7E 44 00 00 00 FF BC EF |
Query the current EQ Setting (0/1/2/3/4/5 Normal, Pop, Rock, Jazz, Classic, Bass) |
QUERY TRACKS uSD | 7E 48 00 00 00 FF B8 EF |
Query the number of files present on the micro-SD Card |
QUERY CURRENT TRACK uSD | 7E 4C 00 00 00 FF B4 EF |
Query the current track playing from the micro-SD Card |
QUERY TRACKS FOLDER | 7E 4E 00 00 01 FF B1 EF 7E 4E 00 00 0B FF A7 EF |
This will return the number of tracks in Folder 1 (001) This will return the number of tracks in Folder 11 (011) |
Successful command received by MOTG-MP3 (Feedback Byte needs to be ON):
If Feedback is required for the successful receipt of a command, simply change the Feedback byte from 0x00 to 0x01, and a confirmation message will be sent from the MOTG-MP3 after the command is sent and received.
Feedback Received | Description |
---|---|
7E 41 00 00 00 FF BF EF |
Command Successfully Received |
Errors received from the MOTG-MP3:
If a command is sent to the MOTG-MP3 and the MOTG-MP3 results in an error from that command, the following messages could be sent. These are sent on error regardless of if the feedback byte is enabled or disabled.
ERRORS Received | Description |
---|---|
7E 40 00 00 01 FF BF EF |
Module is busy |
7E 40 00 00 02 FF BE EF |
Module is currently in sleep mode |
7E 40 00 00 03 FF BD EF |
Serial received an error |
7E 40 00 00 04 FF BC EF |
Checksum error |
7E 40 00 00 05 FF BB EF |
Beyond scope of specified file/folder |
7E 40 00 00 06 FF BA EF |
Specified file/Folder not found |
Other information received from MOTG-MP3:
These commands are sent from the MOTG-MP3 when certain events occur and could come at various times.
DATA Received | Description |
---|---|
7E 3A 00 00 02 FF C4 EF |
micro-SD Card Inserted. Sent every time a micro-SD card is inserted. |
7E 3B 00 00 02 FF C3 EF |
micro-SD Card Removed. Sent every time a micro-SD card is ejected. NOTE: when the card is ejected, multiple messages may be sent (ejected, inserted and ejected again). This is a side-effect of the type of micro-SD socket that is installed if the card is ejected slowly, i.e. holding in the card before releasing. |
7E 3D 00 00 02 FF C1 EF 7E 3D 00 00 0A FF B9 EF |
micro-SD Card source, finished playing Track 02 micro-SD Card source, finished playing Track 10 (0x0A) |
7E 3F 00 00 00 FF C1 EF |
MOTG-MP3 has just started up, no media detected |
7E 3F 00 00 02 FF BF EF |
MOTG-MP3 has just started up, micro-SD Card detected |
Media - micro-SD card
The MOTG-MP3 uses off-the-shelf micro-SD and micro-SD-HC memory cards with up to 32GB capacity and is compatible with both FAT16 and FAT32 file formats. The formatting of the card can be done on any PC/Mac/Linux system with a card reader. Select the appropriate drive and choose the FAT16 or FAT32 file format, depending on the capacity of your micro-SD card. The card is now ready to be used in the MOTG-MP3.
Note
Certain brands of micro-SD memory cards may not work properly. This is evident in some files that may be skipped and not played by the MOTG-MP3.
File & Folder Structure
The MOTG-MP3 is flexible in how files are stored on the micro-SD, however, to have control over which files are played, it is important to follow some simple naming rules for the MOTG-MP3 to play the specific file you intend to play.
The MOTG-MP3 is capable of addressing up to 99 Folders, each with up to 255 songs.
MOTG-MP3 is not capable of reading ID3 information from the MP3 files, so purely relies on the name of the file as the index (Primary method), or the order the files were copied onto the media (Secondary Method).
While MOTG-MP3 files can be named almost anything and they will play, to index the files so they can be picked on request using a specific serial command to select the folder/file using the Primary Method, the following must be observed:
- 001ABCDEFG.mp3
- where:
-
001 refers to the track number from 1 (001) to 255 as the MOTG-MP3 can address up to 255 songs in each folder,
and ABCDEFG refers to any alphanumeric name of your choosing, where the total file name length can be 32 characters long (Operating System dependent),
ending with the
.mp3
extension.
- The folder structure should have then the following naming convention:
-
where 01 refers to a number from 01 to 99, as the MOTG-MP3 can address up to 99 folders.
If Songs are placed on the media and they may or may not follow the naming convention, then the song can be played using the PLAY, NEXT, PREV commands or buttons, or using the SPECIFY TRACK # command, which uses the Secondary Method and plays based on the order the songs were copied (Secondary Method) on to the media and not the name or location of the files.
The SPECIFY FOLDER & TRACK command however cannot be used if the naming convention has not been followed (Primary Method), as this relies on the formatting above to be observed.
Note
When using the SPECIFY FOLDER & TRACK command, the Folder and Track numbering is in HEX. So the Folders are 0x01 through 0x63 (1 to 99), and the Tracks are 0x01 through 0xFF (1 to 255).
If the above formatting is observed, all commands will work correctly, so both Primary and Secondary methods are functional.
It may be difficult to determine the order in which songs were copied onto the media, so the Secondary Method should only be used if the order is not critical or the copy order is known. The Primary Method should be used as the preferred method.
Mechanical Views
Specifications
Recommended Operating Conditions
Parameter | Conditions | Min | Typ | Max | Units |
---|---|---|---|---|---|
Supply Voltage (VCC) | 3.3 | 5.0 | 5.5 | V | |
Operating Temperature | 0.0 | -- | 70.0 | °C | |
Input Low Voltage (VIL) | All pins | -0.3 | -- | 0.3*VCC | V |
Input High Voltage (VIH) | All pins | 0.7*VCC | -- | VCC+0.3 | V |
Global Characteristics Based on Operating Conditions
Parameter | Conditions | Min | Typ | Max | Units |
---|---|---|---|---|---|
Supply Current (ICC) | VCC = 5.0V, Audio Playing | 30.0 | -- | 300.0 | mA |
Standby Current | VCC = 5.0V | -- | 20.0 | -- | uA |
Output Low Voltage (VOL) | -- | -- | 0.3 | V | |
Output High Voltage (VOH) | 2.7 | -- | VCC | V |
Revision History
Hardware Revision
Revision Number | Date | Description |
---|---|---|
1.1 | 21/11/2016 | Initial Public Release version |
Datasheet Revision
Revision Number | Date | Description |
---|---|---|
1.8 | 06/01/2023 | Modified datasheet for web-based documentation |