Embedded Target for Texas Instruments C6000 DSPs    
C6701 EVM ADC

Configure digitized signal output from the codec to the processor

Library

c6701evmlib in Embedded Target for TI C6000 DSP for TI DSP

Description

Use the C6701 EVM ADC (analog-to-digital converter) block to capture and digitize analog signals from external sources, such as signal generators, frequency generators or audio devices. Placing an C6701 EVM C6701 EVM ADC block in your Simulink block diagram lets you use the multimedia audio coder-decoder module (codec) on the C6701 EVM to convert an analog input signal to a digital signal for the digital signal processor.

Most of the configuration options in the block affect the codec. However, the Output data type, Samples per frame and Scaling options are related to the model you are using in Simulink, the signal processor on the board, or direct memory access (DMA) on the board. In the following table, you find each option listed with the C6701 EVM hardware affected.

Option
Affected Hardware
ADC Source
Codec
Codec Data format
Codec
Mic
Codec
Output data type
TMS320C6701 digital signal processor
Sample rate (Hz)
Codec
Samples per frame
Direct memory access functions
Scaling
TMS320C6701 digital signal processor
Source gain (dB)
Codec
Stereo
Codec

You can select one of three input sources from the ADC source list:

Use the Stereo check box to indicate whether the audio input is monaural or stereo. Clear the check box to choose monaural audio input. Select the check box to enable stereo audio input. Monaural (mono) input is left channel only, but the output sends left channel content to both the left and right output channels; stereo uses the left and right channels. Table 6-1, Audio Word Byte Order for Mono and Stereo Inputs, shows how the codec stores monaural and stereo digitized signals in 32-bit words on the C6701 EVM.In the table, L means left channel, R means right channel, and O means that the 4-byte nibble does not contain data.

Table 6-1: Audio Word Byte Order for Mono and Stereo Inputs 
Format
Left and Mono Channel
(first 16 bits of data word)
Right and Stereo Channel
(last 16 bits of data word)
16-bit mono
0xLLLL
0x0000
16-bit stereo
0xLLLL
0xRRRR
8-bit mono
0xLL00
0x0000
8-bit stereo
0xLL00
0xRR00
4-bit mono
0xL000
0x0000
4-bit stereo
0xL000
0xR000

When you select Mic for ADC source, you can select the +20 dB Mic gain boost check box to add 20 dB to the microphone input signal before the codec digitizes the signal.

Selecting Loopback for ADC source configures the C6701 EVM to capture the output from the codec as the input to the C6701 EVM ADC. When you select Loopback, your model must include both the C6701 EVM ADC and C6701 EVM  DAC blocks.

You must set the sample rate for the block. From Sample rate (Hz), select the sample rate for your model. Sample rate (Hz) specifies the number of times each second that the codec samples the input signal. Sample rates range from
5500 Hz to 48000 Hz, in preset rates. You must select from the list; you cannot enter a sample rate that is not on the list.

Source gain (dB) lets you add gain to the input signal before the A/D conversion. When you select Loopback as the ADC source, your specified source gain is not added to the input signal. Select the appropriate gain from the list.

To enable the block and codec to generate data that your Simulink model can use, select the digitized data format. Three parameters -- Codec data format, Codec data type and Scaling -- control the format and range of the digital data generated by the block. Entries in Table 6-2 define the output ranges based on your selections for the Data type, Scaling, and Codec data format parameters in the Block Parameters dialog.

Table 6-2: Data Type and Codec Data Format Parameters Choices Determine the Range


Data Type Parameter


Integer
Single- or Double Precision, Normalized
Single- or Double Precision, Floating-Point Integer
Codec Data Format
8-bit Unsigned
0-255
-1.0 to 1.0
0.0 to 255.0
16-bit Linear
-32768 to 32767
-1.0 to 1.0
-32768.0 to 32767.0
A-law
Unsigned 8-bit (0-255)
-1.0 to 1.0
0.0 to 255.0
µ-law
Unsigned 8-bit (0-255)
-1.0 to 1.0
0.0 to 255.0
ADPCM
Unsigned 8-bit (0-255)
N/A
0.0 to 255.0

For example, when you select 16-bit linear data format, normalized scaling, and the Double data type, the C6701 EVM ADC block outputs a digitized signal composed of 16 bit samples ranging linearly from -1.0 to about 1.0.

Tables 4-2 and 4-3 list the five codec data formats you can select for the block. For reference purposes, the data types are described briefly in the following list:

Dialog Box

ADC source
The input source to the codec. Line In is the default.
Stereo
The number of channels input to the A/D converter. Clearing this option selects the left channel; selecting this option selects both left and right input channels. To configure the C6701 EVM board for monaural operation, clear the Stereo check box. When you first open the dialog, Stereo is cleared. The default is monaural operation.
+20 dB Mic gain boost
Boosts the input signal by +20dB when ADC source is Mic. Gain is applied before analog-to-digital conversion.
Sample rate (Hz)
Sampling rate of the A/D converter. Available sample rates are set by the two clocks in the codec. Default rate is 8000 Hz.
Codec data format
Configures the format for output from the codec. Used in combination with the Scaling and Data type parameters to define the digital data leaving the block.
Your C6701 EVM ADC block format must match the codec data format for the C6701 EVM DAC block, if you use one in your model. The default setting is 16-bit linear.
Output data type
Selects the word length and shape of the data from the codec. By default, double is selected.
Scaling
Selects whether the codec data is unmodified, or normalized to the output range to ±1.0, based on the codec data format. Normalize is the default setting.
Source gain (dB)
Specifies the amount to boost the input before conversion. Applied to input signal when ADC source is Line In or Mic In.
Samples per frame
Creates frame-based outputs from sample-based inputs. This parameter specifies the number of samples of the signal buffered internally by the block before it sends the digitized signals, as a frame vector, to the next block in the model. 64 samples per frame is the default setting. Notice that the frame rate depends on the sample rate and frame size. For example, if your input is 32 samples per second, and you select 64 samples per frame, the frame rate is one frame every two seconds. The throughput remains the same at 32 samples per second.

See Also
C6701 EVM DAC


  Block Exponent C6701 EVM DAC