Skip to Main Content Skip to Search
Product Documentation

C2802x/C2803x ADC - Configure ADC to sample analog pins and output digital data

Library

Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C2802x

Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C2803x

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.

Dialog Box

Sampling mode

Select Single sample mode to sample two signals sequentially. Select Simultaneous sample mode to sample the two signals with a minimal delay between the samples.

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, the acquisition window, in sample cycles. The minimal value for this parameter is 7 cycles. 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-7 SOCA and SOCB

If you set SOCx trigger source to XINT2_XINT2SOC, use the XINT2SOC external pin parameter in the Target Preferences block to define the external GPIO pin that triggers the start of conversion. XINT2SOC external pin is located under the Target Preferences block's Peripherals tab, on the ADC pane.

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.

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.

References

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

See Also

C280x/C2802x/C2803x/C28x3x/c2834x ePWM

C280x/C2802x/C2803x/C28x3x Hardware Interrupt

Configuring Acquisition Window Width for ADC Blocks

ADC

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS