Fujitsu FM3 family User Manual
Fujitsu FM3 family User Manual

Fujitsu FM3 family User Manual

32-bit microcontroller fm3 family application note simple av system board
Table of Contents

Advertisement

AN706-00040-2v0-E
FM3 Family
32-BIT MICROCONTROLLER
FM3 family Application Note
Simple AV System Board
User Manual
ARM and Cortex-M3 are the trademarks of ARM Limited in the EU and other countries.

Advertisement

Table of Contents
loading

Summary of Contents for Fujitsu FM3 family

  • Page 1 AN706-00040-2v0-E FM3 Family 32-BIT MICROCONTROLLER FM3 family Application Note Simple AV System Board User Manual ARM and Cortex-M3 are the trademarks of ARM Limited in the EU and other countries.
  • Page 2 (2) for use requiring extremely high reliability (i.e., submersible repeater and artificial satellite). Please note that Fujitsu will not be liable against you and/or any third party for any claims or damages arising in connection with above-mentioned uses of the products.
  • Page 3: Revision History

    AN706-00040-2v0-E Revision History Date Remark Aug.23,2011 First Edition Feb.06,2012 Correction format Correction lineup of FM3 Correction by RoHS c compliant for board, parts change, and software change...
  • Page 4: Table Of Contents

    AN706-00040-2v0-E Table of Contents Revision History ........................2 Table of Contents ........................3 Target products ........................6 INTRODUCTION ......................7 OVERVIEW OF SIMPLE AV SYSTEM BOARD ..............7 PREPARATIONS ......................8 System Items ......................8 Equipment Other than System Item Required ............10 Board Appearance ....................11 Power Supply Method ....................
  • Page 5 AN706-00040-2v0-E 7.1.6.1 Power switch ................... 40 7.1.6.2 Key Input Switch ..................41 7.1.6.3 Reset Switch .................... 41 7.1.7 Indicator ......................42 7.1.7.1 LCD Module with Touch Panel ..............42 7.1.7.2 Power LED ....................43 7.1.7.3 Selection Indicator LED ................44 7.1.8 External Interface....................
  • Page 6 AN706-00040-2v0-E 7.2.7.2 AAC ......................78 7.2.8 Operation Flow ....................82 7.2.8.1 Main Processing Function ............... 82 7.2.8.2 USB Task Processing Function ............... 83 7.2.8.3 File System (MDF) Task Processing Function ........84 7.2.8.4 HMI Task Processing Function ..............85 7.2.8.5 AUDIO Play Task Processing Function ...........
  • Page 7: Target Products

    AN706-00040-2v0-E Target products This application note is described about below products; (TYPE0) Series Product Number (not included Package suffix) MB9B500B MB9BF504NB,MB9BF505NB,MB9BF506NB MB9BF504RB,MB9BF505RB,MB9BF506RB MB9B300B MB9BF304NB,MB9BF305NB,MB9BF306NB MB9BF304RB,MB9BF305RB,MB9BF306RB...
  • Page 8: Introduction

    AN706-00040-2v0-E INTRODUCTION This user manual contains specifications and information on how to use the simple AV system board. OVERVIEW OF SIMPLE AV SYSTEM BOARD The simple AV system board plays the following 2 types of music media files and performs 1 type of image output.
  • Page 9: Preparations

    AN706-00040-2v0-E PREPARATIONS System Items A list of system items of the simple AV system board is given in Table 1, a photograph the external appearance of the AV system board is shown in Figure 2, a photograph the external appearance of ICE is shown in Figure 3, a photograph of the external appearance of the USB memory is shown in Figure 4 and a photograph the external appearance of the USB cable is shown in Figure 5.
  • Page 10 AN706-00040-2v0-E Figure 3 ICE Figure 4 USB memory Figure 5 USB cable...
  • Page 11: Equipment Other Than System Item Required

    AN706-00040-2v0-E Equipment Other than System Item Required A list of equipment other than system items required is given in Table 2, and equipment used as need is given in Table 3. Table 2 Equipment other than system items required Name pcs.
  • Page 12: Board Appearance

    AN706-00040-2v0-E Board Appearance A photograph of the external appearance of the simple AV system board is shown in Figure 6. Figure 6 Photograph of External Appearance of Simple AV System Board...
  • Page 13: Power Supply Method

    AN706-00040-2v0-E Power Supply Method USB bus power of the PC is used as the power supply for the simple AV system board. Connect the Type A side of the USB cable (with Type A - Type B connector) to the USB port of the PC and connect the Type B side to the USB power supply connector of the simple AV system board.
  • Page 14: Program Execution Method

    AN706-00040-2v0-E PROGRAM EXECUTION METHOD Program Execution Using Debugger 4.1.1 Activation of KEIL Integrated Development Environment Double-clicking “AV_demo.uvproj” inside the Project folder activates the KEIL integrated development environment and opens the simple AV system project. (1) Designation of Compile Options (MP3 and AAC Switch) Figure 8 Designation Operations of Compile Options As shown in Figure 8, right-clicking on “AV_demo”...
  • Page 15 AN706-00040-2v0-E In the case of MP3, set “MUSIC_MP3” for “Define” of the “C/C++” and “Asm” tabs of the option screen; in the case of AAC, set “MUSIC_AAC”. (Figure 9, Figure 10) Setting values Setting values -MUSIC_MP3 -MUSIC_MP3 -MUSIC_AAC -MUSIC_AAC Figure 9 C/C++ Compile Options Designation Method Setting values Setting values -MUSIC_MP3...
  • Page 16 AN706-00040-2v0-E (2) Program Build Rebuilds program. Rebuilds program. プログラムをリビルド プログラムをリビルド プログラムをビルド プログラムをビルド Builds program. Builds program. Figure 11 Simple AV System Build Click the location shown in Figure 11 to build or rebuild the program. After successfully building or rebuilding, the sample program can be exported to the microcontroller.
  • Page 17: Start Of Sample Program Export And Debug

    AN706-00040-2v0-E 4.1.2 Start of Sample Program Export and Debug (1) ICE Connection The equipment connection diagram for exporting the program to the microcontroller is shown in Figure 12. The PC and simple AV system board are connected via ICE. Figure 12 Equipment Connections for Exporting Program (2) Exporting the Program to the Microcontroller Click the location shown in Figure 13 to export the program to the microcontroller.
  • Page 18 AN706-00040-2v0-E (3) Debug Activation Click the location shown in Figure 14 and activate the debugger. Debugging can then be started. Starts debug. Figure 14 Operation of Debug Activation...
  • Page 19: Program Execution Using Debugger

    AN706-00040-2v0-E 4.1.3 Program Execution Using Debugger When the debugger is activated, the screen appears as shown in Figure 15. Press “Execute” to start executing the program. Execute Figure 15 Screen When Debugger is Activated For other debugger operations, see help. Standalone Program Execution When the program is exported and debugging is completed by the procedure given in “4.1 Program Execution Using Debugger,”...
  • Page 20: Supported Media

    AN706-00040-2v0-E SUPPORTED MEDIA Formats that can be Used for USB Memory The USB memory formats that can be used by the file system are given in Table 4. If using a file system (middleware), a separate contract is required. Table 4 Recognition Media Capacity and Applicable Formats Recognition Media Applicable Formats Remarks...
  • Page 21: Image Data

    AN706-00040-2v0-E Image Data The items of image data supported by the sample program are given in Table 6. If using a JPEG encoder/decoder (middleware), a contract is required. Table 6 Image Data Supported by the Sample Program Item Description Remarks File format JPEG “picture1.jpg”...
  • Page 22: Operation Method

    AN706-00040-2v0-E OPERATION METHOD Touch Operation Area Power Switch Speaker Connector USB Connector for Power Supply Select your favorite music! USB Memory Connector Selection Previous Switch Selection Next Switch Reset Switch Selection Indicator LED Play/Stop Switch Figure 16 Operation Explanation Diagram MP3 File Play (1) From Preparation to Power On ①...
  • Page 23 AN706-00040-2v0-E (2) Song Selection Operation Pressing the song selection next switch selects audio file in the following order. music1.mp3 => music2.mp3 => ... => music5.mp3 If the next switch is pressed while music5.mp3 is selected, music5.mp3 is then selected. Pressing the song selection previous switch selects audio file in the following order. music5.mp3 =>...
  • Page 24 AN706-00040-2v0-E (3) Play Start Operation While music is not yet played, the selected music can be played by the following operation. ① Press down the Play/Stop switch. Play/Stop Switch Figure 18 Play Start Operation by Play/Stop Switch ② Touch the thumbnail on the touch panel (LCD) (MP3). (picture1.jpg to picture5.jpg corresponds to music1.mp3 to music5.mp3) Touch the touch operation area image with your finger.
  • Page 25 AN706-00040-2v0-E Figure 20 LCD Display While Playing...
  • Page 26 AN706-00040-2v0-E (4) Play Stop Operation While music is playing, it can be stopped by the following operation. ① Press the Play/Stop switch. Play/Stop Switch Figure 21 Play Stop Operation by Play/Stop Switch ② Touch the touch panel. When you touch the enlarged image with your finger, the music stops playing. Touch Operation Area Figure 22 Play Stop Operation by Touch Panel When music is stopped the image simultaneously switches the thumbnail display.
  • Page 27 AN706-00040-2v0-E Select your favorite music! Figure 23 Thumbnail Display...
  • Page 28: Aac File Play

    AN706-00040-2v0-E AAC File Play (1) From Preparation to Power On Audio data (music1.aac to music5.aac) is contained in the root directory of the USB memory. Insert USB memory in USB memory connector of simple AV system board. Connect earphones or speakers to the speaker connector. Connect USB cable to the USB connector for power supply.
  • Page 29 AN706-00040-2v0-E (3) Play Start Operation While music is being played, the selected music can be played by the following operation. ・ Press down the Play/Stop switch. Play/Stop Switch Figure 25 Play Start Operation by Play/Stop Switch (4) Play Stop Operation While music is playing, it can be stopped by the following operation.
  • Page 30: Specifications

    7.1.1 General Specifications General specifications of the simple AV system board are given in Table 7. Table 7 General Specifications Item Description Remarks Microcontroller MB9BF506R(Fujitsu Semiconductor) Power supply USB bus power (+5V) Does not include Current consumption 300mA(typ.) external connected equipment.
  • Page 31: Hardware Block Diagram

    AN706-00040-2v0-E 7.1.2 Hardware Block Diagram The hardware block diagram is shown in Figure 27. LCD Board Microcontroller MB9BF506R Board Speaker Jack X‟tal Counter CSIO 27MHz Clock JTAG Generator JTAG Interface Touch Panel Touch Driver Panel Backlight GPIO Driver Switch External Host USB Host Driver...
  • Page 32: Main Components

    7.1.3 Main Components A list of main components is given in Figure 8. Figure 8 Main Components of Simple AV System Board Part Number pcs. Remarks Fujitsu Semiconductor MB9BF506R Microcontroller Microcontroller Board: KEIL MCB9B500 2.4” TFT LCD with touch panel AMPIRE AM-240320D4TNQW-00H®...
  • Page 33: Microcontroller

    AN706-00040-2v0-E 7.1.4 Microcontroller 7.1.4.1 Pin Connection A photograph of the external appearance of the microcontroller is shown in Figure 28 and a list of pin connections is given in Table 9. Microcontroller(MB9BF506R) Microcontroller(MB9BF506R) Figure 28 Photograph of Microcontroller External Appearance Table 9 List of Microcontroller Pin Connections Pin Name (Use...
  • Page 34 AN706-00040-2v0-E Pin Name (Use Connection Destination Remarks Function) MDATA07 LCD controller (D7) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) Touch panel controller (xCS) INT10_1 Touch panel controller (xPENIRQ) ― ― (Not used) ―...
  • Page 35 AN706-00040-2v0-E Pin Name (Use Connection Destination Remarks Function) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) ―...
  • Page 36 AN706-00040-2v0-E Pin Name (Use Connection Destination Remarks Function) MDATA12 LCD controller (D12) MDATA13 LCD controller (D13) MDATA14 LCD controller (D14) MDATA15 LCD controller (D15) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) ―...
  • Page 37 AN706-00040-2v0-E Pin Name (Use Connection Destination Remarks Function) ― ― (Not used) ― ― (Not used) ― ― (Not used) ― ― (Not used) DA converter (SCK), SCK5_1 Binary Counter (Q2[8 divisions output]) SOT5_1 DA converter (SDIN) Clock Generator(S0) ― ―...
  • Page 38: Microcontroller Mode Switch And Function Switch

    AN706-00040-2v0-E 7.1.4.2 Microcontroller Mode Switch and Function Switch The microcontroller has the following two modes, which can be switched by external jumper socket. (1) Serial writer mode (2) User mode This section contains an overview of the two modes and a description of the setting method.
  • Page 39 AN706-00040-2v0-E (2) User Mode [Overview] Mode that activates the internal ROM (flash) of the microcontroller mounted in the microcontroller. Operation starts when the CPU obtains reset vector from the flash memory. Setting the MD0 pin of the microcontroller to “L” level switches to this mode. [Setting Method] Insert the jumper for switching modes of the microcontroller in the silk notation “MD0L”...
  • Page 40: Usb Interface Function Switching

    AN706-00040-2v0-E 7.1.4.3 USB Interface Function Switching The microcontroller has the following two USB interface functions, which can be switched by external jumper socket. (1) USB Host Interface Function (2) USB Function Interface Function This section contains an overview of the two interface functions and a description of the setting method.
  • Page 41: Da Converter

    AN706-00040-2v0-E 7.1.5 DA Converter The LCD board is equipped with a DA converter for I S conversion. The external appearance and connection diagram of the DA converter are shown in Figure 33. DA Converter Microcontroller DA Converter Pin No.103:SOT4_0 Pin No.4:LRCK Pin No.104:SCK4_0 Pin No.3:MCLK Pin No.111:SCK5_1...
  • Page 42: Key Input Switch

    AN706-00040-2v0-E 7.1.6.2 Key Input Switch The LCD board is equipped with a power switch. The external appearance and connection diagram of the key input switch are shown in Figure 35. +3.3V Selection Prev Microcontroller Switch Selection Next Selection Prev Switch (P68) Switch Pin No.108:P68 Play/Stop Switch...
  • Page 43: Indicator

    AN706-00040-2v0-E 7.1.7 Indicator 7.1.7.1 LCD Module with Touch Panel The LCD board is equipped with an LCD module with touch panel. The external appearance of the LCD module with touch panel is shown in Figure 37 and the specifications of the LCD module with touch panel are given in Figure 10. For connection of microcontroller and LCD module with touch panel, see Table 9.
  • Page 44: Power Led

    AN706-00040-2v0-E 7.1.7.2 Power LED The microcontroller board is equipped with a power LED that indicates power supply status. The external appearance of the power LED is shown in Figure 38 and the specifications are given in Table 11. Power LED Figure 38 Power LED external appearance Table 11 Power LED Specifications Connection...
  • Page 45: Selection Indicator Led

    AN706-00040-2v0-E 7.1.7.3 Selection Indicator LED The microcontroller board is equipped with a selection indicator LED that indicates selection status. The external appearance and connection diagram of the selection indicator LED are shown in Figure 39 and the selection indicator LED specifications are given in Table +3.3V Microcontroller music1.xxx...
  • Page 46: External Interface

    AN706-00040-2v0-E 7.1.8 External Interface 7.1.8.1 Power Supply Interface The LCD board is equipped with a USB connector that functions as a power supply interface. Power is supplied by connecting the USB cable to the USB connector for power supply. The external appearance of the USB connector for power supply is shown in Figure 40. The USB connector for power supply uses a conventional USB-B Type connector, but the USB signal line is not connected.
  • Page 47: Usb Interface

    AN706-00040-2v0-E 7.1.8.3 USB Interface The microcontroller board is equipped with a USB memory connector that functions as a USB interface. The external appearance of the USB memory connector is shown in Figure 42 and the USB memory connector specifications are given in Table 13. USB Memory Connector Figure 42 USB Memory Connector External Appearance Table 13 USB Memory Connector Specifications...
  • Page 48: Jtag Interface

    AN706-00040-2v0-E 7.1.8.4 JTAG Interface The microcontroller board is equipped with a JTAG interface connector for software debugging by JTAG interface. The external appearance of the JTAG interface connector is shown in Figure 43 and the pin assignment is given in Table 14. JTAG Interface Connector Figure 43 JTAG Interface Connector External Appearance Table 14 JTAG Interface Connector Pin Assignment...
  • Page 49: Etm Interface

    AN706-00040-2v0-E 7.1.8.5 ETM Interface The microcontroller board is equipped with an ETM interface connector for software debugging by ETM interface. The external appearance of the ETM interface connector is shown in Figure 44 and the pin assignment is given in Table 15. ETM Interface Connector Figure 44 ETM Interface Connector External Appearance Table 15 ETM Interface Connector Pin Assignment...
  • Page 50: Software

    Mass Storage Class (MSC)Driver (MSC)Driver Control Control Control Control Driver Driver Driver Driver Timer Control Timer Control Host Host Driver Driver Driver Driver Hardware Hardware Target Board Target Board Fujitsu Semiconductor Library Fujitsu Semiconductor Library Figure 45 Software Block Diagram...
  • Page 51: Software Library

    AN706-00040-2v0-E 7.2.2 Software Library (1) File System  Name Multi Device File Access Library V03L01 (object for small MCU, Evaluation)  Overview File system library for system (abbreviated as MDF). embedded Used when you want to handle data a directory created by target devices by PC. Facilitates data transfer between PC and devices because multi device data can be managed by the same file and directory format used by the PC.
  • Page 52: System Specifications

    AN706-00040-2v0-E 7.2.3 System Specifications 7.2.3.1 Microcontroller System Specifications Microcontroller system specifications are given in Table 16. Table 16 Microcontroller System Specifications Item Description Remarks Operation CPU:80MHz High-speed PLL oscillation Clock APB1 to 3:40MHz Internal 20 multiplier ROM(FLASH) 113.0Kbyte (*1) Vector section: 248 bytes Program section: 112.7 Kbytes 152.6 Kbytes Vector section: 248 bytes...
  • Page 53: Memory Map

    AN706-00040-2v0-E 7.2.3.2 Memory Map The memory maps for ROM (flash) and RAM are shown in Figure 46. ROM(FLASH) ROM(FLASH) 0x0007FFFF 0x20007FFF 0x0007FFFF 0x20007FFF Vacancy 0x20007FA8 Stack 0x20005FA8 Variable Vacancy Variable Vacancy 0x20000000 0x20000000 Vacancy 0x1FFFFFA0 Stack 0x1FFFE000 0x0002626C Heap 0x0001C3E8 Program Heap Program...
  • Page 54: Mfs System Specifications

    AN706-00040-2v0-E 7.2.3.3 MFS System Specifications MFS system specifications are given in Table 17. Table 17 MFS System Specifications Channel No. Function Baud rate Remarks - - (Not used) - - (Not used) - - (Not used) - - (Not used) S(*) 1411200/1536000 LR channel data output to DAC...
  • Page 55: Interrupt System Specifications

    AN706-00040-2v0-E 7.2.3.5 Interrupt System Specifications Interrupt system specifications are given in Table 19. Table 19 Interrupt System Specifications Vector Interrupt Factor Function Remarks Number - Reset Reset_Handler Base timer ch. 2 BTIM_IRQHandler Processes an interrupt by 1ms interrupt cycle. USB host (each USB_EP0_STA_IRQHandler #50 Processes an interrupt for USB status) interrupt...
  • Page 56: Api Specifications

    AN706-00040-2v0-E 7.2.4 API Specifications This chapter gives I S driver API used for audio playback processing in addition to API used for application layer. I S driver API is also described in the application notes for simple AV system solution. For more information, see the notes. 7.2.4.1 Audio Playback API Function...
  • Page 57: Image Display Api

    AN706-00040-2v0-E Function void AUDIO_PlayTask(void) Overview Audio play processing main function Invoked during main loop (see “7.2.8.1 Main Processing Function”). Parameter None Return None value 7.2.4.2 Image Display API Function void IMAGE_Init(void) Overview Image display processing initialization function Invoked before entering the main loop (see “7.2.8.1 Main Processing Function”).
  • Page 58 AN706-00040-2v0-E Function uint8_t IMAGE_Show( const uint8_t *FileName, uint8_t AreaID, uint16_t Color) Overview Image display control processing function Parameter FileName Filename read from USB memory AreaID LCD display area No. (*) IMAGE_SHOW_AREA1 Area 1 IMAGE_SHOW_AREA2 Area 2 IMAGE_SHOW_AREA3 Area 3 IMAGE_SHOW_AREA4 Area 4 IMAGE_SHOW_AREA5 Area 5 IMAGE_SHOW_AREA6 Area 6 IMAGE_SHOW_AREA7 Area 7...
  • Page 59 AN706-00040-2v0-E (*) LCD display area corresponds as follows. Area1 Area2 Area3 Area4 Area5 Area6 Area7 Area8 Area9 Figure 47 LCD Display Area...
  • Page 60: Led Control Api

    AN706-00040-2v0-E 7.2.4.3 LED Control API Function void LED_Init (void) Overview LED control processing initialization function Invoked before entering the main loop (see “7.2.8.1 Main Processing Function”). Parameter None Return None value Function STATUS LED_Set(uint16_t IdCh, uint8_t LEDStatus) Overview LED control processing function Turns specified LED on or off.
  • Page 61: Switch Detection Api

    AN706-00040-2v0-E 7.2.4.4 Switch Detection API Function void SW_Init (void) Overview Switch detection processing initialization function Invoked before entering the main loop (see “7.2.8.1 Main Processing Function”). Parameter None Return None value Function STATUS SW_GetStatus(uint8_t ButtonId, uint8_t *pStatus) Overview Switch status acquisition function Parameter ButtonId Switch No.
  • Page 62: Timer Control Driver Api

    AN706-00040-2v0-E 7.2.4.5 Timer Control Driver API Function void TIMER_Init(void) Overview Initialization function for timer control driver Invoked before entering the main loop (see “7.2.8.1 Main Processing Function”). Parameter None Return None value Function STATUS TIMER_Start(uint8_t IdCh) Overview Timer start function Invoked before entering the main loop and after TIMER_Init invocation (see “7.2.8.1 Main Processing Function”).
  • Page 63: Touch Panel Control Driver Api

    AN706-00040-2v0-E 7.2.4.6 Touch Panel Control Driver API Function STATUS TOUCH_Init(void) Overview Initialization function for touch panel control driver Invoked before entering the main loop (see “7.2.8.1 Main Processing Function”). Parameter None Return Processing results value TOUCH_RET_OK Normal completion TOUCH_RET_ILLEGAL_ERROR Timer setting failure Function STATUS TOUCH_GetAreaStatus(uint16_t* Status) Overview...
  • Page 64: I 2 S Driver Api

    AN706-00040-2v0-E 7.2.4.7 S Driver API Function void I2S_Init (void) Overview Initializes I S driver. Sets MFS initial settings (CSIO settings) and DMAC initial settings. Parameter None Return None value Function STATUS I2S_Start (uint8 t audio sample rate) Overview Starts I S operation.
  • Page 65: Operation Limit

    AN706-00040-2v0-E 7.2.5 Operation Limit The following limitations apply to operation of the sample program used by the simple AV system. ◆Concerning assembly of MP3 and AAC decoder The MP3 and AAC decoders cannot conduct processing simultaneously because the built-in RAM size is insufficient. ◆Concerning JPEG file processing for AAC decoder assembly If an AAC decoder is assembled, JPEG file decode processing cannot be conducted because the built-in RAM size is insufficient.
  • Page 66: Operation Flow Of Entire Application

    AN706-00040-2v0-E 7.2.6 Operation Flow of Entire Application 7.2.6.1 (1) The application operation flow with audio data playback stopped is as follows. ① USB MSC device connection/disconnection judgment is executed in the main loop. ② If a USB memory is connected, after reading the JPEG files from the USB memory and displaying the images for selection, switch pressing detection and touch panel detection are conducted.
  • Page 67 AN706-00040-2v0-E Timer interrupt(ch.2)(1ms) USB-MSC device connection/ disconnection judgement Switch detection module Switch chattering processing Media files Was media connected? Selection select.jpg Play/Stop Selection previous switch next switch picture1.jpg switch picture2.jpg JPEG Read all JPEG files and display File images for selection on LCD picture3.jpg picture4.jpg Switch...
  • Page 68 AN706-00040-2v0-E (2) The application operation flow with audio data playback in progress is as follows. ① USB MSC device connection/disconnection judgment is executed in the main loop. ② If the USB memory has been removed, stop playback, close the opened MP3 file, quit the file system and operation shifts to initialization status.
  • Page 69 AN706-00040-2v0-E USB-MSC device connection/ disconnection judgement Timer interrupt(ch.2)(1ms) Was media disconnected? Media files Switch detection module Switch chattering select.jpg processing picture1.jpg Stop MP3 play picture2.jpg JPEG Selection Play/Stop Selection file picture3.jpg previous Close MP3 file switch next switch switch picture4.jpg picture5.jpg End file system music1.mp3...
  • Page 70: Aac

    AN706-00040-2v0-E 7.2.6.2 (1) The application operation flow with audio data playback stopped is as follows. ① USB MSC device connection/disconnection judgment is executed in the main loop. ② If the USB memory is connected, switch press-down detection is executed. ③ If the play/stop switch is detected to have been pressed down, the AAC file selected from the USB memory is opened.
  • Page 71 AN706-00040-2v0-E (2) The application operation flow with audio data playback in progress is as follows. ① USB MSC device connection/disconnection judgment is executed in the main loop. ② If the USB memory has been removed, stop playback, close the opened AAC file, quit the file system and operation shifts to initialization status.
  • Page 72 AN706-00040-2v0-E USB-MSC device connection/ disconnection judgement Timer interrupt(ch.2)(1ms) Was media disconnected? Switch detection module Switch chattering processing Stop AAC play Selection Play/Stop Selection previous switch next switch Close AAC file switch End file system Change to initialization state Switch Swith press detection state Was the Play/Stop switch pressed?
  • Page 73: Application State Transition

    AN706-00040-2v0-E 7.2.7 Application State Transition 7.2.7.1 In the case of MP3, the simple AV system consists of the six states shown in Figure 52. [Initial setting complete] ②Initialization ①Reset state state [Media recognized] [USB memory removed] ③Audio data selection image display processing [USB memory removed] state...
  • Page 74 AN706-00040-2v0-E ② Initialization State When software internal initialization processing is completed and recognition media (USB memory) is inserted, the simple AV system is in initialization state until the media is recognized. [Individual State] Play/stop switch, selection previous switch, selection next switch Does not function even if pressed down.
  • Page 75 AN706-00040-2v0-E ③ Audio Data Selection Image Display Processing State After the USB memory is recognized, the system is in audio data selection image display processing state. Image files are read from the USB memory and images for selecting audio data are displayed on the LCD.
  • Page 76 AN706-00040-2v0-E ④ Audio Data Playback Stop State After display processing is completed for the LCD in audio data selection image display processing state, the system is in audio data playback stop state. [Individual State] Play/Stop switch With the play/stop switched pressed down, the system shifts to audio data image display processing state.
  • Page 77 AN706-00040-2v0-E ⑤ Audio Data Image Display Processing State When the play/stop switch is pressed down in audio data playback stop state or is selection is made from the touch panel, the system is in audio data image display processing state. Image files are read from the USB memory, and audio data images are displayed on the LCD.
  • Page 78 AN706-00040-2v0-E ⑥ Audio Data Playback State After display processing is completed for the LCD in audio data image display processing state, if the target MP3 file exists, the system is in audio data playback stop state. [Individual State] Play/Stop switch Playback is stopped by pressing down the play/stop, and the system shifts to audio data selection image display processing state.
  • Page 79: Aac

    AN706-00040-2v0-E 7.2.7.2 In the case of AAC, the simple AV system consists of the four states shown in Figure 55. ②Initialization [Initial setting complete] ①Reset state state [Media recognized] [USB memory removed] ③Audio data [USB memory removed] playback stop state [Play/stop switch press] or [Play/stop switch press] [AAC file play finish]...
  • Page 80 AN706-00040-2v0-E ② Initialization State When software internal initialization processing is completed and recognition media (USB memory) is inserted, the simple AV system is in initialization state until the media is recognized. [Individual State] Play/stop switch, selection previous switch, selection next switch Does not function even if pressed down.
  • Page 81 AN706-00040-2v0-E ③ Audio Data Playback Stop State After the USB memory is recognized, the system is in audio data playback stop state. [Individual State] Play/Stop switch With the play/stop switch pressed down, if the target AAC file exists, the system is in audio data playback state.
  • Page 82 AN706-00040-2v0-E ④ Audio Data Playback State If the play/stop button is pressed down in the audio data playback state, if the target AAC file exists, the system is in audio data playback state. [Individual State] Play/Stop switch Playback is stopped by pressing down the play/stop, and the system shifts to audio data playback stop state.
  • Page 83: Operation Flow

    AN706-00040-2v0-E 7.2.8 Operation Flow The meanings of the function call points in the flowchart are shown in Figure 56. Function call described Function call described Function call described in API specifications and in API specifications in operation flowchart operation flowchart Figure 56 Meanings of function call points 7.2.8.1 Main Processing Function...
  • Page 84: Usb Task Processing Function

    AN706-00040-2v0-E 7.2.8.2 USB Task Processing Function After detecting USB device connection/disconnection, the processing shown in Figure 58 is executed. (av_demoapp_usb_task) Start USB device connection event occur and disconnection event not occur USB device disconnection event occur Clear USB device disconnection event. Clear USB device disconnection event.
  • Page 85: File System (Mdf) Task Processing Function

    AN706-00040-2v0-E 7.2.8.3 File System (MDF) Task Processing Function File System (MDF) processing is executed. (av_demoapp_MDF_task) After reading MBR (*1) and PBR (*2) data, the number of blocks for each sector is calculated. When the MDF file system is initialized, media read and write processing is registered. Start MDF operation stage judgment File open...
  • Page 86: Hmi Task Processing Function

    AN706-00040-2v0-E 7.2.8.4 HMI Task Processing Function HMI processing is executed. (av_demoapp_HMI_task) LCD display, switch detection touch panel detection, etc., user interface processing is executed. Start HMI status judgment Select display Play display MP3 format MP3 format Display image for audio data Display image for playback audio selection screen on entire data on entire LCD.
  • Page 87 AN706-00040-2v0-E USB device has been removed and HMI status is other than nitialization MP3 format Clear image for entire LCD. (IMAGE_ClearShow) Set initialization for HMI status. Finish Figure 61 HMI Task Processing Function Flow (2)
  • Page 88: Audio Play Task Processing Function

    AN706-00040-2v0-E 7.2.8.5 AUDIO Play Task Processing Function AUDIO Play processing is executed. (AUDIO_PlayTask) Audio data read from the USB memory using the MDF file system is decoded and played. Start Set TRUE for audio play processing loop condition. S status stop? Audio stage is other than stop and other than initialization Set audio stage to stop.
  • Page 89 AN706-00040-2v0-E Audio stage judgment Open Open audio file. (audio_decode_open) Audio file opened successfully? Set library initialization for audio stage. Set initialization for audio stage. Library initialization Initialize decode library. (audio_decode_libraryinit) Decode library successfully initialized? Set analyze for audio stage. Set stop for audio stage. Analyze File read Decode...
  • Page 90 AN706-00040-2v0-E File read Read audio file. (audio_decode_read) Audio file read successfully? Set decode for audio stage. Set initialization for audio stage. Decode Sampling Stop Decode audio file. Others (audio_decode_decoding) Audio file decode results judgment Successfully decoded Set sampling for AUDIO stage. MP3 format Less than 1 frame Set file read for audio stage.
  • Page 91 AN706-00040-2v0-E Sampling Sample decode data. (audio_decode_upsample) Sampling results judgment Successfully sampled Output buffer full of sampling data? Play start flag false? Is sampling rate 8k,12k,16k,24k,32k,48k? Start I S by 48kHz. Start I S by 44.1kHz. S_Start) S_Start) Set true for play start flag. RAW data buffer has vacancy Set file read for audio stage.
  • Page 92: Switch Press Detection Processing Function

    AN706-00040-2v0-E 7.2.8.6 Switch Press Detection Processing Function Switch press detection processing is executed. (av_demoapp_sw_detect) Play/stop switch, selection next switch, selection previous switch press detection is executed. Start Loop counter <-0 Loop counter < Number of SW buttons Get switch state. (SW_GetStatus) No current switch press and switch status pressed...
  • Page 93: Processing Function After Switch Press Detection

    AN706-00040-2v0-E 7.2.8.7 Processing Function After Switch Press Detection Processing after switch press detection is executed. (av_demoapp_sw_process) Play/stop switch, selection next switch, selection previous switch press detection results are checked and if pressing has been detected, respective switch processing is executed. Start Play/stop switch press detection...
  • Page 94: Touch Panel Touch Detection Processing Function

    AN706-00040-2v0-E 7.2.8.8 Touch Panel Touch Detection Processing Function Touch panel touch detection processing is executed. (av_demoapp_tp_detect) Detects which position of the nine areas (see Figure 47) on the LCD has been touched. Start Get area status from touch panel. (TOUCH_GetAreaStatus) Loop counter <-0...
  • Page 95: Processing After Touch Panel Touch Detection Function

    AN706-00040-2v0-E 7.2.8.9 Processing After Touch Panel Touch Detection Function Processing after touch panel touch detection is executed. (av_demoapp_tp_process) Area state detection results of the touch panel are checked and the processing shown in Figure 69 is executed. Start Touch panel detection HMI status judgment Select Touch panel area ID 1 to 4, 6?
  • Page 96: File Configuration

    AN706-00040-2v0-E 7.2.9 File Configuration The following is a software development environment file configuration provided as a sample. :Common header file directory +---common :Peripheral access definition source file +---core_cm3.h :Middleware directory (*) +---middle :AAC decoder library directory (*) +---aac :File System (MDF) library directory (*) +---filesystem :JPEG decoder library directory (*) +---jpeg...
  • Page 97 AN706-00040-2v0-E :User setting file directory +---config :User setting source file for USB host driver +---usbh_config.c :User setting header file for audio play processing +---audio_config.h :User setting header file for I +---i2s_config.h S control driver :User setting header file for LED control processing +---led_config.h :User setting header file for switch detection processing +---switch_config.h...
  • Page 98 AN706-00040-2v0-E :USB host driver directory +---usb :USB host driver API source file +---usbh_api.c :USB connection/disconnection processing source file +---usbh_atch.c :USB host controller processing source file +---usbh_hc.c :USB host manager processing source file +---usbh_mgr.c :USB-Mini host controller driver +---usbh_mh_core.c Core processing source file :USB-Mini host controller driver +---usbh_mh_dma.c DMA processing source file...
  • Page 99 AN706-00040-2v0-E :Include file directory +---include :Audio play processing header file +---audio.h :Application processing header file +---avdemoapp.h :Common definition header file +---common.h :GPIO definition header file +---gpio.h :I +---i2s.h S control driver header file :CPU fixed definition header file directory +---cpu :Image display processing header file +---image.h :LCD control driver header file...

Table of Contents