Programming Audio Applications in the i.mx21 MC9328MX21



Similar documents
Local Interconnect Network (LIN) Physical Interface

Understanding LCD Memory and Bus Bandwidth Requirements ColdFire, LCD, and Crossbar Switch

etpu Host Interface by:

Initializing the TSEC Controller

Improving Embedded Software Test Effectiveness in Automotive Applications

Handling Freescale Pressure Sensors

Connecting Low-Cost External Electrodes to MED-EKG

Flexible Active Shutter Control Interface using the MC1323x

Windows 7: Using USB TAP on a Classic CodeWarrior Installation (MGT V9.2 DSC V8.3)

Hardware Configurations for the i.mx Family USB Modules

Blood Pressure Monitor Using Flexis QE128 Gabriel Sanchez RTAC Americas

IRTC Compensation and 1 Hz Clock Generation

Data Movement Between Big-Endian and Little-Endian Devices

PowerQUICC II Pro (MPC83xx) PCI Agent Initialization

How To Build A Project On An Eclipse Powerbook For Anarc (Powerbook) On An Ipa (Powerpoint) On A Microcontroller (Powerboard) On Microcontrollers (Powerstation) On Your Microcontroller 2 (Powerclock

User Interface Design using CGI Programming and Boa Web Server on M5249C3 Board

How To Control A Motor Control On An Hvac Platform

Performance Monitor on PowerQUICC II Pro Processors

Software Real Time Clock Implementation on MC9S08LG32

Enhanced Serial Interface Mapping

MPC8245/MPC8241 Memory Clock Design Guidelines: Part 1

Connecting to an SMTP Server Using the Freescale NanoSSL Client

3-Phase BLDC Motor Control with Hall Sensors Using 56800/E Digital Signal Controllers

PQ-MDS-T1 Module. HW Getting Started Guide. Contents. About This Document. Required Reading. Definitions, Acronyms, and Abbreviations

Detecting a CPM Overload on the PowerQUICC II

Point-of-Sale (POS) Users Guide Lech José Olmedo Guerrero Jaime Herrerro Gallardo RTAC Americas

VGA Output using TV-Out Extension Solution i.mx21

Cyclic Redundant Checker Calculation on Power Architecture Technology and Comparison of Big-Endian Versus Little-Endian

Using WinUSB in a Visual Studio Project with Freescale USB device controller

MC13783 Buck and Boost Inductor Sizing

Freescale Semiconductor. Integrated Silicon Pressure Sensor. On-Chip Signal Conditioned, Temperature Compensated and Calibrated MPX4080D.

Installation of the MMA955xL CodeWarrior Service Pack Author: Fengyi Li Application Engineer

Freescale Embedded GUI Converter Utility 2.0 Quick User Guide

MCF54418 NAND Flash Controller

Software Marketing, Embedded Real-Time Solutions

Techniques and Tools for Software Analysis

Using XGATE to Implement LIN Communication on HCS12X Daniel Malik 8/16-Bit Products Division East Kilbride, Scotland

Using the Performance Monitor Unit on the e200z760n3 Power Architecture Core

Genesi Pegasos II Setup

Generate Makefiles from Command Line Support in Eclipse-Based CodeWarrior Software

How to Convert 3-Axis Directions and Swap X-Y Axis of Accelerometer Data within Android Driver by: Gang Chen Field Applications Engineer

Freescale Semiconductor. Integrated Silicon Pressure Sensor. On-Chip Signal Conditioned, Temperature Compensated and Calibrated MPX5500.

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

Real Time Development of MC Applications using the PC Master Software Visualization Tool. 1. Introduction. 2. Development of Motor Control.

White Paper. Freescale s Embedded Hypervisor for QorIQ P4 Series Communications Platform

Using eflexpwm Module for ADC Synchronization in MC56F82xx and MC56F84xx Family of Digital Signal Controllers

Understanding Pressure and Pressure Measurement

Using the HC08 SCI Module

3-Phase BLDC Motor Control with Hall Sensors Using the MC56F8013

How To Fit A 2Mm Exposed Pad To A Dfn Package

How To Improve Performance On A P4080 Processor

i.mx Applications Processors with Hantro's Multimedia Framework

Using Program Memory As Data Memory. 1. Introduction Program Memory and Data. Contents. Memory. Freescale Semiconductor Application Note

Using the High Input Voltage Charger for Single Cell Li-Ion Batteries (KIT34671EPEVBE)

AND8365/D. 125 kbps with AMIS-4168x APPLICATION NOTE

USB HID bootloader for the MC9S08JM60

User Guide. Introduction. HCS12PLLCALUG/D Rev. 0, 12/2002. HCS12 PLL Component Calculator

Using the Kinetis Security and Flash Protection Features

How To Measure Power Of A Permanent Magnet Synchronous Motor

MLPPP in the Evolving Radio Access Network

Configuring the FlexTimer for Position and Speed Measurement with an Encoder

ColdFire Security SEC and Hardware Encryption Acceleration Overview

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Processor Expert Software Microcontrollers Driver Suite Getting Started Guide

Comparison of MC9S08QE128 and MCF51QE128 Microcontrollers Scott Pape and Eduardo Montanez Systems Engineering, Freescale Microcontroller Division

NOT RECOMMENDED FOR NEW DESIGN

Green Embedded Computing and the MPC8536E PowerQUICC III Processor

ITU-T V.42bis Data Dictionary Search on the StarCore SC140/SC1400 Cores

Implementing Positioning Algorithms Using Accelerometers

MPXAZ6115A MPXHZ6115A SERIES. Freescale Semiconductor Technical Data. MPXAZ6115A Rev 4, 01/2007

Ref Parameters Symbol Conditions Min Typ Max Units. Standby μa. 3 Range kpa. 4 Resolution 0.15 kpa. 5 Accuracy -20ºC to 85ºC ±1 kpa

AND9015. A Solution for Peak EMI Reduction with Spread Spectrum Clock Generators APPLICATION NOTE. Prepared by: Apps Team, BIDC ON Semiconductor

SEMICONDUCTOR TECHNICAL DATA

MSC8156 and MSC8157 PCI Express Performance

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

Emulated EEPROM Implementation in Dual Flash Architecture on MC9S08LG32 With Demo Description

NOT RECOMMENDED FOR NEW DESIGN

AND9190/D. Vertical Timing Optimization for Interline CCD Image Sensors APPLICATION NOTE

Freescale Variable Key Security Protocol Transmitter User s Guide by: Ioseph Martínez and Christian Michel Applications Engineering - RTAC Americas

P D Operating Junction Temperature T J 200 C Storage Temperature Range T stg 65 to +150 C

LOW POWER NARROWBAND FM IF

Developing an Application for the i.mx Devices on the Linux Platform

LOW POWER SCHOTTKY. GUARANTEED OPERATING RANGES ORDERING INFORMATION

Efficient Low-Level Software Development for the i.mx Platform

Tire Pressure Monitoring Sensor Temperature Compensated and Calibrated, Fully Integrated, Digital Output

i.mx28 Ethernet Performance on Linux

Adding SDIO Wi-Fi Solution to i.mx Windows CE 5.0/Windows CE 6.0

RF Power Field Effect Transistors N- Channel Enhancement- Mode Lateral MOSFETs

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

VLE 16-bit and 32-bit Instruction Length Decode Algorithm

CodeWarrior Development Studio Floating Licensing Quick Start

LC898300XA. Functions Automatic adjustment to the individual resonance frequency Automatic brake function Initial drive frequency adjustment function

ULN2803A ULN2804A OCTAL PERIPHERAL DRIVER ARRAYS

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

Using the High-Input-Voltage Travel Charger for Single Cell Li-Ion Batteries (KIT34674EPEVBE)

1 Introduction. Freescale Semiconductor Application Note. Document Number: AN3031 Rev. 1, 04/2010

Getting Started with the Student Learning Kit Featuring the Freescale HCS12 Microcontroller Application Module

SN54/74LS682 SN54/74LS684 8-BIT MAGNITUDE COMPARATORS SN54/74LS688 8-BIT MAGNITUDE COMPARATORS FAST AND LS TTL DATA 5-603

Pressure Freescale Semiconductor

A Utility for Programming Single FLASH Array HCS12 MCUs, with Minimum RAM Overhead

Transcription:

Freescale Semiconductor Application Note Document Number: AN2628 Rev. 1, 10/2005 Programming Audio Applications in the MC9328MX21 by: Alfred Sin 1 Abstract The MC9328MX21 () processor has two dedicated peripherals for audio applications: Serial Synchronous Interface (SSI) and Digital Audio MUX (). A brief description of these two peripherals follows: Synchronous Serial Interfaces (SSI): Supports generic SSI interfaces for time-slot based communication with synchronous voice codecs Time-slot mode supports up to 4 channels for communication among devices Bluetooth voice port, voice codecs, and baseband audio ports Supports Philips standard Inter-IC Sound (I 2 S) bus for external digital audio chip interface at 44.1 khz and 48 khz AC 97 Host Controller mode with support for 2 audio channels supporting fixed and variable rate transfers Used in conjunction with the Digital Audio Mux () module to provide flexible audio and voice routing options Contents 1 Abstract.................................1 2 SSI and Port Arrangement.........2 3 Audio Application Scenarios...............3 4 Conclusion.............................11 5 References.............................11 6 Revision History.........................12 Freescale Semiconductor, Inc., 2005. All rights reserved.

SSI and Port Arrangement Digital Audio Mux (): Supports 2 internal hosts, 1 external host, and 3 external peripheral interfaces Flexible audio, voice, and data routing without host processor intervention Built-in support for network mode connection of host and peripheral interfaces Separate and simultaneous audio paths from hosts to peripherals External 4-wire connection to synchronous devices, audio, and voice codecs In this application note, typical scenarios of audio applications will be discussed. The use of SSI and AUDUMX in these audio applications will also be examined. 2 SSI and Port Arrangement The processor has two SSI modules. Each SSI module is capable of supporting synchronous (4-wire) or asynchronous (6-wire) serial communication. The, has two internal host ports, one external host port, and three external peripheral ports. The Host Port 1 () and Host Port 2 () are connected to the internal SSI1 and SSI2 respectively. The Host Port 3 () is mapped to the external SAP I/O port. The Peripheral Port 1 (), Peripheral Port 2 (), and Peripheral Port 3 () are mapped to the processor s external SSI1 I/O port, external SSI2 I/O port, and external SSI3 I/O port respectively. Figure 1 illustrates this arrangement. SSI3_ SS3_ SSI3_ SSI3_ SSI2_ SSI2_ SSI2_ SSI1_ SSI1_ SSI1_ SAP_ SAP_ SAP_ Figure 1. SSI and Port Arrangements Programming Audio Applications in the Application Note, Rev. 1 2 Freescale Semiconductor

3 Audio Application Scenarios 3.1 Interfacing with an Audio Codec A typical audio application scenario is to playback and record audio via an external codec. The codec can be configured as the SSI master which provides the bit clock and frame sync to the processor s SSI. Since is capable of performing full-duplex operation (record and playback) at different sampling rates, the SSI needs to be programmed as an asynchronous SSI slave mode. Figure 2 shows the connection between and an external codec. Note that two I/O ports (SSI2 and SSI3 in this example) are required to perform the asynchronous operation. SSI3_ SS3_ SSI3_ SSI3_ SSI2_ SSI2_ SSI2_ CODEC SSI1_ SSI1_ SSI1_ SAP_ SAP_ SAP_ port in use Figure 2. and Audio Codec Connection Example Given the configuration shown in Figure 2, set the corresponding ports as indicated in Table 1 through Table 3. Table 1. Host Port Configuration Register 1 (HPCR1 - $10016000) DIR 1 is output TDIR 1 Tx is output TFCSEL 4 and Tx from Peripheral Port 2 DIR 1 is output RDIR 1 Rx is output RFCSEL 5 and Rx from Peripheral Port 3 SEL 4 Receive data from Peripheral Port 2 Programming Audio Applications in the Application Note, Rev. 1 Freescale Semiconductor 3

Table 1. Host Port Configuration Register 1 (HPCR1 - $10016000) (continued) SYN 0 Asyn Mode TXRXEN 0 No switch INMEN 0 Disable INMASK 0 Ignore when INMEN = 0 Table 2. Peripheral Port Configuration Register 2 (PPCR2 - $10016014) DIR 0 is input TDIR 0 Tx is input TFCSEL 0 Ignore when /Tx are input DIR 0 Ignore RDIR 0 Ignore RFCSEL 0 Ignore SEL 0 Ignore SYN 1 Syn mode TXRXEN 0 No switch Table 3. Peripheral Port Configuration Register 3 (PPCR3 - $10016018) DIR 0 is input TDIR 0 Tx is input TFCSEL 0 Ignore when /Tx are input DIR 0 Ignore RDIR 0 Ignore RFCSEL 0 Ignore SEL 0 Receive from Host Port 1 SYN 1 Syn mode TXRXEN 0 No switch 3.2 Interfacing with an AC 97 Codec When connecting with an AC 97 codec, the external AC 97 typically will provide the serial bit clock (12.288 MHz) to the SSI. Based on this serial bit clock, will generate the appropriate frame sync to the AC 97 codec and the SSI will be configured as an SSI synchronous slave operation. Figure 3 shows the connection between and an AC 97 codec. Programming Audio Applications in the Application Note, Rev. 1 4 Freescale Semiconductor

SSI3_ SS3_ SSI3_ SSI3_ SSI2_ SSI2_ SSI2_ AC 97 CODEC SYNC BIT_ SDATA_OUT SDATA_IN SSI1_ SSI1_ SSI1_ SAP_ SAP_ SAP_ port in use Figure 3. and AC 97 Codec Connection Example Given the configuration shown in Figure 3, set the set the corresponding ports as indicated in Table 4 and Table 5. Table 4. Host Port Configuration Register 1 (HPCR1 - $10016000) DIR 0 is input TDIR 1 Tx is output TFCSEL 4 and Tx from Peripheral Port 2 DIR 0 Ignore RDIR 0 Ignore RFCSEL 0 Ignore SEL 4 Receive data from Peripheral Port 2 SYN 1 Syn Mode TXRXEN 0 No switch INMEN 0 Disable INMASK 0 Ignore when INMEN = 0 Programming Audio Applications in the Application Note, Rev. 1 Freescale Semiconductor 5

Table 5. Peripheral Port Configuration Register 2 (PPCR2 - $10016014) DIR 1 is output TDIR 0 Tx is input TFCSEL 0 Tx/ from Host Port 1 DIR 0 Ignore RDIR 0 Ignore RFCSEL 0 Ignore SEL 0 Receive from Host Port 1 SYN 1 Syn mode TXRXEN 0 No switch 3.3 Interfacing to a Baseband Processor, Codec, and Bluetooth In Bluetooth smartphone applications, the need to connect with an audio codec, a modem Baseband Serial Audio Port (SAP) and the Bluetooth chipset SSI port. To enable the seamless interface for various audio connections, The port plays a very important role. With the audio codec connection described in Section 3.1, a Bluetooth smartphone configuration is illustrated in Figure 4. Different voice paths in this Bluetooth smartphone system will be discussed individually. SSI3_ SS3_ SSI3_ SSI3_ SSI2_ SSI2_ SSI2_ CODEC SSI1_ SSI1_ SSI1_ SAP_ SAP_ Bluetooth Baseband SAP SAP_ Figure 4. Bluetooth Smartphone Connection Example Programming Audio Applications in the Application Note, Rev. 1 6 Freescale Semiconductor

3.3.1 Voice Path Between Modem SAP and Bluetooth In the scenario of the smartphone being a Bluetooth audio gateway connecting with a remote Bluetooth headset, the voice path must be established directly between the Baseband SAP and the Bluetooth SSI. In this case, the Baseband SAP will be the SSI master that provides the SSI frame sync and clock to the Bluetooth SSI. SSI3_ SS3_ SSI3_ SSI3_ SSI2_ SSI2_ SSI2_ CODEC SSI1_ SSI1_ SSI1_ SAP_ SAP_ SAP_ Bluetooth Baseband SAP port in use Figure 5. Voice Path Between Baseband SAP and Bluetooth 3.3.2 Voice Path Between and Bluetooth When the is setup as an SCO voice link with the remote Bluetooth device, the will be the SSI master while the Bluetooth will be the SSI slave. This is illustrated in Figure 6. Programming Audio Applications in the Application Note, Rev. 1 Freescale Semiconductor 7

SSI3_ SS3_ SSI3_ SSI3_ SSI2_ SSI2_ SSI2_ CODEC SSI1_ SSI1_ SSI1_ SAP_ SAP_ SAP_ Bluetooth Baseband SAP port in use Figure 6. Voice Path Between and Bluetooth 3.3.3 Voice Path Between and Baseband There will be scenarios (such as voice memo recording and voice recognition) involving the voice path between the and the Baseband. In this case, the Baseband will be the SSI master while the will be the SSI slave. This scenario is illustrated in Figure 8. SSI3_ SS3_ SSI3_ SSI3_ SSI2_ SSI2_ SSI2_ CODEC SSI1_ SSI1_ SSI1_ SAP_ SAP_ SAP_ Bluetooth Baseband SAP port in use Figure 7. Voice Path Between and Baseband Programming Audio Applications in the Application Note, Rev. 1 8 Freescale Semiconductor

3.4 Tx/Rx Switching Audio Application Scenarios In a typical SSI network mode configuration, only one of the devices will be the master which provides frame sync and clocks. Other devices will act as the SSI slaves. Since the hardware connections are being fixed, it is not possible to perform an on-the-fly master/slave role change. However, the provides a Tx/Rx switching mechanism to support this. Figure 8 shows a SSI network connection of 3 devices. Device 1 acts as the SSI master while Device 2 and the act as SSI slaves. The SAP_ pin is an output pin from to Device 1. During the allocated time slot, will provide data to Device 1. In other time slots, SAP_ will be tri-stated. Similarly, the SAP_ pin is an input pin such that time slot data from Device 1 can be sent to. (Slave) SAP_ SAP_ SAP_ Device 2 (SSI Slave) CK TX RX Device 1 (SSI Master) port in use Figure 8. SSI Network Mode with 3 Devices When the is set to become the SSI master and Device 1 is no longer active, needs to provide the frame sync and clocks to Device 2. Additionally, since the hardware connection is being fixed, needs to send data from the SAP_ pin to the RX pin of Device 2 and receive data from TX pin of Device 2 to SAP_. With the help of the Tx/Rx switching feature, the role switching can be performed easily. As indicated in Figure 9, the Tx/Rx switching is enabled at Host Port 3 (HPCR3:TXRXEN = 1). The SAP_ pin now becomes an input pin (previously it is an output pin) which can receive data from Device 2 TX pin. Similarly, the SAP_ pin now becomes an output pin (previously it is an input pin) which can send data out to Device 2 RX pin. Programming Audio Applications in the Application Note, Rev. 1 Freescale Semiconductor 9

TX/RX Switch (Master) SAP_ Device 2 (SSI Slave) CK TX RX SAP_ => SAP_ SAP_ => SAP_ Device 1 port in use Figure 9. Tx/Rx Switching a Host Port 3 3.5 Internal Network Mode Network mode is where a master SSI is connected to more than one slave SSI device. The communication occurs in a time-slotted frame. In the internal network mode, the host port can receive the signals from internal SSI ports or external ports. These received signals are ANDed together to form the output. SSI2_ SSI2_ SSI2_ Device 2 (SSI Slave) (Master) SSI1_ SSI1_ SSI1_ Device 1 (SSI Slave) port in use Figure 10. Connecting to Two External Devices in SSI Network Mode Programming Audio Applications in the Application Note, Rev. 1 10 Freescale Semiconductor

Conclusion Figure 10 shows the SSI2 as the SSI master driving two external devices connected at two external ports. Suppose the system is configured as an SSI network with 4 time-slots. Device 1 and will communicate in the first time slot while Device 2 and will communicate in the second time slot. The remaining two time slots are idle. Figure 11 illustrates the timing of this sequence. External SSI1_, External SSI2_ Time slot 1 Time slot 2 Time slot 3 Time slot 4 External SSI1_ Data from Device 1 to External SSI2_ Data from Device 2 to Signal received at Host Port 2 under Internal Network Mode Figure 11. Internal Network Mode Timing Diagram Example For the internal SSI2 to receive data from external Device 1 and Device 2, the Host Port 2 must be configured to the internal network mode bit and mask correctly. Table 6 provides the settings for this example. Table 6. Host Port Configuration Register 2 (HPCR2 - $10016004) INMEN 1 Enable Internal Network Mode INMASK 0xE7 Bit 3 and Bit 4 are set to 0, Bit 1 set to 1 (self port), others set to 1 4 Conclusion The provides a very flexible connection for audio applications. The enables a programmable interconnection for voice, audio, and synchronous data routing among the internal SSI modules and external SSI devices. Hard-wired re-configuration are not required and resources can be effectively shared in different configurations. 5 References The following documents can be used for additional information: 1. MC9328MX21 Applications Processor Reference Manual (order number: MC9328MX21RM) For this and other technical documents about the products, go to www.freescale.com/imx. Programming Audio Applications in the Application Note, Rev. 1 Freescale Semiconductor 11

6 Revision History This revision is for the purpose of applying the Freescale template and does not include technical content changes. How to Reach Us: Home Page: www.freescale.com E-mail: support@freescale.com USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 +1-800-521-6274 or +1-480-768-2130 support@freescale.com Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) support@freescale.com Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064, Japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com Asia/Pacific: Freescale Semiconductor Hong Kong Ltd. Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po, N.T., Hong Kong +800 2666 8080 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center P.O. Box 5405 Denver, Colorado 80217 1-800-521-6274 or 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including Typicals, must be validated for each customer application by customer s technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. ARM and the ARM Powered Logo are registered trademarks of ARM Limited. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2005. All rights reserved. Document Number: AN2628 Rev. 1 10/2005