EasyManuals Logo

Texas Instruments C2000 Workshop Guide And Lab Manual

Texas Instruments C2000
342 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 #119 background imageLoading...
Page #119 background image
Lab 6: Analog-to-Digital Converter
C2000 Microcontroller Workshop - Analog-to-Digital Converter 6 - 19
Lab 6: Analog-to-Digital Converter
Objective
The objective of this lab is to become familiar with the programming and operation of the on-chip
analog-to-digital converter. The MCU will be setup to sample a single ADC input channel at a
prescribed sampling rate and store the conversion result in a circular memory buffer.
Lab 6: ADC Sampling
ADC
ADCINA0
RESULT0
...
data
memory
CPU copies result
to buffer during
ADC ISR
ePWM2
ePWM2 triggering
ADC on period match
using SOCA trigger every
20 µs (50 kHz)
GND
+3.3 V
(GPIO20)
Toggle
(GPIO18)
connector
wire
View ADC
buffer PWM
Samples
Code Composer
Studio
Recall that there are three basic ways to initiate an ADC start of conversion (SOC):
1. Using software
a. SOCx bit (where x = 0 to 15) in the ADC SOC Force 1 Register (ADCSOCFRC1) causes a
software initiated conversion
2. Automatically triggered on user selectable conditions
a. CPU Timer 0/1/2 interrupt
b. ePWMxSOCA / ePWMxSOCB (where x = 1 to 7)
- ePWM underflow (CTR = 0)
- ePWM period match (CTR = PRD)
- ePWM underflow or period match (CTR = 0 or PRD)
- ePWM compare match (CTRU/D = CMPA/B)
c. ADC interrupt ADCINT1 or ADCINT2
- triggers SOCx (where x = 0 to 15) selected by the ADC Interrupt Trigger SOC Select1/2
Register (ADCINTSOCSEL1/2)
3. Externally triggered using a pin
a. ADCSOC pin (GPIO/XINT2_ADCSOC)
One or more of these methods may be applicable to a particular application. In this lab, we will
be using the ADC for data acquisition. Therefore, one of the ePWMs (ePWM2) will be
configured to automatically trigger the SOCA signal at the desired sampling rate (ePWM period
match CTR = PRD SOC method 2b above). The ADC end-of-conversion interrupt will be used
to prompt the CPU to copy the results of the ADC conversion into a results buffer in memory.

Table of Contents

Other manuals for Texas Instruments C2000

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments C2000 Specifications

General IconGeneral
BrandTexas Instruments
ModelC2000
CategoryMicrocontrollers
LanguageEnglish

Related product manuals