TMS320F28335 Library  1.0
Documentation
ADC

The Analog-to-Digital Converter (ADC) module enables to convert an analog value of 0 V - 3 V into a digital value of 0-4095 on 16 channels.
Possible ADC-Channels as input parameter are defined in global_defines.h and can also be seen in this overview table.


Code example

#include "global_defines.h" //Include global_defines.h
#include "system_controls/system_controls.h" //Include module of system controls
#include "adc/adc.h" //Include module of ADC
void main(void){
int adc_value = 0; //Variable to store returned ADC-Value
setSystemControls(); //Call setSystemControls() function
init_ADC(); //Call init_ADC() function to configure all 16 ADC channels
while(1){ //Endless loop
adc_value = ADC_getValue(ADCINA0); //Get Value of ADC Channel A0. Function returns ADC value of 0-4095 or -1 for invalid input parameter
}
}

Documented C-Code of module:

adc


Detailed description in Technical Reference Manual:

Technical_Reference_Manual

adc.h
Header file for ADC module.
global_defines.h
Header file for global defines.
setSystemControls
void setSystemControls(void)
Configuration of system control register.
Definition: system_controls.c:13
ADC_getValue
int16 ADC_getValue(Uint16 adc_pin)
Get Value of ADCIN-Pin.
Definition: adc.c:56
init_ADC
void init_ADC()
Init ADC.
Definition: adc.c:16
system_controls.h
Header file for System Controls module.