EasyManuals Logo

Texas Instruments TMS320F2837 D Series Workshop Guide And Lab Manual

Texas Instruments TMS320F2837 D Series
324 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #143 background imageLoading...
Page #143 background image
Lab 6: Analog-to-Digital Converter
TMS320F2837xD Microcontroller Workshop - Analog Subsystem 6 - 29
prompt the CPU to copy the results of the ADC conversion into a results buffer in memory. This
buffer pointer will be managed in a circular fashion, such that new conversion results will
continuously overwrite older conversion results in the buffer. In order to generate an interesting
input signal, the code also alternately toggles a GPIO pin (GPIO18) high and low in the ADC
interrupt service routine. The ADC ISR will also toggle LED D9 on the LaunchPad as a visual
indication that the ISR is running. This pin will be connected to the ADC input pin, and sampled.
After taking some data, Code Composer Studio will be used to plot the results. A flow chart of the
code is shown in the following slide.
Lab 6: Code Flow Diagram
Start
General Initialization
PLL and clocks
Watchdog configure
GPIO setup
PIE initialization
ADC Initialization
convert channel A0 on
ePWM2 period match
send interrupt on EOC
to trigger ADC ISR
setup a results buffer
in memory
ePWM2 Initialization
clear counter
set period register
set to trigger ADC on
period match
set the clock prescaler
enable the timer
Main Loop
while(1)
{
}
ADC ISR
read the ADC result
write to result buffer
adjust the buffer pointer
toggle the GPIO pin
return from interrupt
ADC interrupt
return
Notes
Program performs conversion on ADC channel A0 (ADCINA0 pin)
ADC conversion is set at a 50 kHz sampling rate
ePWM2 is triggering the ADC on period match using SOCA trigger
Data is continuously stored in a circular buffer
GPIO18 pin is also toggled in the ADC ISR
ADC ISR will also toggle the LaunchPad LED D9 as a visual indication that it is running

Table of Contents

Other manuals for Texas Instruments TMS320F2837 D Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320F2837 D Series and is the answer not in the manual?

Texas Instruments TMS320F2837 D Series Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320F2837 D Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals