AN2113 Freescale Semiconductor / Motorola, AN2113 Datasheet - Page 14

no-image

AN2113

Manufacturer Part Number
AN2113
Description
AN2113 Multichannel Voice Coding System on the RTXC Operating System
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Software Description
14
7.2.1 Audio Codec Initialization
The ESSI provides a full duplex serial port for serial communications with a variety of serial devices,
including industry-standard analog-to-digital codecs, other DSPs, microprocessors, and peripherals. The
SCI provides a full duplex port for serial communications with other DSPs, microprocessors, or
peripherals such as modems. The HI08 is a byte wide, full duplex, double-buffered parallel port that can
connect directly to the data bus of a host processor. For our application, we use the ESSI for obtaining
audio I/O from the multichannel codec board described in Section 6.1, Target Hardware, on page 10 and
the SCI for communicating with the host computer using the command line interface. The HI08 is not
required.
In the DSP56300 family, the I/O peripherals can trigger interrupts to conveniently handle processing. The
DSP56300 processors have two types of interrupts:
The ESSI software for the audio I/O handling focuses on properly initializing the hardware and efficiently
using the ISRs and data structures. In our system, a double buffering technique implements efficient data
transfers from the codecs to the DSP56307 core for processing of the data I/O in the Delay and IS96a
modes. In the double buffering technique, two buffers and two pointers are used instead of just a single
buffer for data input or data output. A single buffer that receives data requires the input data stream to
“wait” while the current data in the buffer is processed. When two buffers (and two pointers) are used, one
buffer can be filled while the other is processed. When the receiving buffer is full and the other is
processed, the pointers are swapped so that the processing can occur with the new data and the incoming
data stream can fill the alternate buffer. Swapping pointers omits the need to copy the data does from one
buffer to the other. The pointer is then passed to the data input task or the processing task. A similar
situation occurs for output data (the resulting data from the processing) and data transmitted via the ESSI.
Before communications can begin between the audio codec board and the DSP56307, the codec must be
initialized. There are two main steps to initialization:
1. Send control data.
2. Once the control information is sent, place the codec into data mode. Transmission may then begin.
General purpose I/O (GPIO) pins initialize the audio codec in control mode. One line sets the mode of the
audio codec: control or data. The second line is tied to the codec reset line. These are the only control lines
required to initialize the CS4215 codec. When the codec comes out of reset in control mode, it waits to
receive control information for operation. The DSP56307 controls the interface and transmits the control
words to the codec. Once the codec receives all of its control words, the codec is placed into data mode.
Because the codecs on the multichannel board are daisy-chained together, one codec on the multichannel
board is initialized as the interface master. When the codec is placed in data mode, the DSP56307 is no
longer master of transmission between the devices. The master codec generates the clock for the ESSI.
Fast interrupts are two instructions long and require no overhead for jumping to the interrupt or
returning to the normal program flow. Furthermore, the fast interrupt instructions always complete
without interruption. Fast interrupts are an excellent method for moving data from the I/O
peripherals.
Long interrupts are not limited to a certain number of instructions and can be interrupted by higher
priority interrupts. However, long interrupts need to save and restore the program counter, the
status register and update the stack pointer to return to the normal program flow. Long interrupts
are used when more intricate data processing is required.
Freescale Semiconductor, Inc.
For More Information On This Product,
Multichannel Voice Coding System
Go to: www.freescale.com

Related parts for AN2113