Application Note AN_252. FT800 Audio Primer



Similar documents
Application Note AN_276. FT800 Audio File Conversion

Application Note AN_385. FTDI D3XX Driver Installation Guide

Application Note AN_299. FT800_FT801_Internal_Clock _Trimming

Application Note AN_209. AN_209 PDIUSBD12 to FT120 Migration Guide

Technical Note TN_152. USB 3.0 Compatibility Issues Explained

Technical Note TN_158. What is the Camera Parallel Interface?

Application Note AN_243. FT312D USB Host to UART Cable Application

Application Note AN_242

Future Technology Devices International Ltd. FTDI Drivers Installation guide for. Windows 7

Application Note AN_241. FTDI_AOA_HyperTerm_User_Manual

Technical Note TN_146. Creating Android Images for Application Development

Determining USB Peripheral Device Class

UMFT4222PROG FT4222 Programmer Module

Application Note AN_101. Submitting Modified FTDI Drivers for Windows Hardware Certification

Future Technology Devices International Ltd. Application Note AN_234. FTDI Drivers Installation guide for. Windows 8

Application Note. AN_136_Hi-Speed Mini Module EEPROM Disaster Recovery

White Paper WP_001. Connecting Peripherals to an Android Platform

FTDI Chip. VM800P Datasheet Embedded Video Engine Plus Module. VM800P Embedded Video Engine Plus Module Datasheet Version 1.0

Technical Note. TN_134 FTDI Android D2XX Driver

Application Note AN_149. Upgrading a passive DB9 RS232 Interface to an active USB Interface using an FTDI DB9-USB-RS232 Module

Future Technology Devices International Ltd

Application Note AN_254. FT800 Designs With Visual TFT

Command Processor for MPSSE and MCU Host Bus Emulation Modes

Application Note AN_185. Vinculum-II UART to USB HID Class Host Bridge

Future Technology Devices International Ltd

Future Technology Devices International Ltd. FTDI Drivers Installation guide for Windows XP

Application Note AN_240. FT800 From the Ground Up

White Paper WP_003. Android Peripheral Options

Future Technology Devices International Ltd. AN232R-02 FTDIChip-ID for the FT232R and FT245R

Simplified Description of USB Device Enumeration

Technical Note. TN_147 Java D2xx for Android

VF2F. USB Flash Disk File-to-file Transfer Vinculum Evaluation Kit. Future Technology Devices International Ltd. Preliminary - Subject to Change

Technical Note. TN_132 Adding FTDI Devices VCP Driver Support to Android

TTL-232R. TTL to USB Serial Converter Range of Cables. Datasheet

C232HM. USB 2.0 Hi-Speed to MPSSE Cable. Datasheet

C232HD. USB 2.0 Hi-Speed to UART Cable. Datasheet

VDIP1. Vinculum VNC1L Module. Datasheet

TTL-232R-PCB. TTL to USB Serial Converter PCB. Datasheet

Future Technology Devices International Ltd. USB NMC-2.5m. USB to USB Null Modem Cable. Datasheet

Future Technology Devices International Ltd. VF2F2. USB Flash Disk File-to-file Transfer Vinculum Evaluation Kit.

FT2232H Mini Module. USB Hi-Speed FT2232H Evaluation Module. Datasheet

Vinco Development Module. Datasheet

FT4232H Mini Module. USB Hi-Speed FT4232H Evaluation Module. Datasheet

Future Technology Devices International Ltd. USB-Key. Datasheet

Application Note AN_208. FT311D and FT312D Demo_APK_User_GuideFT311D and FT312D Demo_APK_User_Guide

Application Note AN_146. USB Hardware Design Guidelines for FTDI ICs

Application Note AN_250. Configuring FT313H Driver for Embedded Linux

USB Hi-Speed Serial/Hub Module. Datasheet

Future Technology Devices International Ltd. USB to RS232 UART Serial Converter PCB. Datasheet

Future Technology Devices International Ltd. FTDI Drivers Installation guide for. Windows VISTA

Future Technology Devices International Ltd USB TO RS422 UART SERIAL CONVERTER PCB. Datasheet. Document Reference No.: FT_000119

Future Technology Devices International Ltd. Technical Note TN_101

Voice Dialer Speech Recognition Dialing IC

Future Technology Devices International Ltd. Windows XP Installation Guide

Future Technology Devices International Ltd. FTDI Drivers Installation guide for Windows XP

Implementing a Digital Answering Machine with a High-Speed 8-Bit Microcontroller

Future Technology Devices International Ltd. FT800

DATASHEET. ADAM Arduino Display Adaptor Module. Arduino Compatible Shield P/N: 4Display-Shield-FT843 For the 4D Systems 4DLCD-FT843 Display

Future Technology Devices International Ltd

Voltage. Oscillator. Voltage. Oscillator

AN3998 Application note

Future Technology Devices International Ltd. Windows 2000 Installation Guide

The DB9-USB Family of. UART Converter Modules. Datasheet

TTL-232R-3V3 USB to TTL Serial Converter Cable

IEC Algorithmic Alert Tone Demo

What you will do. Build a 3-band equalizer. Connect to a music source (mp3 player) Low pass filter High pass filter Band pass filter

Welcome to the tutorial for the MPLAB Starter Kit for dspic DSCs

USB-COM422-PLUS1. Datasheet

Final Project Example

DB9-USB-RS232 Module. Male & Female. Datasheet

MAINTENANCE & ADJUSTMENT

Technical Note TN_105

Operating Instructions. Pioneer USB Audio Device Driver

Display Board Pulse Width Modulation (PWM) Power/Speed Controller Module

Operating Instructions. Network Audio Player N-70A/N-50A USB Audio Driver software (for Windows)

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT BIT DIFFERENTIAL ADC WITH I2C LTC2485 DESCRIPTION

Application Note AN_100. Using the FT232R/FT245R with an External Crystal or Oscillator

W a d i a D i g i t a l

USB-COM422-PLUS2. Datasheet

Microtronics technologies Mobile:

POCKET SCOPE 2. The idea 2. Design criteria 3

Future Technology Devices International Ltd. FT311D

HT1632C 32 8 &24 16 LED Driver

Future Technology Devices International Ltd. USB to RS232 Serial Converter Range of Cables. Datasheet

Programmable Single-/Dual-/Triple- Tone Gong SAE 800

TI 313 (1.0 EN) d&b Remote network - Integration

ontroller LSI with Built-in High- Performance Graphic Functions for Automotive Applications

Voice---is analog in character and moves in the form of waves. 3-important wave-characteristics:

USB-COM232-PLUS4. Datasheet

DAC Digital To Analog Converter

Voice Direct 364 Data Book

Data Transfer between Two USB Flash SCSI Disks using a Touch Screen

FREQUENCY RESPONSE ANALYZERS

Yamaha Power Amplifier. White Paper

Output Filter Design for EMI Rejection of the AAT5101 Class D Audio Amplifier

Type of Party on Hold. SIP Trunk, / ISDN CO/ ISDN Trunk via FXO gateway (Incoming) SIP Trunk, ISDN CO/ ISDN Trunk via FXO gateway (Outgoing)

For full instructions on how to install Simsound please see the Technical Guide at the end of this document.

ALON MP3 Dictaphone. User's manual. 1. Introduction 2. Audio Player 3. Voice Dictaphone 4. Phone calls recorder 5. Customer support.

Digital to Analog Converter. Raghu Tumati

Application Note AN_113. Interfacing FT2232H Hi-Speed Devices To I2C Bus

Transcription:

AN_252 FT800 Audio Primer Issue Date: 2013-08-06 The FT800 provides an inexpensive solution for adding rich graphics, touch and audio to an embedded system. This application note focuses on the FT800 audio controller, related circuitry and programming techniques. Use of FTDI devices in life support and/or safety applications is entirely at the user s risk, and the user agrees to defend, indemnify and hold FTDI harmless from any and all damages, claims, suits or expense resulting from such use. Future Technology Devices International Limited (FTDI) Unit 1, 2 Seaward Place, Glasgow G41 1HH, United Kingdom Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758 Web Site: http://ftdichip.com Copyright 2011 Future Technology Devices International Limited

Table of Contents 1 Introduction... 2 2 Audio Engine... 3 2.1 Sound Synthesizer... 3 2.2 Audio Files... 5 2.2.1 Conversion Utility... 6 3 Hardware... 7 3.1 Power Supply... 7 3.2 Buffer... 7 3.3 3-stage Low-Pass Filter... 8 3.4 Audio amplifier... 8 3.5 Complete Circuit... 9 3.6 Layout considerations... 9 4 Programming... 10 4.1 Initial Settings... 10 4.2 Play Synthesized Effects... 10 4.3 Load an Audio File into RAM_G... 10 4.4 Play an Audio File... 11 5 Conclusion... 12 6 Contact Information... 13 Appendix A References... 14 Document References... 14 External References... 14 Acronyms and Abbreviations... 14 Appendix B List of Tables & Figures... 15 List of Tables... 15 List of Figures... 15 Appendix C Revision History... 16 1

1 Introduction What is EVE? EVE, or the FTDI Embedded Video Engine, is a family of ICs designed to control TFT, resistive touch displays. The first device in this family is the FT800 which in addition to controlling the display also includes embedded support for touch control and audio output. This document focuses on the audio features available through the FT800, from the audio circuitry to convert the PWM output to the programming techniques for enabling and using the audio controller. 2

2 Audio Engine Various audio effects and files can be played by the FT800. The output is provided as a PWM signal on a single pin, AUDIO_L. There are two audio sources, the Sound Synthesizer and the Audio Playback. 2.1 Sound Synthesizer Sound effects are pre-loaded in a ROM wave library and do not require the use of any of the FT800 RAM space. Most audible user feedback can be provided through these effects, such as a click when an on-screen button is pressed, DTMF tones for telecom or an alarm panel warning. Most effects will play once and then stop. Others will play continuously. The full list of tones and features are shown below: Value Effect Continuous Pitch adjust Value Effect Continuous Pitch adjust 00h Silence Y N 32h DTMF 2 Y N 01h square wave Y Y 33h DTMF 3 Y N 02h sine wave Y Y 34h DTMF 4 Y N 03h sawtooth wave Y Y 35h DTMF 5 Y N 04h triangle wave Y Y 36h DTMF 6 Y N 05h Beeping Y Y 37h DTMF 7 Y N 06h Alarm Y Y 38h DTMF 8 Y N 07h Warble Y Y 39h DTMF 9 Y N 08h Carousel Y Y 40h harp N Y 10h 1 short pip N Y 41h xylophone N Y 11h 2 short pips N Y 42h tuba N Y 12h 3 short pips N Y 43h glockenspiel N Y 13h 4 short pips N Y 44h organ N Y 14h 5 short pips N Y 45h trumpet N Y 15h 6 short pips N Y 46h piano N Y 16h 7 short pips N Y 47h chimes N Y 17h 8 short pips N Y 48h music box N Y 18h 9 short pips N Y 49h bell N Y 19h 10 short pips N Y 50h click N N 1Ah 11 short pips N Y 51h switch N N 1Bh 12 short pips N Y 52h cowbell N N 1Ch 13 short pips N Y 53h notch N N 1Dh 14 short pips N Y 54h hihat N N 1Eh 15 short pips N Y 55h kickdrum N N 1Fh 16 short pips N Y 56h pop N N 23h DTMF # Y N 57h clack N N 2Ch DTMF * Y N 58h chack N N 30h DTMF 0 Y N 60h mute N N 31h DTMF 1 Y N 61h unmute N N Table 2.1 FT800 Synthesized Sound Effects 3

Many of the effects allow pitch control (MIDI note), so various tones can be generated. Standard MIDI note assignments are used: MIDI note ANSI note Freq (Hz) MIDI note ANSI note Freq (Hz) 21 A0 27.5 65 F4 349.2 22 A#0 29.1 66 F#4 370.0 23 B0 30.9 67 G4 392.0 24 C1 32.7 68 G#4 415.3 25 C#1 34.6 69 A4 440.0 26 D1 36.7 70 A#4 466.2 27 D#1 38.9 71 B4 493.9 28 E1 41.2 72 C5 523.3 29 F1 43.7 73 C#5 554.4 30 F#1 46.2 74 D5 587.3 31 G1 49.0 75 D#5 622.3 32 G#1 51.9 76 E5 659.3 33 A1 55.0 77 F5 698.5 34 A#1 58.3 78 F#5 740.0 35 B1 61.7 79 G5 784.0 36 C2 65.4 80 G#5 830.6 37 C#2 69.3 81 A5 880.0 38 D2 73.4 82 A#5 932.3 39 D#2 77.8 83 B5 987.8 40 E2 82.4 84 C6 1046.5 41 F2 87.3 85 C#6 1108.7 42 F#2 92.5 86 D6 1174.7 43 G2 98.0 87 D#6 1244.5 44 G#2 103.8 88 E6 1318.5 45 A2 110.0 89 F6 1396.9 46 A#2 116.5 90 F#6 1480.0 47 B2 123.5 91 G6 1568.0 48 C3 130.8 92 G#6 1661.2 49 C#3 138.6 93 A6 1760.0 50 D3 146.8 94 A#6 1864.7 51 D#3 155.6 95 B6 1975.5 52 E3 164.8 96 C7 2093.0 53 F3 174.6 97 C#7 2217.5 54 F#3 185.0 98 D7 2349.3 55 G3 196.0 99 D#7 2489.0 56 G#3 207.7 100 E7 2637.0 57 A3 220.0 101 F7 2793.8 58 A#3 233.1 102 F#7 2960.0 59 B3 246.9 103 G7 3136.0 60 C4 261.6 104 G#7 3322.4 61 C#4 277.2 105 A7 3520.0 62 D4 293.7 106 A#7 3729.3 63 D#4 311.1 107 B7 3951.1 64 E4 329.6 108 C8 4186.0 Table 2.2 MIDI Note/Pitch Values 4

Sound synthesis is controlled by the following registers: REG_SOUND o Bits 31-16 = Don t care o Bits 15-8 = MIDI note (pitch) o Bits 7-0 Effect REG_PLAY o Bits 31-1 = Don t care o Bit0 = Start Play / Play Status Write = 1 to start playing the selection in REG_SOUND Read = 1 indicates the effect is currently playing Read = 0 indicates the effect has completed REG_VOL_SOUND o Bits 31-8 = don t care o Bits 7-0 = output volume Reads and writes to FT800 memory space are handled through the little endian format, where the first byte will be the least significant. For example, consider a piano effect (0x46) playing A4 (0x45). The data on the SPI or I2C interface would consist of a Host Memory Write sequence with the following data, on order: 0x90 = Host Memory Write transfer (0x80) plus first byte of register address (0x10) 0x24 = second byte of register address 0x84 = third byte of register address 0x46 = piano effect 0x45 = note/pitch = A4 (440Hz) 0x00 = don t care, optional 0x00 = don t care, optional Note that the last two bytes do not have to be written, so a 16-bit Host Memory Write can actually satisfy the values needed in the register. Further explanation of the Host Memory Write, Host Memory Read and Host Memory Command data transfers are found in AN_240 FT800 From the Ground Up. 2.2 Audio Files There may be applications where something more than simple tone synthesis is necessary. For example a voice prompt or other announcement may be necessary to give the user specific instructions. The FT800 supports playback of files in the following single-channel (mono) formats: 8-bits signed PCM uncompressed raw audio 8-bits µlaw non-linear compressed audio 4-bits IMA-ADPCM further compressed µlaw where each byte contains two 4-bit samples The FT800 has 256Kbytes of object ram (RAM_G) to hold video objects (images and fonts) and audio objects (recorded sounds). The space must be managed by the host MCU so that information is not overwritten until after it is no longer required. Audio files are loaded through the Host Memory Write transaction to available space and are required to be 8-byte aligned (64-bit). Once an audio file is loaded into the RAM_G memory, playback is controlled by the following registers: REG_PLAYBACK_START o Bits 31-20 = don t care o Bits 19-0 = 20-bit starting address of the file within RAM_G REG_PLAYBACK_LENGTH o Bits 31-20 = don t care o Bits 19-0 = 20-bit length of the file within RAM_G REG_PLAYBACK_FREQ o Bits 31-16 = don t care o Bits 15-0 = 16-bit Playback sampling rate frequency, in Hz 5

REG_PLAYBACK_FORMAT o Bits 31-2 = don t care o Bits 1-0 = 2-bit Playback format 0 = Linear, or uncompressed PCM 1 = µlaw 2 = ADPCM 3 = undefined REG_PLAYBACK_LOOP o Bits 31-1 = don t care o Bit 0 = 1-bit Playback style 0 = play once 1 = play continuous REG_PLAYBACK_PLAY o Bits 31-1 = don t care o Bit 0 = Start Play / Play Status Write = 0 or 1 to start playing the selection in REG_SOUND Read = 1 indicates the file is currently playing Read = 0 indicates the file has completed REG_PLAYBACK_READPTR o Bits 31-20 = don t care o Bits 19-0 = 20-bit pointer of the current playback location REG_VOL_PB o Bits 31-8 = don t care o Bits 7-0 = output volume 2.2.1 Conversion Utility FTDI provide an audio file conversion utility called AUD_CVT to take a common file format and create the three types of files supported by the FT800. A link to this utility is provided in the Appendix A References section of this document. The source file is assumed to be a raw (uncompressed) 16bit PCM, mono WAV file. Such a file can be created through a commonly available audio editing program, such as Audacity. Once the source file is available, simply run the utility at a command prompt: aud_cvt -i inputfilename -f format where format = 0 for 8-bit signed PCM = 1 for 8-bit µlaw = 2 for 4-bit IMA ADPCM A folder with the resulting files will be created. These files can then be used to load into the RAM_G memory area of the FT800. The audio conversion utility will output a raw and a compressed file for each selected format. It may be helpful at the host MCU to store the compressed files, and then expand them into the RAM_G buffer when needed. See Section 4 for details. 6

3V3 G N D L_OIDUA rekaeps mho-8 rof Am04~ tneruc kaep xam 1BF A1/R06 2BF A1/R06 L_OIDUA 3V3_DUA 71C Fu1.0 12C 1 0 0 u F R 8 3 3 R 2C Fu1.0 RVBD521G1CVL47NS 1 U 5 3V3_DUA 3V3_DUA 32C 1 0 n F 2 4 O 5 3 E Application Note 3 Hardware The audio output provided by the FT800 consists of a single-channel PWM signal, AUDIO_L. This signal needs to be converted to analog so that it may be heard through a speaker. The conversion consists of several stages. In addition to AUDIO_L, the FT800 interrupt output can be utilized. An interrupt can be generated whenever an effect or file has completed playing. This is useful to queue the host MCU to perform another FT800 task. Interrupt circuitry is not shown here. 3.1 Power Supply In general, digital video signals tend to produce a bit of noise on the power and ground rails, especially when many signals are transitioning simultaneously. Setting the FT800 CSPREAD feature will offset some of the transitions on the video output, but noise will still be present. The first defense against high frequency noise on the audio signals is a clean power supply. Ferrites and capacitors between power and ground will help reduce the noise so that the output of any buffers or amplifiers using the power supply will not have the noise superimposed on the audio. The circuit below is one example of an audio power supply filter: Figure 3.1 Audio Power Supply Filter 3.2 Buffer With the power supply cleaned up, next in line is a logic-level buffer to provide enough drive current for the subsequent stage. Note that the buffer is powered by the audio power supply: Figure 3.2 Audio PWM Buffer 7

retlif morf #NDHS_OIDUA 61C Fu74.0 1R6 3 3 R R 9 71R 4 7 k 21R %1/k01 1 k 31C 01R Fn7.4 1 k 81C Fu74.0 41R %1/k01 4 3 1 2 91C Fu2.0 U 6 -NI +NI NDHS SAPYB 41C 1R Fn7.4 1 k 1R3 20k/1% 1A5026APT V D D V O + V O - G N D G N D 1R5 20k/1% 51C Fn7.4 6 5 8 7 9 3V3_DUA 02C S P + S P - 1 u F J 3 J 4 S P 1 mho8/w1 Application Note 3.3 3-stage Low-Pass Filter The output of the buffer is then fed into a 3-stage low-pass filter. This provides 60dB / octave attenuation of frequencies above the cut-off frequency. This steep filter further aids in digital noise suppression. In this example, the cut-off frequency is approximately 34kHz: Figure 3.3 Audio Low-Pass Filter (3rd Order) Since the AUDIO_L output is referenced to the 3.3V VCC power supply, the audio signal is centered on ~1.65V at the R11/C15 junction. 3.4 Audio amplifier The final stage in the audio circuit is an amplifier. C16 blocks any DC offset before the input. This amplifier will directly drive a speaker. Component values are derived from the amplifier datasheet. Figure 3.4 Audio Amplifier 8

3V3 G N D L_OIDUA rekaeps mho-8 rof Am04~ tneruc kaep xam 1BF A1/R06 2BF A1/R06 12C 1 0 0 u F L_OIDUA retlif morf 3V3_DUA #NDHS_OIDUA 2C Fu1.0 71C Fu1.0 3V3_DUA R 8 3 3 R 61C 32C 1R6 3 3 R 1 0 n F Fu74.0 RVBD521G1CVL47NS 1 U 5 71R 4 7 k 3V3_DUA 2 4 O 3 5 21R %1/k01 E 81C Fu74.0 41R %1/k01 R 9 1 k 4 3 1 2 91C Fu2.0 31C 01R Fn7.4 U 6 -NI +NI NDHS SAPYB 1 k 1R3 20k/1% 1A5026APT V D D V O + V O - G N D G N D 1R5 20k/1% 41C 1R Fn7.4 6 5 8 7 9 1 k 3V3_DUA 51C Fn7.4 02C S P + S P - 1 u F J 3 J 4 S P 1 mho8/w1 Application Note 3.5 Complete Circuit The complete audio circuit shows all of the components together: Figure 3.5 FT800 Audio Circuit 3.6 Layout considerations Careful layout techniques are required: The audio circuit should be physically separated as far from the LCD signals as possible. Separate audio power and ground planes from the system power and ground. Use a single connection point between audio power and system power; likewise, use a single connection point between audio ground and system ground. In this example, the connection points are ferrite beads. 9

4 Programming The audio features of the FT800 are accessed through the same Display List, along with the video and touch panel features. For example, every second a clock widget with a second hand could be drawn followed by a tick sound. Both the widget and sound reside in the same Display List. New Display Lists would then be sent to the FT800 every second, each containing both the widget with the new second hand position and another audio tick. For the examples below, wr32(address, value) indicates the MCU would write the value (VOLUME, frequency, etc.) to the address within the display list (RAM_DL + n) or register (e.g. REG_VOL_SOUND). This notation is used throughout other FT800 documents. 4.1 Initial Settings As part of the FT800 initialization, set the volume to zero to eliminate any pops or clicks while all the initial settings are being sent: wr8(reg_vol_sound, 0); // Set Synthesizer volume to zero wr8(reg_vol_pb, 0); // Set Audio File Playback volume to zero wr16(reg_sound, 0x0062); // Play mute sound (optional) 4.2 Play Synthesized Effects Only a few Display List elements are required in order to play a synthesized effect. To play an effect: 1. wr8(reg_vol_sound, VOLUME); // set the volume 2. wr16(reg_sound, (MIDI_NOTE << 8 + EFFECT)); // set the effect and pitch 3. wr8(reg_play, 1); // start playing 4. rd8(reg_play); // check whether done An interrupt can also be generated for the host MCU when play has completed. To stop playing a continuous effect: 1. wr16(reg_sound, 0); // set effect to silence 2. wr8(reg_play, 1); // start playing silence 3. rd8(reg_play); // check whether done 4.3 Load an Audio File into RAM_G Audio and video data are treated equally in the RAM_G element memory. The command processor is sent the starting address and data to store, and then the MCU obtains the last used end pointer so another element may be copied in. There are two methods of loading an audio file into the RAM_G element memory: Uncompressed Data Data from the raw audio file is written directly to RAM_G. The MCU, knowing the data_length, knows where to put the next element. 1. wr32(cmdbufferwr + n, 0xffffff1a); // CMD_MEMWRITE 2. wr32(cmdbufferwr + n + 4, RAM_G + offset); // An 8-byte aligned location in // RAM_G. If this is the first // element, then offset = 0 3. wr32(cmdbufferwr + n + 8, data_length); // length of audio data // (8-byte aligned / zero-pad) 4. wr8(cmdbufferwr + n + 12, Byte 0); // First byte of audio data 5. wr8(cmdbufferwr + n + 13, Byte 1); // Second byte of audio data 6. wr8(cmdbufferwr + n +, <Bytes 2 through data_length> // the rest of the data 10

7. MCU sets new RAM_G starting offset = offset + data_length for memory management Compressed Data Data from the compressed audio file is written to RAM_G through the INFLATE command. This decompresses ZLIB compressed data into RAM_G. Once the uncompressed data is written, the new end-pointer is obtained for the MCU to keep track of the RAM_G elements. 1. wr32(cmdbufferwr + n, 0xffffff22); // CMD_INFLATE 2. wr32(cmdbufferwr + n + 4, RAM_G + offset); // An 8-byte aligned location in // RAM_G. If this is the first // element, then offset = 0 3. wr8(cmdbufferwr + n + 12, Byte 0); // First byte of compressed // audio data 4. wr8(cmdbufferwr + n + 13, Byte 1); // Second byte of compressed // audio data 5. wr8(cmdbufferwr + n +, <remainder of data> // the rest of the compressed // audio data 6. wr32(cmdbufferwr + n + <zlib_size>, 0xffffff22 // CMD_GETPTR 7. rd32(new RAM_G offset) // Assume utility already // padded data 8. MCU stores the new offset for RAM_G memory management Note that if the audio conversion utility is used, both RAW and ZLIB files are created. When writing MCU firmware, the RAW file size can also be used as the end point of the uncompressed data. 4.4 Play an Audio File Now that audio data is stored in RAM_G, it can be played through the FT800: 1. wr32(reg_playback_start, RAM_G + offset); // RAM_G element memory // offset is managed by host MCU 2. wr32(reg_playback_length, length); // file length, in bytes 3. wr16(reg_playback_freq, frequency); // playback sampling frequency 4. wr8(reg_playback_format, format); // file format 5. wr8(reg_vol_pb, volume); // playback volume 6. wr8(reg_playback_loop, play_once); // play once or forever? 7. wr8(reg_playback_play, 1); // write a 1 to start playback 8. rd8(reg_playback_play) // playback complete (optional) 9. rd32(reg_playback_readptr) // how far along and how loud? // (optional) 11

5 Conclusion The FT800 provides an easy way to incorporate audio along with graphics displays and touch feedback into products that could not otherwise afford this capability. A common programming interface provides developers with a single method to manipulate the FT800 regardless of the data types. With only the FT800 between the MCU and the LCD display, a vivid graphics experience with touch and audio is now possible. 12

6 Contact Information Head Office Glasgow, UK Future Technology Devices International Limited Unit 1, 2 Seaward Place, Centurion Business Park Glasgow G41 1HH United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) sales1@ftdichip.com support1@ftdichip.com admin1@ftdichip.com Branch Office Tigard, Oregon, USA Future Technology Devices International Limited (USA) 7130 SW Fir Loop Tigard, OR 97223-8160 USA Tel: +1 (503) 547 0988 Fax: +1 (503) 547 0987 E-Mail (Sales) E-Mail (Support) E-Mail (General Enquiries) us.sales@ftdichip.com us.support@ftdichip.com us.admin@ftdichip.com Branch Office Taipei, Taiwan Future Technology Devices International Limited (Taiwan) 2F, No. 516, Sec. 1, NeiHu Road Taipei 114 Taiwan, R.O.C. Tel: +886 (0) 2 8791 3570 Fax: +886 (0) 2 8791 3576 Branch Office Shanghai, China Future Technology Devices International Limited (China) Room 1103, No. 666 West Huaihai Road, Shanghai, 200052 China Tel: +86 21 62351596 Fax: +86 21 62351595 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) tw.sales1@ftdichip.com tw.support1@ftdichip.com tw.admin1@ftdichip.com E-mail (Sales) E-mail (Support) E-mail (General Enquiries) cn.sales@ftdichip.com cn.support@ftdichip.com cn.admin@ftdichip.com Web Site http://ftdichip.com System and equipment manufacturers and designers are responsible to ensure that their systems, and any Future Technology Devices International Ltd (FTDI) devices incorporated in their systems, meet all applicable safety, regulatory and system-level performance requirements. All application-related information in this document (including application descriptions, suggested FTDI devices and other materials) is provided for reference only. While FTDI has taken care to assure it is accurate, this information is subject to customer confirmation, and FTDI disclaims all liability for system designs and for any applications assistance provided by FTDI. Use of FTDI devices in life support and/or safety applications is entirely at the user s risk, and the user agrees to defend, indemnify and hold harmless FTDI from any and all damages, claims, suits or expense resulting from such use. This document is subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Neither the whole nor any part of the information contained in, or the product described in this document, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. Future Technology Devices International Ltd, Unit 1, 2 Seaward Place, Centurion Business Park, Glasgow G41 1HH, United Kingdom. Scotland Registered Company Number: SC136640 13

Appendix A References Document References DS_FT800 FT800 Datasheet PG_FT800 FT800 Programmer Guide AN_240 FT800 From the Ground Up External References Audacity Open Source audio recording and editing software Acronyms and Abbreviations Terms IMA-ADPCM MCU PCM PWM RAW µlaw ZLIB Description Further compressed µlaw data containing two 4-bit samples per byte Microcontroller (unit) Pulse Coded Modulation Pulse Width Modulation Uncompressed data mu-law Companding Algorithm Lossless compressed data algorithm 14

Appendix B List of Tables & Figures List of Tables Table 2.1 FT800 Synthesized Sound Effects... 3 List of Figures Figure 3.1 Audio Power Supply Filter... 7 Figure 3.2 Audio PWM Buffer... 7 Figure 3.3 Audio Low-Pass Filter (3rd Order)... 8 Figure 3.4 Audio Amplifier... 8 Figure 3.5 FT800 Audio Circuit... 9 15

Appendix C Revision History Document Title: Document Reference No.: FT_000875 Clearance No.: FTDI# 344 Product Page: http://www.ftdichip.com/ftproducts.htm Document Feedback: Send Feedback Revision Changes Date 1.0 Initial Release 2013-08-06 16