Embedded Target for Texas Instruments C6000 DSPs | ![]() ![]() |
Use and configure the codec to convert digital input to analog output
Library
c6701evmlib in Embedded Target for TI C6000 DSP
Description
Adding the C6701 EVM DAC (digital-to-analog converter) block to your Simulink model provides the means to output an analog signal to the LINE OUT connection on the C6701 EVM mounting bracket. When you add the C6701 EVM DAC block, the digital signal received by the codec is converted to an analog signal. After converting the digital signal to analog form (digital-to-analog (D/A) conversion), the codec sends the signal to the output audio jack.
Two of the configuration options in the block affect the codec. The remaining options relate to the model you are using in Simulink and the signal processor on the board. In the following table, you find each option listed with the C6701 EVM hardware affected.
Option |
Affected Hardware |
Codec data format |
Codec |
DAC attenuation |
Codec |
Overflow mode |
TMS320C6701 Digital Signal Processor |
Scaling |
TMS320C6701 Digital Signal Processor |
To attenuate the output signal after the D/A conversion, select an attenuation from the DAC attenuation list. Available attenuation values range from 0.0 to 94.5 dB in 1.5 dB increments. You must select from the list; you cannot enter a value for the attenuation.
For the block to accept data from your Simulink model, you must configure the data format. The parameters Codec data format and Scaling inform the block of the format of the digital data being received. Entries in Table 6-3, Expected Data Range for Data Type and Codec Data Format Parameter Combinations, define the D/A input format based on the data type inherited from the preceding block and your selection for the Codec data format parameter in the Block Parameters dialog box.
For example, when you select 16-bit linear
codec data format, with normalized
scaling, and the block inherits the Double
data type, the C6701 EVM DAC block expects to receive a digitized signal with each sample 16 bits long and ranging from -1.0 to 1.0. Signals that do not meet these criteria result in an error.
Tables 4-4 and 4-5 list the codec data formats you can select for the block. The following list provides brief descriptions of the available data formats:
While converting the digital signal to an analog signal, the codec rounds floating point data to the nearest integer, thus rounding 0.51 up to 1.0 or 4.49 down to 4.0. In addition, data that exceeds the range for a selected codec data format and data type is clipped or wrapped depending on the Overflow mode setting. Clipping is equivalent to saturating. To choose how the board handles data that falls outside the range that can be represented by the chosen data format, select an appropriate setting from Overflow mode. Saturate
is
the default setting. Selecting Saturate
instructs the codec to clip output values to the maximum or minimum allowed value when output data exceeds the range of the data format. When you select Wrapping
, the codec takes data that exceeds the acceptable output range and wraps the data back into the acceptable range using modular arithmetic relative to the smallest representable number. Selecting wrapping
for the Overflow Mode can increase the performance of your application, but risks generating output values that exceed the codec data format limits and are wrapped back into the range of acceptable values.
Dialog Box
See Also
C6701 EVM ADC
![]() | C6701 EVM ADC | C6701 EVM DIP Switch | ![]() |