Common Converter Connection Formats

来源:互联网 发布:2017淘宝禁售商品明细 编辑:程序博客网 时间:2024/06/08 19:15

Common Converter Connection Formats

There are several standards for connecting microcontrollers to audio converters. In general, a frame signal,
transmit data, receive data, and bit clock are used to transfer data to and from a converter. The frame rate
usually represents the sample rate of the audio data, although this is not always the case. This section
illustrates some examples on connecting an audio converter to the MPC5200 PSC.

1. General PCM Codec

Most converters use a frame sync signal to signify the beginning of a new sample of audio data. These
converters are usually associated with mono or single channel converters. The frame sync pulse frequency
is usually the sample rate in the single channel converter. There are a few variations such as to whether the
the most significant bit (MSB) or least significant bit (LSB) comes first or if the data starts with the frame
sync or one bit time after. Other variations have to do with frame sync and clock being active high or active
low. The figures below show some examples of audio data formats.

The frame sync signal determines when the next audio sample is to be transferred between the controller
and the converter. Also, the frame sync signal as seen in the above figure can be one bit time or a long bit
time. That is why the frame sync frequency is usually the sample rate. There are some variations to
accommodate more audio channels from having every other frame be a different channel to having the bit
clock be fast enough to have more than one channel data in each frame sync. For example, having 32-bits
transferred each frame sync when the data sample size is 16-bits. These channel variations can be
interfaced to the MPC5200 PSC, but usually stereo 2-channel converters use an I2S interface, as described
in the next section

2. I2S

I2S was defined by Philips source for 2-channel stereo audio streams. The left or right channel audio data
is defined by the state of the LRCK signal. The LRCK is the frame sync signal and defines the sample
frequency for the data. I2S can accommodate any data size usually from 8 to 32 bits for each channel with
the most significant bit (MSB) first.

Notice the data is shifted by one bit from the start of the LRCLK. Since the MSB comes first, the controller
can output more or less bits than the converter is expecting. For example, if the converter is 32-bit, but the
controller only has 16-bit samples, the data can be left-justified to the MSB and have the lower 16-bits set
0. The converter can still accurately represent the signal in 32 bits. The same connection can be used for
8 or 32 bit data samples without changing anything except the number of bits used in the audio sample.
A variation on I2S which is called left-justified swaps the state meaning of the frame sync signal from low
meaning left to high meaning left, and it removes the single clock delay for the first bit in relation to the
frame sync signal. The MPC5200 PSC can easily work with either format.

3. AC97

AC97 was a standard for audio codecs used for personal computer design in 1997. The specification has
been updated since then to include new features. AC97 was designed to handle multiple 20-bit channels
at a 48 kHz rate. It also incorporates sample rate conversion through hardware, so the controller can work
directly with some popular sample rates. The AC97 standard defines a complex analog mixer that would likely be needed for telephony, recording, and entertainment applications to be integrated into the
converter. Almost all personal computers today have an AC97 defined codec on the motherboard.

The AC97 frame contains control and audio data in the same serial stream. Other audio interconnect
standards deal only with data, and there is usually another set of pins for control data that is an SPI or I2C
interface. Since the control for the AC97 converter is embedded into the data channel, driver software is
more complex than just sending the audio data.
AC97 also has the ability of using different sample rates using the data slot tags in slot 0 for incoming data
and slot 1 for transmitted data. The AC97 device tells the microcontroller when to put the next output
sample in the data out stream. This lets the interface still run at 48 kHz while letting the converter sample
rate change to a lower rate such as 8 kHz or 44.1 kHz.
Since there are so many AC97 codecs to choose from, they are relatively cheap, and some manufactures
are starting to carry industrial temperature versions. They are clearly finding applications other than PCs.

0 0
原创粉丝点击