Harness the I²S Interface for Music - and Other -MCU-Based Applications

作者:Maury Wright

投稿人:电子产品

The I²S (Inter-IC Sound) interface was originally defined for use in CD players more than two decades ago, but has been through many revisions and enhancements, and is now a vital element in any digital system that supports music. I²S is a much more latency-sensitive interface relative to other serial interfaces used in MCUs, because the intent of the interface is reliable transmission of high-fidelity audio. To use I²S, you typically need to choose a microcontroller (MCU) with dedicated support for the standard, although software-driven implementations do exist that use standard MCU serial ports. Combine an I²S-enabled MCU with peripheral chips such as audio-centric data converters and you can deliver high-quality digital audio in MCU-based systems.

The I²S interface was defined by Philips. Many people assume that it is technically related to the I²C interface because of the similarity of the acronyms. In reality, the only link is that Philips defined both. I²S is much faster, includes a completely different signaling structure, and is strictly defined for transmitting two-channel audio data.

At a minimum, I²S implementations include three signal lines – a bit clock, a word clock, and a multiplexed data signal. Some implementations also include a master clock signal and a second data line. The interface was defined to allow transmission of two 32-bit audio channels using a pulse-code modulation (PCM) encoding scheme for stereo applications.

Figure 1, courtesy of Microchip, shows a typical I²S implementation scenario. A source such as an A/D converter (ADC) transmits audio digitally to an MCU. The MCU in turn can transmit an audio stream to a D/A converter (DAC) for output to speakers.

Image of Microchip typical audio system with I²S linking
Figure 1: This figure from Microchip shows a typical audio system with I²S linking an ADC with the system MCU and also linking the MCU to a DAC on the output side.

MCU I²S support

Let's examine some of the MCU options that include I²S support. Texas Instruments (TI), for example, offers I²S on several branches of its Stellaris MCU family including the Stellaris 9000 MCUs. Stellaris MCUs integrate a 32-bit ARM Cortex-M3 CPU core. The 9000 subfamily operates from a clock as fast as 80 MHz.

Likewise, Microchip offers I²S support only on its 32-bit PIC32 family of MCUs based on a MIPS CPU core. The range of readily-available products all operate at a maximum clock speed of 40 MHz and feature integrated Flash memory ranging from 32 to 128 Kbytes.

Freescale offers perhaps the broadest set of MCUs with I²S support with a choice of i.MX-, Kinetis-, PowerPC-, and Coldfire-family options. The i.MX products are more correctly called embedded processors than MCUs, although they do integrate memory. The i.MX23/25 processors are based on an ARM9 CPU, the i.MX35 processor is based on an ARM11 CPU, and the i.MX51/53 processors are based on an ARM Cortex-A8 core. Over the range of available ICs, the maximum clock speed supported starts at 100 MHz and extends to more than 400 MHz.

In the MCU-specific area, Freescale primarily supports I²S in the Kinetis family of MCUs that are based on the ARM Cortex-M4 CPU with clock speed topping out at 100 MHz. The Cortex-M4 integrates math-capabilities that are optimized for DSP applications, including music or audio-centric applications, and such products are sometimes referred to as digital signal controllers (DSCs), differentiating the math-capable products from standard MCUs.

NXP also supports I²S on a broad set of ARM-based MCUs. The list includes products based on the ARM7, ARM9, Cortex-M3, and Cortex-M4 MCUs. Similarly, STMicroelectronics has Cortex-M3 and -M4-based MCUs with I²S support in the STM32 family with clock speeds ranging to 168 MHz.

Adding I²S to 16-bit MCUs

Generally, the MCU vendors support I²S only on 32-bit MCUs because high-end audio and music applications typically demand the performance a 32-bit CPU affords. But 16-bit MCU performance has increased substantially, and you could find yourself with the need to interface such an MCU to an audio-centric peripheral such as a stereo ADC.

You may be able to use MCU support for an interface such as the Serial Peripheral Interface (SPI) along with software and some external logic to create a functional I²S port. TI, for example has published an application note (SLAA449A—Interfacing an I²S Device to an MSP430 Device) describing how to implement I²S on 16-bit MSP430-family MCUs (Figure 2).

Image of TI MSP430

Figure 2: You may be able to use a standard serial port and some external logic to implement I²S support on a 16-bit MCU as shown here in the case of the TI MSP430.

Part of the complexity of I²S implementations is the need to support multiplexed data to transmit the two stereo channels. The standard specifies that left and right channel data is signaled as valid by the word clock – one channel on the rising edge and one channel on the falling edge. The circuit depicted in Figure 2 uses a 4-bit counter and some discrete logic to realize a 5-bit counter than can generate the signals needed to accurately transmit 16-bit words for an I²S link.

I²S peripheral ICs

Having covered the MCU side of the I²S link, let's turn to the type of peripheral ICs that you might use in an I²S-based design. The list surely starts with data converters including audio-centric models. Audio-targeted data converters differ from standard offerings in several ways. The audio converters generally support higher precision and faster sampling rates. Moreover, the audio devices generally integrate two channels for stereo support on one IC.

AKM Semiconductor, for example, offers 16- and 24-bit ADCs designed for audio applications. Specific examples include the 24-bit AK5358 and the 16-bit AK5701. The delta-sigma converters can select from two stereo inputs and offer sampling rates as high as 48 kHz. , TI and others also sell ADCs with I²S support.

You can obtain I²S-based DACs from Analog Devices, Maxim Integrated Products, AKM Semiconductor, and TI. For example, Analog Devices offers the 20-bit AD1854 stereo DAC and the 24-bit AD1852 stereo DAC. The sigma-delta converters support sampling rates as high as 192 kHz.

Not all audio applications require a DAC to handle audio output. For example, some Class D linear amplifiers are widely used in portable devices with relatively small speakers. And some Class D amplifiers don't utilize a DAC.

NXP, for example, offers the TFA9879 linear amplifier that accepts an I²S input and drives a speaker. The amplifier takes the audio stream in the digital domain and converts it to a pulse-width-modulated (PWM) stream. Then in the analog domain, a second-order feedback loop combined with an H-Bridge circuit drives the speaker.

The NXP IC is a monotone amplifier, but you can buy stereo Class D amplifiers as well. For example, Analog Devices offers the SSM2518 stereo linear amplifier. Unlike NXP, however, Analog Devices chose to base its design on a DAC and a sigma-delta modulator to optimize audio quality.

Four-channel I²S-based amplifiers are also available from TI, Cirrus Logic, NJR, and others. Figure 3 depicts the block diagram of the TI TAS5711. The IC uses a PWM circuit and H bridge to drive the four outputs rather than a DAC. A typical application might be audio processing for an MPEG video stream with support for rear-channel audio.

Image of The four-channel TI TAS5711 linear amplifier

Figure 3: The four-channel TI TAS5711 linear amplifier links to an MCU via I²S and uses a PWM converter and H-Bridge circuit to drive speakers.

Stepping up a level in terms of integration, you may find that a dedicated audio codec IC might serve best in complex audio applications. Cirrus Logic, for example, offers the CS4205 audio codec for applications such as personal computer multimedia systems. The IC integrates separate 18-bit ADCs for microphone and line inputs. And an integrated 20-bit DAC drives an output mixer.

The Cirrus codec uses the PC-centric AC-Link interface to link a host processor and the codec. But the codec also supports three synchronous I²S inputs and one I²S output for connection with other digital audio peripheral functions.

Application-specific implementations

Until now we have focused on the use of I²S relative to pure audio-centric designs where audio support is the centerpiece of the application requirements. But I²S is also widely used in products where audio support is a necessary but secondary function. You will also find I²S-based ICs that are designed very specifically for certain end products.

Consider Nuvoton Technology. The company makes a pair of ICs in the ISD15100 product family it calls ChipCorder (Figure 4). The ChipCorder ICs implement all of the functions required in a digital record and playback device such as a digital answering machine.

Image of Nuvoton's ChipCorder IC family

Figure 4: Nuvoton's ChipCorder IC family includes all of the functionality required for audio record and playback and provides an I²S link to a host MCU.

The ICs include digital audio compression hardware, integrated flash memory, and dedicated analog and digital audio signal paths. The ISD15108 IC can store 8 minutes of audio and the ISD15116 IC can store 16 minutes of audio in the integrated Flash. Both of those figures refer to audio sampled at 8 kHz and encoded using 4-bit ADPCM. The Nuvoton ICs support a broad choice of compression formats including 2- to 5-bit ADPCM, 6- to 8-bit µ-law or differential µ-law, and 8-, 10- or 12-bit PCM.

The ICs include an analog audio input along with a differential audio input. You transfer digital audio to and from the IC using I²S or SPI, although the former offers far greater fidelity. The IC also includes a Class D audio amplifier that can directly drive a small speaker.

The application-specific story continues in system-on-chip (SoC) products that integrate a robust processing core with peripherals and interfaces such as I²S. In discussing SoCs, we've come full circle from first discussing MCUs, then peripherals that connect to MCUs using I²S, and now to SoCs that may need I²S to connect with peripherals in addition to the on-chip SoC functionality. Micrel, for example, targets a range of communication-centric applications with its KSZx692 series of SoCs (Figure 5). Many of the target applications require high-end audio support such as multimedia-capable residential gateways.

Image of Micrel's KSZx692 series of SoCs target communication-centric applications

Figure 5: Micrel's KSZx692 series of SoCs target communication-centric applications such as multimedia residential gateways and provide an I²S interface for audio support.

The Micrel SoCs are based on a 250-MHz ARM9 core and include dual Ethernet MACs (media access controllers) capable of supporting 100-Mbit/s data rates. There are also USB ports and even a PCI interface. The I²S interface is included to support record and playback of 16-, 18-, 20-, and 24-bit audio.

USB 3.0 application

I²S has also shown up in an unusual place in a new Cypress Semiconductor SoC. The CYUSB3014 USB controller supports the new 5-Gbps Super Speed data-transfer mode that's defined in the USB 3.0 standard. That performance promises to enable USB to serve in a much broader array of multimedia applications ranging from high-end multimedia players to medical and industrial systems.

The SoC actually integrates a 200-MHz ARM9 CPU core along with 512 Kbytes of SRAM. And the IC includes a broad set of peripherals. The I²S interface is intended to support external codecs just as you can connect such a codec to a standard MCU.

What should be clear by now is that you need to consider whether I²S is needed in a project very early on in the specification development process. You may not be working on a purely audio-centric product, but adding audio support can greatly increase the value proposition of many system designs. I²S is the simplest way of supporting quality audio and perhaps increasing the chance of broad success for your product design. But you have to start with an MCU or SoC that includes I²S support in most cases to realize an optimal design. Moreover make a broad sweep reviewing the I²S-enabled ICs on the market. You may find one with application-specific features that could greatly simplify your design cycle.

免责声明:各个作者和/或论坛参与者在本网站发表的观点、看法和意见不代表 DigiKey 的观点、看法和意见,也不代表 DigiKey 官方政策。

关于此作者

Maury Wright

Maury Wright is an electronics engineer turned technology journalist and industry consultant with broad experience in technology areas ranging from microprocessors to digital media to wireless to power management. Wright worked at EDN Magazine for 22 years, serving as editor-in-chief and editorial director for five years. Wright also served as editor of EE Times' Digital Home and Power Management websites.

Currently, Wright is working as a consultant for a number of technology companies and writing under his own byline for the Intel Embedded Community website and for LEDs Magazine.

Wright has won numerous industry awards, including ASBPE national wards for EDN's 50th Anniversary Issue and a similar award for the EDN Prying Eyes department. Wright is an expert in the area of digital media and the connected home, having covered the wired and wireless service-provider and in-home networks extensively. This expertise extends from processors and ASSPs all the way up through the end application. Wright graduated from Auburn University in 1978 with a BSEE and a curriculum emphasis on digital design and development with early microprocessors.

关于此出版商

电子产品

《电子产品》杂志和 ElectronicProducts.com 网站服务于负责电子设备和系统设计的工程师和工程管理人员。