Hardwired MPEG I/II-Layer 3 decoder MP3-player control Stereo Audio DAC Mono Audio Power Amplifier for speaker control This document describes the MP3 Player, the Machine-Machine Interface and how to communicate with UART link to remote control the MP3 player. document. Mobile Phone,...
Page 6
Introduction AT83SND2CMP3 User Guide 7525A–MP3–07/05...
Section 2 Functional Description The AT83SND2CMP3 is designed to be used as a slave device driven by an host con- troller via a UART connection. AT83SND2CMP3 User Guide 7525A–MP3–07/05...
Functional Description Features 7525A–MP3–07/05 The AT83SND2CMP3 module provides: MP3 music playing capability – from Nand Flash (512Byte page size) – from MMC or SD card, Embedded FAT 12/16/32. The AT83SND2CMP3 can be remote controlled from an external Controller using standard commands such as: –...
Description of the Environment Figure 2-1. General System Architecture Remote Controller Player AT83SND2CMP3 AT83SND2CMP3 User Guide List of system Interfaces: Functional Description Storage Device NOR Flash (Firmware Storage) Stereo Headset Speaker SD / MMC USB Host Interface Power Supply Nand Flash 7525A–MP3–07/05...
Page 10
AT83SND2CMP3 USB interface complies to the USB 2.0 Full Speed specifications. The USB bus is used to download music using bulk transfer. The system supports Mass Storage on the following platforms: Win98 with Atmel driver, Win2000/ME/XP. These platforms do not provide multi-drive (multiple USB Logical Unit) support, except Win2000 Service Pack 3 that allows multi-drive support.
Page 11
Functional Description AT83SND2CMP3 User Guide 7525A–MP3–07/05...
Communication Protocol Frame Format AT83SND2CMP3 User Guide Communication Protocol The AT83SND2CMP3 is remotely controlled using simple ‘user interface like’ commands such as Play or Stop commands. The communication protocol provides an abstraction of the physical layer between the Remote Controller and the Player. The communication protocol is a half-duplex protocol between a host Remote Controller and the AT83SND2CMP3 (Player) over a UART.
Page 16
Communication Protocol Protocol Command FS_FILEPOS * FS_END_OF_LIST * SYSTEM_MOUNTED* CUSTOM_PLAYER_TOTALTIME * CUSTOM_PLAYER_END_OF_FILE * 3-12 7525A–MP3–07/05 Command Data Description Send current file position. Player has reached the end of the list after PLAYER_GET_LIST command. Player has finished file system FAT instal on selected memory. MP3 total time length.
Player’s Operating Modes Figure 3-2. Player’s Operating Modes START Available Command in IDLE Mode: FS_GET_NAME FS_EXIT_DIR FS_FORMAT FS_NEXT / FS_PREVIOUS SYSTEM_X Status Not Playing Status USB Connection USB Transfer MASS STORAGE AT83SND2CMP3 User Guide All the commands sent by the Remote Controller can change the Player’s current operating mode.
Communication Protocol Error Management 3.5.1 Command Time-out 3.5.2 Bad CheckSum UART Layer 3.6.1 Polling Strategy 3-14 7525A–MP3–07/05 When a communication handling error occurs (for example data length does not corre- spond to the actual frame size), the AT83SND2CMP3 reception state machine is resetted after TimeResumeCommand ms.
Page 19
Figure 3-3. Protocol communication principle of use Controller_Rx Controller_Tx AT83SND2CMP3 User Guide SYSTEM _ACK STATUS SYSTEM_ COMMAND GET_STATUS Communication Protocol SYSTEM _ACK STATUS 3-15 7525A–MP3–07/05...
Communication Protocol Player Management 3.7.1 Player Reset 3.7.2 Player’s Status 3-16 7525A–MP3–07/05 After a Player warm or cold reset, Remote Controller shall wait on its RX line the SYSTEM_ACK frame. This means that the AT83SND2CMP3 is ready to communicate. Figure 3-4 . Warm Reset C o n tro lle r_ R x C o n tro lle r_ T x S Y S T E M...
Page 21
Example 1 Table 3-8 . Example: select memory and get name of current file AT83SND2CMP3 User Guide The SYSTEM_ACK_STATUS frame response is the acknowledge for the received frame and the corresponding command processed. Note: Refer to Table 5-1 . Player STATUS Description C o n tro lle r C o n tro lle r c a n n o w...
Page 22
Communication Protocol Example 2 Figure 3-5 . Example: Play a MP3 file 3-18 7525A–MP3–07/05 P la y M P 3 o n M M C / S D C a r d C o n tr o lle r P la ye r C a rd In s e rtio n F A T is In s ta lle d o n C a rd...
File Transfer START Power on Reset BOOT 3.8.1 Protocol Communication Use AT83SND2CMP3 User Guide The File Transfer mode is used to transfer file from/to Remote Controller to/from Player Memory. Hardware Reset Initialization FS_FCREATE IDLE The following commands: – FS_FCREATE – FS_FWRITE_BLOCK –...
Page 24
Communication Protocol Example 1 Figure 3-6 . Transfer a File From Remote Controller to Player Selected Memory 3-20 7525A–MP3–07/05 T r a n s fe r in g A F ile F r o m R e m o te C o n tr o lle r to P la ye r C o n tr o lle r During the file write transfer, after the FS_FCREATE command, no other commands...
Page 25
Communication Protocol Example 2 Figure 3-7 . Example: Transfer a File From Player to Remote Controller T r a n s fe r in g A F ile F r o m P la ye r to R e m o te C o n tr o lle r C o n tr o lle r P la ye r P la y e r re a d a n d s e n d...
Page 26
Communication Protocol 3-22 AT83SND2CMP3 User Guide 7525A–MP3–07/05...
USB-IF membership and obtaining a VID”. Atmel allows limited usage of its VID (03EBh) during product development phase. Cus- tomer use of the Atmel Vendor ID is not guaranteed by Atmel. The customer must use its own Vendor ID for production.
Page 28
USB_MANUFACTURER_NAME: unicode character string (default “ATMEL”) USB_PRODUCT_NAME: unicode characters string( “MP3 STORAGE”) USB_SERIAL_NUMBER: unicode characters string (“4710765066451”) SBC_VENDOR_ID: 8 ASCII characters string (default “03EBh”, ATMEL VID) SBC_PRODUCT_ID:16 ASCII characters string (default “2010h”, ATMEL PID) SBC_REVISION_ID: 4 ASCII characters string (“1.00”) Default number of USB logical unit s one (= number of drive seen by Windows explorer).
Install information is provided in readme.txt file under usb_ms_drv directory. Install information for linux is provided in readme_linux.pdf file under usb_ms_drv directory. platform ™ . Each system loads the generic mass storage driver system, Atmel has developed ™ Design ™ ™ 4-25...
Player’s Status Description AT83SND2CMP3 User Guide Protocol Frame Description Note: (*) means the frame is a Player response. STATUS byte is the reflect in real-time of AT83SND2CMP3‘s system status. This status is a parameter of almost all Player frame. Table 5-1 . Player STATUS Description ERROR MERROR Bit Number...
Page 31
AT83SND2CMP3 User Guide Bit Number Bit Mnemonic Description USB_TRANS USB Transfer This bit is set when an USB data transfer is being processed. This bit is cleared when there is no USB transfer. Reserved Reserved. File name available. This bit is set when new file name is available. This bit is cleared when Remote Controller has read the new file name.
- for Nand flash only: 01h Byte 0 - for MMC/SD card only: 02h - for Nandflash and MMC/SD card: 03h USB Vendor ID Atmel VID is 03EBh (default value) Byte 1:2 Byte 1: MSB(VID) Byte 2: LSB(VID) USB Product ID...
Page 33
SYSTEM_AUDIO_OUTPUT Command SYSTEM_SELECT_MEMORY Command AT83SND2CMP3 User Guide AT83SND2CMP3 frame response is SYSTEM_ACK frame. Table 5-4 . SYSTEM_GET_STATUS Frame Format Protocol Frame Start Channel Command Not used, Select Player Audio Output: Headset Power Amplifier The default configuration is Headset and Power Amplifier activated after reset. Table 5-5 .
Page 34
Protocol Frame Description SYSTEM_SET_SOUND Command 5-30 7525A–MP3–07/05 Table 5-7 . SYSTEM_GET_STATUS Frame Format Protocol Frame Start Channel Command Not used, Table 5-8 . Data Parameter for Select Memory Command. Memory to Select Memory Card (SD / MMC) On Board Player Memory: Nand Flash Reserved Reserved System Set Sound Command is used to configure AT83SND2CMP3 Sound system...
Page 35
SYSTEM_POWER_DOWN Command SYSTEM_WAKEUP Command SYSTEM_WAKEUP Command is a special command: it is 1ms (at least) of logical level AT83SND2CMP3 User Guide Table 5-9 . System Set Sound Data Command Byte Number Byte Mnemonic MP3VOL MP3VOR MP3BASS MP3MED MP3TRE Note: All value set to FFh will not be updated in Player. Example: MP3VOL set to FFh means tMP3VOL will keep its last value.
Page 36
Protocol Frame Description SYSTEM_USB_DETACH Command SYSTEM_USB_CONNECT Command SYSTEM_VOLUME_UP Master gain volume up (one step). Player response is PLAYER_VOLUME* frame. 5-32 7525A–MP3–07/05 Table 5-11 . SYSTEM_WAKEUP command Controller_Rx Controller_Tx (connected to SYSTEM _POWERDOWN INT0) Request the Player to perform a USB detach. Warning: during USB data transfer, performing a USB detach can corrupted the current data transfered on the memory.
Page 37
SYSTEM_VOLUME_DOWN Master gain volume down (one step). Player response is PLAYER_VOLUME* frame. SYSTEM_PLAYER_MODE Set player mode for the selected memory: AT83SND2CMP3 User Guide Table 5-14 . SYSTEM_VOLUME_UP command format Protocol Frame Start Channel Command Not used, Table 5-15 . SYSTEM_VOLUME_DOWN command format Protocol Frame Start Channel...
Page 38
Protocol Frame Description SYSTEM_AUDIO_INPUT Select Player Audio Input Channel: 5-34 7525A–MP3–07/05 Table 5-17 . Play Mode (MOD 1:0) Player Mode (PLAYER_MODE) MOD1 Play Single File Play Dir Play Disk Table 5-18 . Player File Type (FILETYP 4:2) Player File Type (FILETYPE) Mp3 Files only.** All files extensions are visible.
Page 39
Channel Command Not used, Figure 5-2 . Player USB-UART Bridge Player Player RESET Brigde USB / UART UART Protocol Frame Description Data Length Data PC Application with simple interface (‘putchar’, ‘getchar’) Atmel HID .DLL USB HID Class CheckSum 5-35 7525A–MP3–07/05...
Protocol Frame Description Player Command PLAYER_PLAY Command If current file name is a MP3 file, play selected MP3 file from Selected Memory. If current PLAYER_STOP Command Stop playing current MP3 file. PLAYER_PAUSE Command Pause playing current MP3 file. PLAYER_NEXT Command Select Next MP3 file on selected memory. 5-36 7525A–MP3–07/05 These commands allow to access all the player’s function.
Page 41
PLAYER_PREVIOUS Command PLAYER_SETMARKERA Command PLAYER_SETMARKERB Command PLAYER_STOPAB Command Stop AB repeat mode. PLAYER_GET_TIME Command Get Player playing time since the beginning of the file . AT83SND2CMP3 User Guide Select Previous MP3 file on Selected Memory. Table 5-27 . PLAYER_PREVIOUS command Protocol Frame Start Channel...
Page 42
Protocol Frame Description PLAYER_GETINDEXNUMBER Command PLAYER_ENTER_ROOT_DIR Command PLAYER_SET_FILTER Command PLAYER_GET_FILE_LIST Command 5-38 7525A–MP3–07/05 Player response is PLAYER_TIME* frame. Get numbers of files in current directory or root directory. Table 5-32 . PLAYER_GETINDEXNUMBER Command Protocol Frame Start Channel Command If not used, Player response is PLAYER_INDEXNUMBER* frame.
Page 43
PLAYER_PLAY_INDEX Command AT83SND2CMP3 User Guide – Remote Controller sends PLAYER_FILE_GET_LIST command – Player sends 3 FS_NAME* frame because there is 3 files in current directory. – When all the files names are send, Player sends FS_END_OF_LIST* frame. The sequence can be aborted by any other command send to the Player (for example SYSTEM_GET_STATUS command).
Protocol Frame Description File System Commands FS_NEXT Command Select next file from selected memory. FS_PREVIOUS Command Select previous file from selected memory. FS_ENTER_DIR Command File System Enter Directory on selected memory and select the first found file / FS_EXIT_DIR Command File System Exit Directory on Selected Memory. FS_GET_NAME Command File System Get Name of Current File or Directory on Selected Memory.
Page 45
FS_FORMAT Command Fo rm at Selected Memory in FAT16. Player reponse is SYSTEM_ACK* o r FS_FCREATE Command Create a File in root dir in Selected Memory. Once this file is created, Player is waiting AT83SND2CMP3 User Guide Table 5-41 . FS_GET_NAME command Protocol Frame Start Channel...
Page 46
Protocol Frame Description FS_FWRITE_BLOCK Command Frame Start FS_FWRITE_LAST_BLOCK Command Frame Start Channel Command If not used, FS_FREAD_BLOCK Command This Command allows Remote Controller to read current selected file in memory. 5-42 7525A–MP3–07/05 Write data in current created file (need previous FS_FCREATE command). The number of FS_WRITE_BLOCK command the Remote Controller shall send to Player is defined by Number of Blocks Parameter (refer to FS_FCREATE command).
Page 47
FS_FCLOSE Command Close current file (close read or close write file). This command is used to stop any read FS_GETMEMFREESPACE Get selected memory free space left. FS_GETFILESIZE Get current file size in Byte. FS_GETFILEPOS Get current file position (playing operating mode only). AT83SND2CMP3 User Guide Player response to FS_FREAD_BLOCK command is FS_READ_BLOCK_DATA*.
Page 48
Protocol Frame Description FS_FDELETE Delete the current selected file. 5-44 7525A–MP3–07/05 Player response is FS_FILEPOS frame. Table 5-51 . FS_FDELETE command Protocol Frame Start Channel Command If not used, Player response is SYSTEM_ACK or SYSTEM_NACK frame. Data Length Data AT83SND2CMP3 User Guide CheckSum...
Custom Command AUDIO_SET_GAIN Set Audio Gain: AT83SND2CMP3 User Guide Line out (default value: 02h, -3 dB). Power Amplifier (default value: 07h, +2 dB). Line in (default value: 08h, -9 dB). Auxiliary in (default value: 07h, -6 dB). Dac Master Gain (default value: 0Ch, -6 dB). Refer to AT83SND2CMP3 datasheet (chapter DAC and PA Interface) for audio gain description and register value.
Page 50
Protocol Frame Description 5-46 7525A–MP3–07/05 Table 5-53 . AUDIO_SET_GAIN parameter Gain Selector 00000000b => 0 dB Line Out Gain 00000010b => -3 dB 00100000b => mute 00000000b => -22 dB 00000001b => + 20 dB Power Amplifier Gain 00001000b => -1 dB 00001011b =>...
Page 51
AUDIO_PA_LP Set Player power amplifier (PA) Low power mode (for speaker) - Only in PLAY mode. CUSTOM_SET_UART_BAUDR ATE Command CUSTOM_GET_SYS_VERSIO N Command AT83SND2CMP3 User Guide This command is used to set in a very short time the PA in a low power mode (only in play mode).
Page 52
Protocol Frame Description CUSTOM_SYSTEM_SLEEP Command CUSTOM_VOLUME Set volume for DAC master playback gain (analog volume). CUSTOM_GETTOTALTIME Command CUSTOM_PLAYER_LAST Command 5-48 7525A–MP3–07/05 Table 5-57 . CUSTOM_GET_SYS_VERSION command Protocol Frame Start Channel Command If not used, Player response is CUSTOM_SYS_VERSION* frame. Ask the Player to enter in power down mode (keep audio capacitors charged). Note: To avoid any extra-power consumption in power down mode because of keeping audio capacitors charged, refer to SYSTEM_POWER_DOWN command.
CUSTOM_PLAYER_FIRST Command Player’s Response Frame SYSTEM_ACK Response * The SYSTEM_ACK frame is the AT83SND2CMP3 frame response to Remote Control- SYSTEM_NACK Response * The SYSTEM_NACK frame is the AT83SND2CMP3 frame response to Remote Con- FS_NAME Response * The FS_NAME frame is sent in case of Remote Controller FS_GET_NAME Command, AT83SND2CMP3 User Guide Table 5-61 .
Page 54
Protocol Frame Description PLAYER_TIME* Response Player playing time since the beginning of the file. This frame is the response to the PLAYER_VOLUME* Response Player current digital and analog volume. This frame is the response to the FS_FREAD_BLOCK_DATA* Response 5-50 7525A–MP3–07/05 Table 5-65 .
Page 55
Protocol Frame Start Channel Command If not used, FS_FREAD_BLOCK_DATA_EN D* Response PLAYER_INDEX_NUMBER* Response FS_MEMFREESPACE* Response FS_FILESIZE* Response Current file size is in Bytes. Player Response of FS_GETFILESIZE command. AT83SND2CMP3 User Guide Table 5-68 . FS_FREAD_BLOCK_DATA Frame Data Length Data DataBlockNumber 01h Player Response of FS_READ_BLOCK command when last block is reached (end of file).
Page 56
Protocol Frame Description FS_FILEPOS* Response Player current file position (only in Player PLAY operating mode). The frame PLAYER_END_OF* Response Player has reached end of SYSTEM_MOUNTED* Frame Player has finished to select and install file system FAT on selected memory. 5-52 7525A–MP3–07/05 Table 5-72 .
Page 57
CUSTOM_PLAYER_TOTALTIM E* Frame CUSTOM_PLAYER_END_OF_ FILE* Frame CUSTOM_SYS_VERSION* Frame AT83SND2CMP3 User Guide Because that memory SYSTEM_SELECT_MEMORY command, it is possible that the AT83SND2CMP3 will send the SYSTEM_MOUNTED frame in the following case: USB attach (reselect default memory before USB enumeration). USB detach (reselect default memory and install FAT on it). Table 5-75 .
Page 58
Protocol Frame Description 5-54 7525A–MP3–07/05 Table 5-78 . CUSTOM_PLAYER_END_OF_FILE Frame Protocol Frame Start Channel Command If not used, Data Length Data Byte 0: Player Status Byte 1: ‘V’ (56h) Byte 2: ‘2’(31h) Byte 3: ‘.’(2Eh) Byte 4: ‘0’(36h) Byte 5: ‘.’(2Eh) Byte 6: ‘0’(36h) AT83SND2CMP3 User Guide CheckSum...
AT83SND2CMP3 User Guide For Technical support, please contact mcu@atmel.com. When requesting technical support, please include the following information: Target voltage and speed Hardware revisions of the tools, PC operating system and version/build PC processor type and speed A detailed description of the problem...
Page 66
Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY...
Need help?
Do you have a question about the AT83SND2C MP3 and is the answer not in the manual?
Questions and answers