C2802x/C2803x/C2805x/C2806x/F28M3x/F2807x/F2837xD/F2837xS/F28004x ADC

Configure ADC to sample analog pins and output digital data

Library

Embedded Coder® Support Package for Texas Instruments™ C2000™ Processors/ C2802x

Embedded Coder Support Package for Texas Instruments C2000 Processors/ C2803x

Embedded Coder Support Package for Texas Instruments C2000 Processors/ C2805x

Embedded Coder Support Package for Texas Instruments C2000 Processors/ C2806x

Embedded Coder Support Package for Texas Instruments C2000 Processors/ F2807x

Embedded Coder Support Package for Texas Instruments C2000 Processors/ F2837xD

Embedded Coder Support Package for Texas Instruments C2000 Processors/ F2837xS

Embedded Coder Support Package for Texas Instruments C2000 Processors/ F28004x

Embedded Coder Support Package for Texas Instruments C2000 F28M3x Concerto™ Processors/ F28M35x/ C28x

Embedded Coder Support Package for Texas Instruments C2000 F28M3x Concerto Processors/ F28M36x/ C28x

Description

Configures the ADC to output a constant stream of data collected from the ADC pins on the DSP.

An ADC block allows for reading one ADC channel. Use multiple ADC blocks to read multiple ADC channels.

Parameters

ADC Module

Select ADC Module 1 or ADC Module 2 for conversion.

Select ADC Module A through D for the processors that support Type 4 ADC.

Note

The ADC Module parameter is available only for Texas Instruments C2000 processors that support Type 3, Type 4, or Type 5 ADC.

ADC Resolution

Select 12-bit (Single-ended input) or 16-bit (Differential inputs) ADC resolution options.

In 12-bit mode, only single-ended input is supported. In 16-bit mode, the input voltage to the converter is sampled through a pair of input pins, that means the differential inputs between the two channels is converted.

This parameter appears only for Texas Instruments C2000 F2807x, Texas Instruments C2000 F2837xD, and Texas Instruments C2000 F2837xS processors.

Note

The 16-bit (Differential inputs) ADC mode is not enabled by default in most of the processors.

Sampling mode

Select Single sample mode to sample signals sequentially. Select Simultaneous sample mode to sample pairs of signals. The hardware allows each signal of a pair to be sampled at the same time.

SOC trigger number

Identify the start-of-conversion trigger by number. In single sampling mode, you can select an individual trigger. In simultaneous sampling mode, you can select triggers in pairs.

SOCx acquisition window

Define the length of the acquisition period in ADC clock cycles. The value of this parameter depends on the SYSCLK and the minimum ADC sample time. For more information, see the ADC Acquisition (Sample and Hold) Window section of the TMS320x2802x, 2803x Piccolo Analog-to-Digital Converter (ADC) and Comparator Reference Guide.

SOCx trigger source

Select the source that triggers the start of conversion. The following types of inputs are available:

  • Software

  • CPU Timers 0/1/2 interrupts

  • XINT2 SOC

  • ePWM1-9 SOCA and SOCB

If you set SOCx trigger source to XINT2_XINT2SOC, use the XINT2SOC external pin / ADCEXTSOC external pin parameter at Hardware Implementation > Target hardware resources to define the external GPIO pin that triggers the start of conversion.

ADCINT will trigger SOCx

At the end of conversion, use the ADCINT1 or ADCINT2 interrupt to trigger a start of conversion (SOC). This loop creates a continuous sequence of conversions. The default selection, No ADCINT disables this parameter. To set the interrupt, select the Post interrupt at EOC trigger option, and choose the appropriate interrupt.

Sample time

Specify the time interval between samples. To inherit sample time from the upstream block, set this parameter to -1.

Data type

Select the data type of the digital output data. You can choose from the options double, single, int8, uint8, int16, uint16, int32, and uint32.

Post interrupt at EOC trigger

Post interrupts when the ADC triggers EOC pulses. When you select this option, the dialog box displays the Interrupt selection and ADCINT# continuous mode options. For more information, see the EOC and Interrupt Operation section of the TMS320x2802x, 2803x Piccolo Analog-to-Digital Converter (ADC) and Comparator Reference Guide.

Interrupt selection

Select which interrupt the ADC posts after triggering an EOC pulse.

ADCINT1 continuous mode, ADCINT2 continuous mode

When the ADC generates an end of conversion (EOC) signal, generate an ADCINT# interrupt, whether the previous interrupt flag has been acknowledged or not.

Input Channels – Conversion channel

Select the input channel to which this ADC conversion applies. For Type 4 ADC, if you select 16-bit (differential inputs) mode, the differential voltage between the two channels is converted.

References

TMS320x2802x, 2803x Piccolo Analog-to-Digital Converter (ADC) and Comparator, Literature Number: SPRUGE5, from the Texas Instruments Web site.