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 #121 background image
Lab 6: Analog-to-Digital Converter
C2000 Microcontroller Workshop - Analog-to-Digital Converter 6 - 21
Procedure
Open the Project
1. A project named Lab6 has been created for this lab. Open the project by clicking on
Project Import CCS Projects. The “Import CCS Eclipse Projects”
window will open then click Browse… next to the “Select search-directory” box.
Navigate to: C:\C28x\Labs\Lab6\Project and click OK. Then click Finish to
import the project. All build options have been configured the same as the previous lab.
The files used in this lab are:
Adc.c
Gpio.c
CodeStartBranch.asm
Lab.h
DefaultIsr_6.c
Lab_5_6_7.cmd
DelayUs.asm
Main_6.c
EPwm_6.c
PieCtrl.c
F2806x_DefaultIsr.h
PieVect.c
F2806x_GlobalVariableDefs.c
SysCtrl.c
F2806x_Headers_nonBIOS.cmd
Watchdog.c
Setup ADC Initialization and Enable Core/PIE Interrupts
2. In Main_6.c add code to call InitAdc() and InitEPwm() functions. The
InitEPwm() function is used to configure ePWM2 to trigger the ADC at a 50 kHz rate.
Details about the ePWM and control peripherals will be discussed in the next module.
3. Edit Adc.c to configure SOC0 in the ADC as follows:
SOC0 converts input ADCINA0 in single-sample mode
SOC0 has a 7 cycle acquisition window
SOC0 is triggered by the ePWM2 SOCA
SOC0 triggers ADCINT1 on end-of-conversion
All SOCs run round-robin
4. Using the “PIE Interrupt Assignment Table” find the location for the ADC interrupt
ADCINT1(high-priority) and fill in the following information:
PIE group #: # within group:
This information will be used in the next step.
5. Modify the end of Adc.c to do the following:
- Enable the “ADCINT1interrupt in the PIE (Hint: use the PieCtrlRegs structure)
- Enable the appropriate core interrupt in the IER register
6. Open and inspect DefaultIsr_6.c. This file contains the ADC interrupt service
routine. Save your work and close the modified files.
Build and Load
7. Click theBuild” button and watch the tools run in the Console window. Check for
errors in the Problems window.

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