Associated Part Family: Series Name Product Number MB9B500A MB9B300A

Similar documents
CE CY8CKIT-042-BLE F-RAM Data Logger

THIS SPEC IS OBSOLETE

Multifunction Serial Interface (PDL_MFS) Features. General Description. When to Use a PDL_MFS Component. Quick Start 1.0

PSoC Creator Quick Start Guide

CE95314 PSoC 3, PSoC 4, and PSoC 5LP EZI2C

AN F²MC-16FX Family, I2C. Contents. 1 Introduction. This application note describes how to communicate via I2C with a Serial EEPROM.

Setting Oscillation Stabilization Wait Time of the main clock (CLKMO) and sub clock (CLKSO)

This input determines the next value of the output. The output does not change until the next rising edge of the clock.

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

F²MC-8FX Family MB95200H/210H Series Capacitance Touch Sensor

Digital Multiplexer and Demultiplexer. Features. General Description. Input/Output Connections. When to Use a Multiplexer. Multiplexer 1.

Use the Status Register when the firmware needs to query the state of internal digital signals.

Digital Logic Gates. Features. General Description. Input/Output Connections. When to Use a Logic Gate. Input 1. Input 2. Inputs 3-8 * 1.

Base Timer Channel (BT) Features. General Description. When to Use a PDL_BT Component 1.0

This section describes the various input and output connections for the SysInt Component.

Capable of adjusting detection timings for start bit and data bit

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

Use the Status Register when the firmware needs to query the state of internal digital signals.

The AMuxSeq is capable of having between 2 and 32 analog inputs. The paired inputs are present when the MuxType parameter is set to "Differential.

ModusToolbox USB Configurator Guide

One 32-bit counter that can be free running or generate periodic interrupts

Use a DieTemp component when you want to measure the die temperature of a device.

AN FR Family, MB91F467S Emulation. 1 Introduction. 2 Hardware Setup. 2.1 Required parts

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

W H I T E P A P E R. Timing Uncertainty in High Performance Clock Distribution. Introduction

PSoC 6 Current Digital to Analog Converter (IDAC7)

Automatic reload of the period to the count register on terminal count

Nine-Output 3.3 V Buffer

Analog Multiplexer (AMux) Features. General Description. Input/Output Connections. When to Use an AMux Single or differential connections

FM4 S6E2Cx Series Over The Air Update 32-Bit Microcontroller With Embedded Dual Flash

Comparator (Comp) Features. General Description. When to use a Comparator Low input offset. User controlled offset calibration

W H I T E P A P E R. Introduction. Devices. Energy Comparison of Cypress F-RAM and EEPROM

Cypress BLE-Beacon ios App User Guide

PSoC 4 Current Digital to Analog Converter (IDAC)

EZ-PD Analyzer Utility User Guide

Supports a range of speeds of external memories (from 5 to 200 ns) Supports external memory power-down, sleep, and wakeup modes

Optional Pause Pulse for constant frame length of 282 clock ticks

FM3 Family Motor Graphical Interface User Manual

Scanning Comparator (ScanComp) Features. General Description. Input/Output Connections. When to Use a Scanning Comparator. clock - Digital Input* 1.

BGM Adaptor MB E Operation Manual. 8FX Family 8-bit Microcontroller. Doc. # Rev. *A

Configurable transfer modes: single transfer, 1D transfer (using X loop) and 2D transfer (using both X and Y loops).

Chip Errata for the MB96300/MB96600 Series MOVS/MOVSW Overlap of source and destination region, F 2 MC-16FX Microcontroller

Supports Analog, Digital I/O and Bidirectional signal types

Shift Register. Features. General Description 1.20

16-Mbit (512 K words 32 bits) Static RAM with Error-Correcting Code (ECC)

MB39C811-EVB-03. PMIC for Solar/Vibration Energy Harvesting, Evaluation Board Operation Guide. Doc. No Rev. *B

CE PSoC 4: Time-Stamped ADC Data Transfer Using DMA

PSoC Creator 4.2 Production Release Notes

The Emulated EEPROM Component should be used to store nonvolatile data on a target device.

Version February 02, 2018

Hardware Design Guidelines for Using EZ-PD CCG3PA Devices in Power Adapter Applications

EZ I2C Slave. Features. General Description. When to use a EZ I 2 C Slave Industry standard Philips I 2 C bus compatible interface

FM Universal Peripheral Driver Library Quick Start Guide

FM0+ Family S6E1A1 Series, Flash Programming Guide

AN F²MC - 8FX Family, New 8FX Series, EEPROM Library. Contents. 1 Introduction

CY8CKIT-002. PSoC MiniProg3 Program and Debug Kit Guide. Doc. # Rev. *H

16K/64K/128K 9 Low-Voltage Deep Sync FIFOs

THIS SPEC IS OBSOLETE

4-Mbit (256K words 16 bit) Static RAM

Sequencing Successive Approximation ADC (ADC_SAR_Seq) Features. General Description. When to Use the ADC_SAR_Seq Supports PSoC 5LP devices

16-Mbit (1M words 16 bit) Static RAM

CE56273 Associated Part Families: CY8C38xx/CY8C55xx Software: PSoC Creator Related Hardware: CY8CKIT-001 Author: Anu M D

Use the Status Register when the firmware needs to query the state of internal digital signals.

Use the Status Register when the firmware needs to query the state of internal digital signals.

TI: Uses a short pulse on spi_select to indicate start of transaction. National Semiconductor (Microwire): Transmission and Reception occur separately

Clock Programming Kit

PSoC 1 In-Circuit Emulator Development Kit Guide

External Library. Features. General Description 1.0. The library provides documentation for external components

Filter_ADC_VDAC_poll Example Project Features. General Description. Development Kit Configuration

Writing to Internal Flash in PSoC 3 and PSoC 5

8-Mbit (512K words 16 bit) Static RAM with Error Correcting Code (ECC)

AN EZ-USB FX3 I 2 C Boot Option. Application Note Abstract. Introduction. FX3 Boot Options

Energy Harvesting PMIC for Wireless Sensor Node

AN USB On-The-Go (OTG) Basics. Contents. 1 Introduction. 2 Cables

Peripheral Driver Library (PDL) Component (PDL Application Programming Interface (API) only)

Cypress HX2VL Configuration Utility Blaster User Guide

Operational Amplifier (Opamp) Features. General Description. Input/Output Connections. Noninverting Analog Follower or Opamp configuration

Cypress EZ-PD Configuration Utility User Manual

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

Master modes provide all functionality necessary to work in a multi-master environment.

The following table lists user modules used in this code example and the hardware resources occupied by each user module.

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

DMX512 Receiver Datasheet DMX512Rx V 1.0. Features and Overview

PSoC 1 I 2 C Bootloader

PSoC 4 Voltage Comparator (Comp) Features. General Description. When to Use Comparator Low input offset. User controlled offset calibration

FR Family SOFTUNE Workbench User's Manual for V6

THIS SPEC IS OBSOLETE

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

Cypress HX2VL Configuration Utility Blaster User Guide

FM4 S6E2H-Series Starter Kit Guide

Voltage Reference (Vref) Features. General Description. Input/Output Connections. When to Use a Vref Voltage references and supplies

M3H Group(2) Application Note 12-bit Analog to Digital Converter (ADC-A)

M3H Group(1) Application Note. I 2 C Interface (I2C-B) MASTER/SLAVE

CY3660-enCoRe V and encore V LV DVK Kit Guide

APPLICATION NOTE. AT6486: Using DIVAS on SAMC Microcontroller. SMART ARM-Based Microcontroller. Introduction. Features

Graphic LCD Interface (GraphicLCDIntf) Features. General Description. When to Use a GraphicLCDIntf 1.80

HX2VL Development Kit Guide. Doc. # Rev. *A

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

MB39C831-EVB-02 Thermal Energy Harvesting Evaluation Board Operation Guide

Transcription:

AN204354 FM3 Microcontroller Simple AV System Solution (JPEG, I 2 S, MP3, AAC, USB) Associated Part Family: Series Name Product Number MB9B500A MB9B300A MB9BF504NA/505NA/506NA/504RA/505RA/506RA MB9BF304NA/305NA/306NA/304RA/305RA/306RA This application note is for those planning to design an image output processing system or process audio data using a microcontroller of the FM3 family. Contents 1 Introduction... 1 2 Simple AV System Board... 1 2.1 System Operation... 2 2.2 Hardware... 3 2.3 Software... 4 3 Performance... 15 3.1 Performance Measurement Environment... 15 3.2 Performance Measurement Items... 16 3.3 Performance Measurement Results... 17 Document History... 23 1 Introduction This application note is for those planning to design an image output processing system or process audio data using a microcontroller of the FM3 family made by Fujitsu Semiconductor. This document takes specific examples of a system or audio output control, LCD control and decoding of audio or image data contained in a USB memory, and gives the ROM and RAM size required by the FM3 family, and actual measurement results of CPU occupancy and system processing speed 2 Simple AV System Board The simple AV system described in the application notes conducts the following operations. For details, see the User Manual for the simple AV system board. 1. Reads image/audio files in USB memory (JPEG, MP3, AAC) 2. Switch detection 3. Image/audio file decoding (JPEG, MP3, AAC) 4. Image output (LCD display) 5. Touch panel control 6. Audio output www.cypress.com Document. 002-04354 Rev. *B 1

Figure 1. Simple AV System Board Schematic View Touch Panel Control Audio Output Image Output Image/Audio File Read Image/Audio File Decode Switch Detection 2.1 System Operation Image data processing 1. Reads JPEG files in USB memory connected to the USB interface. 2. Decodes JPEG files. 3. Outputs decoded JPEG files on the LCD. * JPEG file processing is not implemented if audio data is AAC. (See "3.3.1 Amount of ROM/RAM Used") Audio data processing 1. Reads audio data in USB memory connected to the USB interface. 2. Decodes read audio files. 3. Outputs decoded audio data to DA converter(dac). * Format of output audio data can be modified by middleware assembled. The application notes contain performance measurement results for MP3 and AAC file processing. Figure 2. System Configuration Diagram ICE LCD Board PC(Integrated Development Environment) Microcontroller Board USB Memory Microcontroller(Middleware, Sample Program) www.cypress.com Document. 002-04354 Rev. *B 2

2.2 Hardware 2.2.1 External Appearance of Simple AV System Board A photograph of the outer external appearance of the simple AV system board is shown in Figure 3. Figure 3. Photograph of External Appearance of Simple AV System Board www.cypress.com Document. 002-04354 Rev. *B 3

2.2.2 Hardw are Block Diagram The hardware block diagram of the system is shown in Figure 4. Figure 4. Hardware Block Diagram 2.3 Software 2.3.1 Softw are Block Diagram The software block diagram of the system is shown in Figure 5 Figure 5. Software Block Diagram Application Application Audio Play Image Display Audio Play Application Interface Switch Detection LED Control Middleware MP3/AAC Decoder Library I 2 S Control Driver JPEG Encoder/ Decoder Library LCD Control Driver File System [MDF] USB Host Mass Storage Class (MSC)Driver USB Host Driver Timer Control Driver Touch Panel Control driver Driver Hardware Target Board Fujitsu Semiconductor Library www.cypress.com Document. 002-04354 Rev. *B 4

2.3.2 Operation Flow of Entire Application MP3 1. The application operation flow with audio data playback stopped is as follows. 1. USB MSC device connection/disconnection judgment is executed in the main loop. 2. 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. 3. If the play/stop switch is detected to be pressed down, or if not detected, but an area of the touch panel is detected to have been touched, the JPEG files corresponding to the selected MP3 file are read from the USB memory and displayed for playback. If the selection previous switch or selection next switch are detected to have been pressed down, MP3 file selection is shifted and LED control is executed. 4. The MP3 selected from the USB memory is then opened. 5. The MP3 file header is read, MP3 file header analysis processing is conducted and operation shifts to audio data playback in progress status. This operation is shown in Figure 6. www.cypress.com Document. 002-04354 Rev. *B 5

Figure 6. Application Operation Flow (Audio Playback Stopped Status, Case of MP3) Timer interrupt(ch.2)(1ms) Media fies select.jpg picture1.jpg picture2.jpg picture3.jpg picture4.jpg picture5.jpg music1.mp3 music2.mp3 JPEG File USB-MSC device connection/ disconnection judgement Was media connected? Read all JPEG files and display images for selection on LCD Switch press detection Was the Play/Stop switch pressed? Switch detection module Play/Stop switch Switch state Selection previous switch Switch chattering processing Selection next switch LED control driver module music3.mp3 music4.mp3 music5.mp3 MP3 header Read JPEG files correspoinding to selected MP3 file numbers and display image for playing on LCD Open selected MP3 file Read selected MP3 header data and execute MP3 header analysis processing Change to audio data playback state Was the Selection previous switch or Selection next switch pressed? Select MP3, LED control LED1 LED2 LED3 LED4 LED5 LED state Touch panel detection Touch panel state Was touch of touch panel detected? Was the detected area 1-4, or 6? Select MP3, LED control Read JPEG files correspoinding to selected MP3 file numbers and display image for playing on LCD Open selected MP3 file LED state Timer interrupt(ch.2)(1ms) Touch panel control driver module Area 1 Area 2 Area 3 Area 4 Area 5 Area 6 Area 7 Area 8 Area 9 MP3 header Read selected MP3 header data and execute MP3 header analysis processing Change to audio data playback state www.cypress.com Document. 002-04354 Rev. *B 6

2. The application operation flow with audio data playback in progress is as follows. 1. USB MSC device connection/disconnection judgment is executed in the main loop. 2. If the USB memory has been removed, stop playback, close the opened MP3 file, quit the file system and operation shifts to initialization status. 3. If the USB memory is connected, play/stop switch press down detection and touch panel touch detection are executed. 4. If the play/stop switch is detected to have been pressed down, or if not detected, but an area of the touch panel is detected to have been touched, playback is stopped, the MPA file is closed, all JPEF filed are read from the USB memory, that images for selection are displayed and operation shifts to audio data playback stopped status. 5. It is confirmed whether there is enough empty area in an input buffer. 6. If there is enough empty area, the MP3 file is read from the USB memory and copied in the input buffer. 7. One frame of the input buffer is decoded and stored in the RAW buffer. 8. When 1 frame had been decoded, the RAW buffer is up-sampled and buried in the output buffer. 9. With DMA ch2 interrupt, data is sent from the output buffer to I 2 S in sequence. This operation is shown in Figure 7 www.cypress.com Document. 002-04354 Rev. *B 7

Figure 7. Application Operation Flow (Audio Playback Status, Case of MP3) USB-MSC device connection/ disconnection judgement Timer interrupt(ch.2)(1ms) Media files select.jpg picture1.jpg picture2.jpg picture3.jpg picture4.jpg picture5.jpg music1.mp3 music2.mp3 JPEG file Was media disconnected? Stop MP3 play Close MP3 file End file system Change to initialization state Switch detection module Play/Stop switch Selection previous switch Switch chattering processing Selection next switch music3.mp3 Swith press detection Switch state music4.mp3 music5.mp3 Was the Play/Stop switch pressed? Stop MP3 play Timer interrupt(ch.2)(1ms) Touch panel control driver module Close MP3 file Area 1 Area 2 Area 3 Read all JPEG files and display images for selection on LCD Area 4 Area 5 Area 6 Change to audio data playback stop state Area 7 Area 8 Area 9 Touch panel detection Touch panel state Was touch of touch panel detected? Stop MP3 play Are there enough empty area in the input buffer? Close MP3 file Read all JPEG files and display images for selection on LCD Change to audio data playback stop state Read MP3 data from media and copy in the input buffer One frame of the data in the input buffer is decoded, then store it to the RAW buffer Was one frame decoded successful? Up-sample the RAW buffer data and copy it to the output buffer DMA interrupt(ch.2) Sampling data output module PCM data PCM data Output buffer I 2 S output www.cypress.com Document. 002-04354 Rev. *B 8

AAC 1. The application operation flow with audio data playback stopped is as follows. 1. USB MSC device connection/disconnection judgment is executed in the main loop. 2. If the USB memory is connected, switch press-down detection is executed. 3. If the play/stop switch is detected to have been pressed down, the AAC file selected from the USB memory is opened. If the selection previous switch or selection next switch are detected to have been pressed down, AAC selection is shifted and LED control is executed. 4. The AAC file header is read, AAC file header analysis processing is conducted and operation shifts to audio data playback status. This operation is shown in Figure 8. Figure 8. Application Operation Flow (Audio Playback Stopped Status, Case of AAC) Timer interrupt(ch.2)(1ms) USB-MSC device connection/ disconnection judgement Switch detection module Switch chattering processing Media files music1.aac Was media connected? Switch press detection Was the Play/Stop switch pressed? Play/Stop switch Switch state Selection previous switch Selection next switch LED control driver module LED1 LED2 LED3 LED4 LED5 music2.aac music3.aac music4.aac AAC header Open selected AAC file Read selected AAC header data and execute AAC header analysis processing Was the Selection previous switch or Selection next switch pressed? music5.aac Change to audio data playback state Select AAC, LED control LED state 2. The application operation flow with audio data playback in progress is as follows. 1. USB MSC device connection/disconnection judgment is executed in the main loop. 2. If the USB memory has been removed, stop playback, close the opened AAC file, quit the file system and operation shifts to initialization status. 3. If the USB memory is connected, play/stop button press-down detection is executed. 4. If the play/stop button is detected to have been pressed down, playback stops, the AAC file is closed, and operation shifts to audio data playback stop status. 5. It is confirmed whether there is enough empty area in an input buffer. 6. If there is enough empty area, the AAC file is read from the USB memory and copied in the input buffer. 7. One elementary stream of the input buffer is decoded and stored in the RAW buffer. 8. When 1 elementary stream had been decoded, the RAW buffer is up-sampled and buried in the output buffer. 9. With DMA ch2 interrupt, data is sent from the output buffer to I 2 S in sequence. This operation is shown in Figure 9. www.cypress.com Document. 002-04354 Rev. *B 9

Figure 9. Application Operation Flow (Audio Playback Status, Case of AAC) USB-MSC device connection/ disconnection judgement Was media disconnected? Stop AAC play Close AAC file End file system Change to initialization state Switch detection module Play/Stop switch Timer interrupt(ch.2)(1ms) Selection previous switch Switch chattering processing Selection next switch Swith press detection Was the Play/Stop switch pressed? Switch state Stop AAC play Are there enough empty area in the input buffer? Media files music1.aac Close MP3 file Change to audio data playback stop state Read AAC data from media and copy in the input buffer DMA interrupt(ch.2) Sampling data output module music2.aac music3.aac music4.aac music5.aac One frame of the data in the input buffer is decoded, then store it to the RAW buffer Was one frame decoded successful? Up-sample the RAW buffer data and copy it to the output buffer PCM data PCM data Output buffer I 2 S output www.cypress.com Document. 002-04354 Rev. *B 10

2.3.3 I 2 S Operation With the simple AV solution, in order to transmit data by 44.1kHz or 48kHz sampling to DAC, MFS channels 4 and 5 are used as CSIO in the slave mode and the clock inputs 8 divisions of 11.2896MHz or 12.288MHz. As for data, PCM data for which results of decoded MP3 or AAC file are output by up-sampling to 44.1kHz or 48kHz. (For up-sampling, see "3.2 Performance Measurement Items") PCM data output to I 2 S is shown in Figure 10. Figure 10. PCM Data Output to I2S 16bit 16bit L1 R1 L2 R2 L1:Left 1st sample L2:Left 2nd sample R1:Right 1st sample R2:Right 2nd sample PCM data is synchronized and output to DAC from MFS channel 5, and left/right data is synchronized and output to DAC from channel 4. PCM data is transmitted to MFS using DMAC channel 2 and left/right data using DMAC channel 3.And left/right data is set 1bit earlier than PCM data.i/o format of I 2 S is shown in Figure 11 SCK4_0/SCK5_1 (Clock input) SOT4_0 (LR Output) SOT5_1 (Data Output) D1 D0 D15 Figure 11. I2S I/O Format Because PCM data of 1 sample output to DAC is 16-bit Stereos (2ch), it is (11.2896[MHz]/8) / 16[bit] / 2[ch] = 44100[Hz] (12.288 [MHz] /8) / 16 [bit] / 2 [ch] = 48000 [Hz], and is therefore played at the sampling rate of 44.1kHz or 48kHz. D14 D12 ~~ Left Channel ~~ ~~ ~~ D2 D1 D0 ~~ ~~ Right Channel D15 D14 D12~~ D2 D1 D0 ~~ For details concerning the MFS and DMAC usage method, see the "FM3 32 bit Microcontroller MB9Axxx/MB9Bxxx Series Peripheral Manual". www.cypress.com Document. 002-04354 Rev. *B 11

I 2 S Driver API This section provides a brief description of the I 2 S driver's API. Function Overview Parameter Return value void I2S_Init (void) Initializes I 2 S driver. Set MFS initial settings (CSIO settings) and DMAC initial settings. ne ne Function STATUS I2S_Start (uint8_t audio_sample_rate) Overview Starts I 2 S operation. Set data for DMAC and activates CSIO. Be sure to initialize by I2S_Init function before function is invoked. Parameter audio sample_rate Sampling rate AUDIO_SAMPLE_44100 44.1kHz AUDIO_SAMPLE_48000 48kHz Return value I2S_RET_OK Successful I2S_RET_ILLEGAL_ERROR t yet initialized, operating or stopped Function STATUS I2S_Stop (void) Overview Parameter Completes I 2 S operation. Stop CSIO. ne Return value I2S_RET_OK Successful I2S_RET_ILLEGAL_ERROR t yet initialized or stopped Function Overview Parameter uint8_t I2S_Get_Status(void) Gets I 2 S operating status. ne Return value I2S_STATUS_INIT Initialization status (I 2 S can be started) I2S_STATUS_START Start (I 2 S operating) status I2S_STATUS_STOP Stop (I 2 S cannot be started) status www.cypress.com Document. 002-04354 Rev. *B 12

Usage Example I 2 S Driver API The source codes for places using the I 2 S driver API are shown in Figure 12, Figure 13 and Figure 14. The figure gives the AUDIO_PlayTask for audio.c, AUDIO_DecodeStop function used in the AUDIO_PlayTask function and AUDIO_Init function used in AUDIO_DecodeStop. See the sample program for audio.c. Figure 12. AUDIO_PlayTask Function Source Code (Excerpt) void AUDIO_PlayTask(void) { (An omission) i2s_status = I2S_Get_Status(); Gets I 2 S operating status /* check I2S status,if I2S stoped,change audio task to stop */ if (i2s_status == I2S_STATUS_STOP) { if (( s_audioplaystage!= AUDIO_STAGE_STOP) && (s_audioplaystage!= AUDIO_STAGE_INIT)) { AUDIO_SetAudioStage(AUDIO_STAGE_STOP); } } /* stop loop until decode one frame or stop(some error happened) */ while (decode_loop == TRUE) { switch (s_audioplaystage) { (An omission) case AUDIO_STAGE_UPSAMPLE: (An omission) /* the audio playing not been started */ if (s_audiostartflg == FALSE) { /* start I2S */ if ((s_audiosamplerate == SAMPLING_RATE_8000HZ) (s_audiosamplerate == SAMPLING_RATE_12000HZ) (s_audiosamplerate == SAMPLING_RATE_16000HZ) (s_audiosamplerate == SAMPLING_RATE_24000HZ) (s_audiosamplerate == SAMPLING_RATE_32000HZ) (s_audiosamplerate == SAMPLING_RATE_48000HZ)) { } (An omission) break; I2S_Start(AUDIO_SAMPLE_48000); } else { I2S_Start(AUDIO_SAMPLE_44100); } s_audiostartflg = TRUE; Starts I 2 S operation(48khz) Starts I 2 S operation(44.1khz) } } case AUDIO_STAGE_STOP: /* stop playing audio */ AUDIO_DecodeStop(); (An omission) Please refer to AUDIO_DecodeStop function } return; www.cypress.com Document. 002-04354 Rev. *B 13

Figure 13. AUDIO_DecodeStop Function Source Code void AUDIO_DecodeStop(void) { /* stop I2S operation */ (void)i2s_stop(); Stops I 2 S operation /* free the memory for library context */ if (s_libcontext!= NULL) { free(s_libcontext); s_libcontext = NULL; } /* close file */ FS_close(s_AudioPlayFile); } /* AUDIO module initialize */ AUDIO_Init(); Please refer to return; AUDIO_Init function Figure 14. AUDIO_Init Function Source Code (Excerpt) void AUDIO_Init(void) { (An omission) /* initialize I2S */ I2S_Init(); /* up-sampling initialize */ UPSAMPLE_Init(); Initializes I 2 S driver } return; www.cypress.com Document. 002-04354 Rev. *B 14

3 Performance 3.1 Performance Measurement Environment The performance measurement environment is given in Table 1. Table 1. Performance Measurement Environment. Part Number Description Manufacturer marks (Ver.., e 1 ICE ULINK2 KEIL 2 Integrated development environment μvision V4.20.03.0 KEIL 3 Microcontroller board MCB9B500 Vers.2 KEIL 4 LCD board Fujitsu Semiconductor 5 Middleware Multi Device File Access Library V03L01(object for small MCU) Fujitsu Semiconductor V03L01 (*1) 6 Middleware MP3 Decoder Library for FM3 V01 Evaluation Fujitsu Semiconductor V01L01 (*1) 7 Middleware MPEG-4/2 AAC LC Decoder Library (2ch) for FM3 V01 Evaluation Fujitsu Semiconductor V01L01 (*1) 8 Middleware JPEG Baseline Process Encoder/Decoder Library for FM3 V01 Evaluation Fujitsu Semiconductor V01L01 (*1) 9 Sample program Fujitsu Semiconductor 10 USB memory (equipment that supports USB Full Speed) 1. Middleware is for evaluation. A separate contract is required for usage. www.cypress.com Document. 002-04354 Rev. *B 15

3.2 Performance Measurement Items Performance measurement items are given in Table 2. Table 2.Performance Measurement Items. Performance Measurement Items Condition 1 Condition 2 Remarks 1 2 3 Amount of ROM/RAM used MP3 decoder assembly (*2) AAC decoder assembly (*2) JPEG decoder assembly, screen display assembly JPEG decoder assembly, no screen display assembly MP3 Decode Compile conditions: optimization Compile conditions: optimization 1 frame decode time Up-sampling 4 Set to 1 unit (*4) I 2 S output buffer (*3) MP3 decoder 5 assembly (*2) JPEG decode 1 scan decode time 6 LCD display 1 JPEG data display time 7 Processing time USB data read JPEG/MP3 file 8 (*1) AAC Decode 1ES (*5) decode time 9 AAC decoder assembly (*2) Up-sampling 10 USB data read AAC file 11 Common MSC (*6) connection detection 12 13 14 15 16 17 CPU occupancy MP3 play in progress AAC play in progress (*3) Sampling rate: 24kHz Bit rate: 64kbps Sampling rate: 32kHz Bit rate: 96kbps Sampling rate: 48kHz Bit rate: 128kbps Sampling rate: 24kHz Bit rate: 64kbps Sampling rate: 32kHz Bit rate: 96kbps Sampling rate: 48kHz Bit rate: 128kbps Set to 1 unit (*4) I 2 S output buffer Time from USB connection to MSC (*6) connection detection Channel mode: Joint Stereo Channel mode: Joint Stereo Channel mode: Joint Stereo Channel mode: Stereo Channel mode: Stereo Channel mode: Stereo www.cypress.com Document. 002-04354 Rev. *B 16

1. Main operating frequency conditions: 80MHz, APB1/APB2/APB3:40MHz 2. MP3 decoder and AAC decoder cannot be assembled simultaneously. 3. Because sampling frequency for audio data input to DAC is fixed at 44.1kHz or 48kHz, the following up-sampling processing is used. 8/12/16/24/32KHz => 48kHz 11.025/22.05kHz => 44.1kHz 4. 1 unit is as follows according to sampling rate. 8,16,32(kHz):3072byte 11.25,12,22.05,24,44.1,48(kHz):2048byte 5. ES: Elementary Stream 6. MSC: Mass Storage Class 3.3 Performance Measurement Results 3.3.1 Amount of ROM/RAM Used The amount of ROM and RAM used when the decoding file is MP3 and when it is AAC are given in Table 3 and Table 4 respectively. Table 3. Amount of ROM/RAM Used for MP3 Decoder Assembly Unit: Bytes ROM RAM Variable Stack Heap MP3 Decoder 34403 0 364 19148 JPEG Encoder/Decoder 7914 252 124 0 MDF (*1) 21362 6588 2344 204 USB host driver 11804 268 376 2048 USB host MSC driver 4070 92 920 0 Application 2191 29 6360 0 Audio playback 19660 16979 6360 0 Screen display 6904 8301 2368 2048 Others 7380 259 64 0 Total 115688 32768 (Secured area) 8192 (Secured area) 24576 65536 Amount of ROM used : 113.0 Kbytes (*2) Amount of RAM used : 64.0 Kbytes (*2) Stack : Area size secured on system given in total Max. usage size given for each item Heap : Area size secured on system given in total 1. Multi Device File Access Library 2. 1Kbyte = 1024byte www.cypress.com Document. 002-04354 Rev. *B 17

Table 4. Amount of ROM/RAM Used for AAC Decoder Assembly Unit: Bytes ROM RAM Variable Stack Heap AAC Decoder 90364 168 1104 29388 JPEG Encoder/Decoder (*1) - - - - MDF (*2) 21362 6588 1536 204 USB host driver 11804 268 376 2048 USB host MSC driver 4070 92 920 0 Application 1603 21 6360 0 Audio playback 19652 17511 6360 0 Screen display (*1) - - - - Others 7413 256 64 0 Total 156268 24904 (Secured area) 8192 (Secured area) 32256 65360 Amount of ROM used : 152.6 Kbytes (*3) Amount of RAM used : 63.8 Kbytes (*3) Stack Heap : Area size secured on system given in total Max. usage size given for each item : Area size secured on system given in total 1. Image display impossible because screen display requires 8K of RAM. 2. Multi Device File Access Library 3. 1Kbyte = 1024byte www.cypress.com Document. 002-04354 Rev. *B 18

3.3.2 Processing Time Processing time measurement results are given in Table 5 Table 5. Processing time. Condition 1 Condition 2 Condition 3 Processing time Sampling rate: 24kHz 1 Bit rate: 64kbps Channel mode: Joint Stereo 8.7ms Sampling rate: 32kHz 2 MP3 Decode Bit rate: 96kbps Channel mode: Joint Stereo 18.2ms Sampling rate: 48kHz 3 Bit rate: 128kbps Channel mode: Joint Stereo 16.5ms Sampling rate: 24kHz 4 5 MP3 decoder assembly Up-sampling Bit rate: 64kbps Channel mode: Joint Stereo Sampling rate: 32kHz Bit rate: 96kbps Channel mode: Joint Stereo 3.10ms 1.75ms Sampling rate: 48kHz 6 Bit rate: 128kbps Channel mode: Joint Stereo 1.90ms 7 Capacity 26813 bytes, YUV 4:2:0 348ms JPEG decode 8 Capacity 93265 bytes, YUV 4:4:4 860ms 9 Capacity 26813 bytes, YUV 4:2:0 396ms LCD display 10 Capacity 93265 bytes, YUV 4:4:4 920ms 11 JPEG file (*1) 4.04ms USB data read 12 MP3 file (*2) 2.02ms Sampling rate: 24kHz 13 Bit rate: 64kbps Channel mode: Stereo 17.2ms Sampling rate: 32kHz 14 AAC Decode Bit rate: 96kbps Channel mode: Stereo 16.4ms 15 AAC decoder assembly Sampling rate: 48kHz Bit rate: 128kbps Channel mode: Stereo 14.5ms Sampling rate: 24kHz 16 17 Up-sampling Bit rate: 64kbps Channel mode: Stereo Sampling rate: 32kHz Bit rate: 96kbps Channel mode: Stereo 1.35ms 2.3ms www.cypress.com Document. 002-04354 Rev. *B 19

. Condition 1 Condition 2 Condition 3 Processing time 18 Sampling rate: 48kHz Bit rate: 128kbps Channel mode: Stereo 1.72ms 19 USB data read AAC file (*2) 2.02ms 20 Common MSC connection detection - 526ms 1. 2048 bytes read 2. 1024 bytes read Measurement location for processing time are as follows. 1. MP3 decode, AAC decode From before to after place where audio_decode_decoding called 2. Up-sampling From before to after place where audio_decode_upsample called 3. JPEG decode From before to after place where JPEGDecodeScan function and JPEGGetScanHeader in image_scan_decode function called 4. LCD display From before to after place where IMAGE_Show function called 5. USB data read JPEG file: From before to after place where image_code_input function called MP3/AAC file: From before to after place where audio_decode_read function called 6. MSC connection detection From place immediately preceding USB connection detection status is set in av_demoapp_usb_event_callback function to place following completion of internal processing in av_demoapp_msc_connect_callback function. See sample program for location of audio_decode_decoding function, audio_decode_upsample function, JPEGGetScanHeader function, JPEGDecodeScan function, IMAGE_Show function, image_code_input function, audio_decode_read function invocation, av_demoapp_usb_event_callback function, and av_demoapp_msc_connect_callback function. www.cypress.com Document. 002-04354 Rev. *B 20

3.3.3 CPU Occupancy MP3 Play in Progress CPU processing status when MP3 is played is shown in Figure 15 (Vertical line is 10 ms unit.) Figure 15. Processing Status While MP3 Plays Sampling Rate:24kHz, Bit Rate:64kbps, Channel Mode:Joint Stereo USB data read 2.02ms 24ms MP3 decode Up-sampling Play processing operation status ( operating) 8.7ms 3.1ms Sampling Rate:32kHz, Bit Rate:96kbps, Channel Mode:Joint Stereo USB data read MP3 decode Up-sampling Play processing operation status ( operating) 2.02ms 18.2ms 36ms 1.75ms Sampling Rate:48kHz, Bit Rate:128kbps, Channel Mode:Joint Stereo USB data read MP3 decode Up-sampling Play processing operation status ( operating) 2.02ms 16.5ms 24ms 1.90ms CPU occupancy is as given in Table 6 while MP3 plays Table 6. CPU Occupancy While MP3 Plays. Conditions Sampling Rate Bit Rate Channel Mode CPU occupancy (%) 24kHz 64kbps Joint Stereo 57.6 32kHz 96kbps Joint Stereo 70.8 48kHz 128kbps Joint Stereo 93.0 www.cypress.com Document. 002-04354 Rev. *B 21

AAC Play in Progress CPU processing status when AAC is played is shown in Figure 16. (Vertical line is 10 ms unit.) Figure 16. Processing Status While AAC Plays Sampling Rate:24kHz, Bit Rate:64kbps, Channel Mode:Stereo USB data read AAC decode Up-sampling Play processing operation status ( operating) 2.02ms 17.2ms 1.35ms 42.7ms Sampling Rate:32kHz, Bit Rate:96kbps, Channel Mode:Stereo USB data read AAC decode Up-sampling Play processing operation status ( operating) 2.02ms 16.4ms 32ms 2.3ms Sampling Rate:48kHz, Bit Rate:128kbps, Channel Mode:Stereo USB data read AAC decode Up-sampling Play processing operation status ( operating) 2.02ms 14.5ms 21.3ms 1.72ms Table 7. CPU Occupancy While AAC Plays CPU occupancy is as given in Table 7 while AAC plays. Conditions Sampling Rate Bit Rate Channel Mode CPU Occupancy (%) 24kHz 64kbps Stereo 58.4 32kHz 96kbps Stereo 71.9 48kHz 128kbps Stereo 93.6 www.cypress.com Document. 002-04354 Rev. *B 22

Document History Document Title: AN204354 - FM3 Microcontroller Simple AV System Solution (JPEG, I2S, MP3, AAC, USB) Document Number: 002-04354 Revision ECN Orig. of Change Submission Date Description of Change ** - YUIS 08/23/3011 Rev01.Initial Release 02/06/2012 Rev02. Correction format Correction lineup of FM3 Correction by RoHS c compliant for board, parts change, and software change *A 5032777 YUIS 12/02/2015 Migrated Spansion Application te from AN706-00041-2v0-E to Cypress format *B 5872329 AESATP12 09/06/2017 Updated logo and copyright. www.cypress.com Document. 002-04354 Rev. *B 23

Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. Products PSoC Solutions ARM Cortex Microcontrollers Automotive Clocks & Buffers Interface Internet of Things Memory Microcontrollers PSoC Power Management ICs Touch Sensing USB Controllers Wireless Connectivity cypress.com/arm cypress.com/automotive cypress.com/clocks cypress.com/interface cypress.com/iot cypress.com/memory cypress.com/mcu cypress.com/psoc cypress.com/pmic cypress.com/touch cypress.com/usb cypress.com/wireless PSoC 1 PSoC 3 PSoC 4 PSoC 5LP PSoC 6 Cypress Developer Community Forums WICED IOT Forums Projects Videos Blogs Training Components Technical Support cypress.com/support All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Cypress Semiconductor Corporation, 2011-2017. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including Spansion LLC ( Cypress ). This document, including any software or firmware included or referenced in this document ( Software ), is owned by Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress s patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. Cypress products are not designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses where the failure of the device or system could cause personal injury, death, or property damage ( Unintended Uses ). A critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products. Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, WICED, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners. www.cypress.com Document. 002-04354 Rev. *B 24