Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on...

17
Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is Jayanth Madapura and I am with the PIC32 Applications group. In this webinar we will be looking at how PIC32 family of devices is used to achieve quality audio. 1

Transcript of Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on...

Page 1: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is Jayanth Madapura and I am with the PIC32 Applications group. In this webinar we will be looking at how PIC32 family of devices is used to achieve quality audio.

1

Page 2: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

Thanks to the Smartphone Revolution, Digital Audio is Everywhere. The fast growing mobile computing device market has created the demand for new accessory ideas and opportunities to innovate and achieve time-to-market. All digital audio systems being introduced into the consumer audio market, such as smartphones, music players like ipods, audio docks, receivers, accessories and digital TV-sound require quality audio with high resolution and sample rates to preserve audio fidelity. PIC32 with its robust set of features can meet the interfacing and processing needs while keeping the design cost and power consumption low.

2

Page 3: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

Some of the basic requirements of an embedded audio design are: Standard Communication Protocols to be able to communicate with audio analog frontends like audio codecs or discrete Digital to Analog Converters or Analog to Digital Converters. High Sample Rate and High Bit Resolution are required to faithfully reproduce audio and to be able to increase the dynamic range of the audio. High quality audio requires 16 or 24-bit resolution and sample rates beyond 32KHz. A Clock Source with less jitter is required for the codecs or DACs. It is used as internal time base to generate other serial clocks such as left right phase clock, bit clock. A design which ensures that the various clocks are synchronized is required. A flexible clocking scheme which is adaptive and can prevent clicks and pops due to Audio Buffer Underrun and Overrun caused due to clock mismatches. Audio Decoding and Processing capabilities to perform required signal processing. We will look at features the PIC32 family of devices offers to meet these requirements while keeping the design cost low.

3

Page 4: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

Audio communication protocol support is needed to transfer audio stream to and from the Analog Front Ends like audio codecs or discrete Digital to Analog Converters or Analog to Digital Converters. These protocols specify the timing of the left-right phase clock, bit clock and the data alignment. It accommodates stereo audio data and takes into account any propagation delays. Some of the common audio communication protocols include I2S, Left Justified, Right Justified, PCM/DSP modes. Most codecs and DACs support these protocols. The Serial Peripheral Interface or SPI module on PIC32 device supports all these communication protocols.

4

Page 5: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

High Bit Resolution is a must to preserve the quality and depth of the audio stream being transferred. High quality audio requires 16 or 24-bit resolution. PIC32 with its Serial Peripheral Module supports 16, 24 bit and higher resolutions for both in and out channels. It can accommodate stereo 24bit data on a 32bit channel with 64bit frame, stereo 16bit data on a 16bit channel with 32bit frame, stereo 16bit data on a 32bit channel with 64bit frame and stereo 32bit data on a 32bit channel with a 64bit frame. High sample rates are required to faithfully reproduce the audio signal. SPI module on PIC32 can support high sample rates required for CD, DAT quality and higher. 44.1KHz for CD quality audio, 48KHz for DAT quality audio and beyond 92KHz for DVD/blue-ray quality audio.

5

Page 6: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

A master clock is used as internal time base by the audio codecs to generate other serial clocks such as left right phase clock, bit clock. Typically an external oscillator is used as source of the master clock to the codecs. A Clock Source with less jitter is required for the master clocks. Some PIC32 devices have a reference clock output module which generates a clock output which can provide the master clock. This eliminates the need for an external oscillator and provides cost savings.

6

Page 7: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

The master time base required by codecs is fractional in nature n order to accommodate various sample rates. Codecs and DACs typically use the constant frequency oscillator as source and regenerate the fractional clocks internally using a complex PLL. The reference clock output module present on some PIC32 devices can generate clock outputs which are fractional in nature. This eliminates the need for the codec to have an internal PLL and provide cost savings.

7

Page 8: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

This table shows the different audio master clocks. These master clocks or time bases are dependent on the oversampling performed in the codec or the DAC and are multiples of the sampling rate. They are fractional clock values. PIC32 devices with the reference clock output module with a fractional divider can generate these standard audio fractional clocks.

8

Page 9: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

The reference clock output on PIC32 can be internally configured as the clock source to the Serial Peripheral Interface. This is required by SPI to generate the required bit clock and left-right phase clock if PIC32 is configured as Master. It keeps all the clocks synchronized. The source clock for the reference clock output module can be selected between different sources. One such source is the output clock from USB PLL which is 96MHz. In a USB Digital Audio application these features provide all the various fractional clocks required and keep the clocks synchronized.

9

Page 10: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

In real-time streaming, the audio samples must arrive at precise regular time intervals so that the DAC can convert the digital samples to an analog signal with the expected constant rate at which it is configured. The DAC clock that expects and receives the audio samples at a particular sample rate cannot miss a single sample. A missing sample manifests as a subtle click for the listener, since the DAC fails to generate an accurate representation of the streamed audio signal. On a microcontroller with an embedded USB module, the USB clock is sourced from an independent clock such as an on-chip PLL with an external crystal oscillator. Since the clock is not sourced from the USB interface, the mismatch in clocks introduces buffer overrun or underrun, causing audible clicks and pops. To prevent audio clicks and pops caused due to the clock mismatch, the reference clock output module available on PIC32 can be tuned based on the monitored buffer levels to prevent such buffer underruns and overrun.

10

Page 11: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

To compliment all the features of Serial Peripheral Interface module and reference clock output module the PIC32 devices have enough processing power supported by a powerful instruction set to perform complex audio processing functions. The core offers 32bit resolution and 64bit accumulator for intermediate arithmetic operations. PIC32 offers range of flash and RAM memory options to suit a wide variety of applications. Some of the common audio processing algorithms that can be supported by PIC32 are mp3, aac, wma decoders, equalizer, dynamic range control, noise suppression, spectral analysis.

11

Page 12: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

This slide shows a couple of high-level examples of audio designs. The block diagram on the top shows a Digital Audio Dock Solution using PIC32 with audio interfacing using all the features discussed earlier which ensures quality audio and a USB Host interface. It also shows the use of other peripherals for modules such as Bluetooth, graphics display, mass storage devices and others. The block diagram below shows a Digital Audio Accessory using PIC32 using the serial interfacing and showcasing all the features used for quality audio along with the USB device capabilities.

12

Page 13: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

AN1422 is an application note which provides information about how to interface a codec with the PIC32 serial interface peripheral module, and talks about the various audio communication formats. It provides some details about how to use reference clock output module to generate the standard audio fractional clocks and how it can be tuned to prevent the buffer underrun and overrun to avoid degradation of audio due to clicks and pops caused by clock mismatch.

13

Page 14: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

Here is a list of recommended PIC32 devices based on application needs for audio designs.

14

Page 15: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

These are a couple of accessory boards available from Microchip which showcases the PIC32 audio features discussed in this webinar. Both the boards use PIC32MX250F128B devices. They both support 16/24-bit audio resolution and upto 48KHz sample rate. The PIC32 USB Digital Audio Board is a generic board and can be plugged-in to any device like laptop, PC etc with USB Audio Class support. The PIC32 Digital Audio Mixer Accessory Board is the other board and is a Made for iPod audio accessory compatible with Apple devices.

15

Page 16: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

In conclusion, PIC32 devices have serial peripheral interface with audio mode to support the audio interface protocols including I2S, capable of handling 16/24-bit resolution stereo audio at various standard audio sample rates. Some PIC32 devices also have a reference clock output module which can be used to provide standard master clock/time base to audio codec without the need for an external crystal or a PLL in the codec. The reference clock output can be tuned in run-time to be able to tune the clocks in a tight range with small increments or decrements to be able to prevent the subtle clicks and pops which are caused due to clock mismatch in audio designs with digital audio sources like USB. The MIPS and memory resources on PIC32 devices provide audio processing and decoding capabilities. PIC32 achieves lower design cost and lower power consumption. Application note AN1422 provides information about interfacing with Serial Peripheral Module, reference clock output module, bit rates and sample rates.

16

Page 17: Welcome to the web-seminar on Digital Audio Applications ... · Welcome to the web-seminar on Digital Audio Applications using PIC32. My name is ... base to generate other serial

17