For more information on the AT85DVK-07 development board, refer to the documents “AT85DVK-07 Hardware User’s Guide” and “AT85DVK-07 Demonstration Firmware User’s Manual”, available on the Atmel web site. For more information on the AT85RFD-07 development board, refer to the documents “AT85RFD-07 Hardware User’s Guide”...
Section 2 Firmware Features The following sections describe the AT85C51SND3Bx firmware features and options. Some of the firmware options are not supported by the AT85DVK-07 (e.g. image viewer) or by AT85RFD-07 (e.g. MMC support). MMI Manager This module allows customers to easily develop their own MMI applications. 2.1.1 Features Application management...
Firmware Features 2.2.2 Configuration Connection Speed – authorize high or full speed (depending on the host) – authorize only full speed enable/disable USB Class used (Mass Storage, HID, CDC) USB device information (vendor ID, product ID, manufacturer name, ...) – product name –...
Firmware Features Stream Information – synchronized play time – bit rate – sampling frequency – number of channels Tags – ID3 v1.0, v1.1 – ID3 v2.2 and v2.3 Stereo volume control Sound effects: – bass boost – spatial sound Adjustable 3-band EQ –...
2.8.1 Features Firmware, codecs, display, fonts update No PC tool install required for end-user Power failure resistant Update file generated by the Atmel In System Programming tool 2.8.2 Configuration Enable/disable update module Enable/disable update auto-start at power-up If update auto-start is enable then configuration of “File Location” on Nand Flash or MMC/SD card.
Firmware Features – create – delete – rename Disk management – disk Information – format: FAT12, FAT16, FAT32 2.9.2 Configuration Supported file systems Maximum number of files to manage at same time Cache optimization 2.10 Nand Flash This module is the Nand Flash memory library. 2.10.1 Features Support Nand Flash SLC small or large blocks (16KB or 128KB)
Firmware Features 2.11.2 Configuration Enable/disable Bus format: – automatic: depends on card type – 1-bit 2.12 Display This module is the display management library. 2.12.1 Features 2.12.2 Configuration Interface configuration to fit display controller – type: I80/6800 – timings 2.13 Keyboard This module is the keypad driver.
Firmware Features 2.15 Clock Manager This module is the system clock driver Oscillator Frequency Clock Type: – crystal – oscillator 2.16 System 2.16.1 Features Memory mapping configurable (code & data) Code swap between SND3 and Nand Flash (use system area code) Store a large constant data in the NandFlash (use system area font and display) 2.16.2 Configuration...
Source Files Organization 3.1.3 conf Directory The conf directory contains header files allowing user to configure the Atmel libraries. Its content is detailed in Section 6.....conf_access.h: configuration of the memory access interfaces ..........conf_audio.h: configuration of the audio part (HW and SW) ..........conf_clock.h: configuration of the oscillator frequency...
The customer MMI firmware is the code source you have to develop and customize from the software platform delivered with this package. Indeed, this layer is dedicated to inter- face the user with the high-level services provided by the Atmel core firmware and the AT85C51SNDA chip. See Firmware Architecture Section 5.
256B. The size of code space is limited at 64KB and xdata space is limited at 64KB. 4.1.1 Custom memory The AT85C51SND3B chip uses a 64KB of RAM to store the data and code, this particu- organisation larity permits to configure the memory size according to your needs. 4.1.1.1 Rules xdata space size + code space size = 64KB –...
Page 18
Code & Data Management xdata space size, code common size and code bank size* shall be a modulo 512B. Figure 4-1. Memory organisation 64KB RAM data 256B reserved 256B xdata Customizable bank code Customizable Customizable common code Note: *code bank size is optional, see “Code swap” 4-16 AT85C51SND3Bx Firmware User’s Guide 7691A–MP3–08/07...
Page 19
Code & Data Management 4.1.1.2 How to configure You must change the configuration in the « option.h » header file by defining following constants: • XDATA_LENGTH • CODE_BANKING • BANK_START_ADDRESS Note: There are no « code size » #define, because this one is automatically computed using XDATA_LENGTH.
Page 20
The code load swap mechanism is based on the code banking frame available under the environment Keil µ Vision. Indeed, the assembly file “lib_system\bank- ing\l51_bank.a51” has been deeply customized by Atmel to link code-load-swap routines to the code banking frame. Also, the debugger has been reworked to support the code load swap and the downloading of code banks will be transparent for you in debugging mode in a future software delivery.
Page 21
0xC800”. This value defined in the file “option.h” should not be modified since this common code (not banked) is mainly the one of the Atmel system firmware. – Check that the “Bank Area End” value matches with the code range end address defined in the tab “BL51 Locate”.
Page 22
? in player.lin file, e.g. : BANK7(...(0xBE00),?PR?NAV_FILE_RENAME?NAVIGATION) 4.1.2.6 Banking The Atmel firmware stores in the same bank all modules which are used for the same organisation in mode. ATMEL firmware e.g. : in BANK 2, there are the file mmi_player.c, srv_player.c, player.c which are call only in player mode.
– provides high-level features to the user (audio control, player control, file exploring), thanks to the Atmel core firmware services – gets the Atmel core firmware services with the help of requests and feedbacks The Figure 5-1 gives an overview of this firmware organization and how it fits within its environment.
– a task scheduler to run many tasks simultaneously – a communication based on message to manage the no foreeable commands and events – an MMI manager task to manage an MMI applications stack Figure 5-2. Firmware architecture: worm’s eyes view Atmel core firmware task Player task...
Page 26
Public routines Processing management Drivers On-chip peripherals On-board devices The Atmel demo firmware implements 8 tasks: – MMI manager task – Power task – USB task – Player task – Recorder task – Viewer task – Explorer task – Update task 5.3.3...
Page 27
Architecture “event” is an information dedicated to MMI applications, sent by a task to inform on its status or to give feedback of a previously executed command. These messages are mailed in two separate mailboxes, based on FIFO stacks. The uni-directional communication system is the direct access at the public routines pro- vide by modules.
Page 28
Architecture 5.3.3.2 Messages The following functions located in file “lib_system\mailbox\mail.c” make it possible the Management mailing and the delivery of messages. Figure 5-6. Mailbox interface functions Command Command mailbox mailbox mail_send_command( mail_send_command( mail_get_command( mail_get_command( U16 cmd_id, U16 param U16 cmd_id, U16 param U8 task_id, Msg *p_cmd_msg U8 task_id, Msg *p_cmd_msg mail_send_command(...
Page 29
Architecture Figure 5-7. MMI manager principle last launched application is MMI_APPLI_X placed at the top highest priority MMI_APPL_IDLE MMI_APPLI_X MMI_APPLI_STATUS MMI_APPLI_IDLE MMI_APPLI_STATUS lowest LIFO application customer priority stack applications mmi manager kernel The MMI application “status” is loaded first in the application stack at the initialization of the MMI manager task.
To achieve this control and to offer flexibility, they organized in modules, are based on a template and are associated to IDs. This one can be use a services MMI which include a usual code sequence to use provided by ATMEL. 5.4.1...
Page 31
Architecture – a “switch-case” processes all in-coming events Figure 5-8. internal switch-case processing This minimal structure to respect is to get a proper control of all new MMI applications by the MMI manager kernel. The three basic system events “EVT_START_APPLI”, EVT_APPLI_KILLED”, EVT_BACK_TO_TOP”...
Architecture Table 5-1. Requests from MMI applications to MMI manager kernel Event Functions or Macro-functions Description Prior. Name Mailed mmgr_activate_mmi_appli( Launches an MMI application by pushing it in the application stack with the help of two arguments: U8 id_appli, U16 param ) - id_appli: the module id defined by the developper in file “mmi\shared\com_appli.h”...
Architecture – Secondly, from this application up to the top one, their screens are redrawn one after the others. Thus, this mechanism makes it possible to redraw superimposed non-full-screen win- dows automatically. 5.4.5 Automatic display The automatic display module is charged with managing the display of time-related graphical objects.
Page 34
Architecture T h e n u m b e r o f a v a i l a b l e s o f t w a r e t i m e r s i s s e t t o 1 0 u s i n g t h e m a c r o “NB_TIMER_SOFT”.
Architecture Services The services are provide by Atmel and include the usual MMI sequences. This one per- mits to reduce the code in MMI Applications. 5.5.1 Player service The player service provides a MACRO to start MMI_PLAYER with different options.
Architecture Fonctions Description srvplayer_set_eq() Send to player module the equalizer value srvplayer_eq_modify_predef() Copy the predefine ambiance in the user ambiance definition srvplayer_set_bassboost() Send toplayer module the bassboost state srvplayer_set_vsurround() Send toplayer module the virtual surround state srvplayer_set_speed() Send toplayer module the speed level srvplayer_pause() Pause the play of current file srvplayer_ffw()
Architecture Fonctions Description srvexp_list_getname_parent() Get the name of directory or disk correponding at file list srvexp_enter() Enter in a disk/directory selected in DISPLAY list Note: A new list is create and DISPLAY list corresponding at the beginning of list srvexp_gotoparent() Go to parent directory/disk Note: A new list is create and DISPLAY list include the previous parent dir srvexp_format()
Architecture Modules Atmel provides the system modules which permit to use the SND3 chip feature. The modules are USB, player, recorder, viewer, power, explorer and update. The USB modules offers its services to the MMI applications with the help of com- mands/events or public routines.
Architecture Event Label Description EVT_USB_HOST_HID_MOUSE_BTN2 USB host has received an event “clic bouton 2” via a HID device. EVT_USB_HOST_HID_MOUSE_BTN3 USB host has received an event “clic bouton 3” via a HID device. EVT_USB_HOST_HID_MOUSE_MOVE USB host has received an event “mouse move” via a HID device.
Architecture Table 5-16. Player publics routines Routines Description player_on() Turn the audio controller on player_off() Turn the audio controller off player_play_file()* Play the music file selected on current file system navigator player_restart_play()* Restart playing at beginning player_pause()* Pause the ongoing play player_stop()* Stop a playing file and close file player_fast_foward()*...
Architecture Table 5-18. Recorder public routines Routines Description record_on() Initialize the record with: - microphone or line-in as input. - current file selected on current file system navigator. record_off() Stop the recording and close file record_start() Start the recording record_gettime() Get the recording time recorder_task_start() Enable recorder task (it must be call after record_start() successfull)
Architecture 5.6.5 Power Interface The Power module controls the power management of the device: – automatically jumps in idle mode to reduce power consumption, – provides battery level information, – provides power-off control, – provides alarm mechanism on a specified low battery level. Table 5-21.
Architecture In this document, only the commands and events are described, because a specific doc- ument on FileSystem Atmel exists. These services are available through public routines, only the copy/paste features may be use via a commands/event to not break the scheduler.
Architecture Debug trace text The TEXT TRACE feature is available only in OCD mode because the text trace is sent to KEIL IDE via OCD dongle. To use it, you must: • uncomment line 14 "#define _TRACE_ (ENABLE)" in debug.c •...
The file conf_mmi.h configures exclusively the Customer MMI layer and more pre- cisely the MMI applications organized in modules (see Section 3.1.8). Files configuring both the Customer MMI and the Atmel system layers These files are the ones that configure the source code of custom MMI peripherals: –...
Page 47
Firmware Configuration Files configuring the global firmware Two files are under the top-level directory of the firmware package: – config.h: configures the system. Should not be modified. – option.h: configures (de-)activation of peripherals. Also, defines compilation switches. 6-46 AT85C51SND3Bx Firmware User’s Guide 7691A–MP3–08/07...
Firmware Configuration Configuration This section describes feature by feature the available configuration. In the following tables, the default parameters values are marked in square brackets. Files 6.2.1 Control Access The “conf_access.h” file is used to configure the access control of all the system memo- ries.
Firmware Configuration 6.2.3 Clock The “conf_clock.h” file is used to configure the clock that drives the chip. Table 6-8. Clock settings Definition Label Description Values FOSC Oscillator frequency From [12000] up to 26000 (unit in KHz) CLK_DRIVE Oscillator type: [CLK_CRYSTAL] - Crystal connected on X1/X2 pins CLK_GENERATOR - External oscillator drives X1 input...
Firmware Configuration Definition Label Description Values EXP_MAX_RANGE_RAND Size of the list to random (option of explorer module) 1 to 100 (unit 8 files) EXP_GET_RAND Process use to get a random value (option of explorer module) use TL0 register 6.2.5 Setting The “conf_explorer.h”...
Page 52
Firmware Configuration Keypad layout configuration: The keyboard driver can support 5 kinds of matrices up to 12 keys as detailed in the fol- lowing figures. Table 6-13. Keypad Layout Definition Label Description Values KBD_USE_NB_KEYS Number of key leads to a dedicated [KBD_12_KEYS] matrix layout KBD_10_KEYS...
Firmware Configuration Standard Key definition: standard keys used in MMI applications are mapped here onto the keyboard matrix: Table 6-15. Standard key definition for the AT85DVK07 board version 0.0.1 Standard key Labels Matrix key Labels KEY_LOCK KEY_R1_C1 KEY_MENU KEY_R0_C3 KEY_CENTER KEY_R2_C2 KEY_RIGHT KEY_R2_C3...
Firmware Configuration Table 6-19. Main features Definition Label Description Values EMBEDDED_CODE_FONT Allow local font usage in code ENABLED [DISABLED] TEXT_SCROLLING Implement or not the code to have the text [ENABLED] scrolling available DISABLED IMAGE_SUPPORT Implement or not the functions to display ENABLED JPEG pictures [DISABLED]...
Nand Flash Type NF_TYPE_*: defines the label of one of the NF supported by the system firmware The list of supported Nand Flash is available on ATMEL site (Supported-Nand- Flash.pdf) If an auto-detection of the NF is required, please put in comments this define and set to TRUE either the following defines: Table 6-28.
Firmware Configuration Table 6-30. Power type Definition Label Description Values POWER_SOURCE power level under INTERNAL_VLV_DC_DC which the system has to EXTERNAL_VLV_REGULATOR run: very low (1.8V) or low [EXTERNAL_LV_DC_DC] (3.3V) EXTERNAL_LV_REGULATOR POWER_EXT_DC_ON External DC-DC control pin [P3_4] I/O pins mnemonics are defined in mcu.h file (See Section 3.1.5).
Include class CDC in device mode ENABLED [DISABLED] USB_DEVICE_SPEED_HIGH Autorize HIGH speed in device mode [ENABLED] DISABLED USB_DEVICE_VENDOR_ID 16-bit vendor ID [0xXXXX] (Atmel vendor ID: 0x03EB) USB_DEVICE_PRODUCT_ID 16-bit product ID [0xXXXX] (Atmel Mass Storage: 0x2036) USB_DEVICE_RELEASE_NUMBER 16-bit release number [0x0100] USB_DEVICE_MANUFACTURER_NAME Manufacturer name (ASCII) “ATMEL”...
Firmware Configuration Table 6-34. Device CDC class configuration Definition Label Description Values USB_DEVICE_CDC_DATA_NAME_INTERFACE Name of CDC data class interface "CDC DATA ATMEL" USB_DEVICE_CDC_COM_NAME_INTERFACE Name of CDC com class interface "CDC COM ATMEL" USB_DEVICE_CDC_COM Implement the CDC com interface for CDC [ENABLED] DISABLED Table 6-35.
Page 61
Atmel does not make any commitment to update the information contained herein. Unless specifically providedot- herwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use as compo- nents in applications intended to support or sustain life.
Need help?
Do you have a question about the AT85C51SND3B and is the answer not in the manual?
Questions and answers