EasyManuals Logo
Home>Texas Instruments>Microcontrollers>C2000

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 #172 background imageLoading...
Page #172 background image
Lab 7: Control Peripherals
7 - 46 C2000 Microcontroller Workshop - Control Peripherals
Adc.c
Gpio.c
CodeStartBranch.asm
Lab.h
DefaultIsr_7.c
Lab_5_6_7.cmd
DelayUs.asm
Main_7.c
ECap_7_8_9_10_12.c
PieCtrl.c
EPwm_7_8_9_10_12.c
PieVect.c
F2806x_DefaultIsr.h
SysCtrl.c
F2806x_GlobalVariableDefs.c
Watchdog.c
F2806x_Headers_nonBIOS.cmd
Note: The ECap_7_8_9_10_12.c file will be added and used with eCAP1 to detect
the rising and falling edges of the waveform in the second part of this lab exercise.
Setup Shared I/O and ePWM1
2. Edit Gpio.c and adjust the shared I/O pin in GPIO0 for the PWM1A function.
3. In EPwm_7_8_9_10_12.c, setup ePWM1 to implement the PWM waveform as
described in the objective for this lab. The following registers need to be modified:
TBCTL (set clock prescales to divide-by-1, no software force, sync and phase disabled),
TBPRD, CMPA, CMPCTL (load on 0 or PRD), and AQCTLA (set on up count and clear
on down count for output A). Software force, deadband, PWM chopper and trip action
has been disabled. (Hint – notice the last steps enable the timer count mode and enable
the clock to the ePWM module). Either calculate the values for TBPRD and CMPA (as a
challenge) or make use of the global variable names and values that have been set using
#define in the beginning of Lab.h file. Notice that ePWM2 has been initialized earlier
in the code for the ADC lab. Save your work and close the modified files.
Build and Load
4. Click theBuildbutton and watch the tools run in the Console window. Check for
errors in the Problems window.
5. Click the Debug” button (green bug). The “CCS Debug Perspective” view should
open, the program will load automatically, and you should now be at the start of
main(). If the device has been power cycled since the last lab exercise, be sure to
configure the boot mode to EMU_BOOT_SARAM using the Scripts menu.
Run the Code PWM Waveform
6. Open a memory browser to view some of the contents of the ADC results buffer. The
address label for the ADC results buffer is AdcBuf (type &AdcBuf) in the “Data”
memory page. We will be running our code in real-time mode, and we will need to have
the memory window continuously refresh.
7. Using a connector wire provided, connect the PWM1A (pin # GPIO-00) to ADCINA0
(pin # ADC-A0) on the Docking Station.
8. Run the code (real-time mode) using the Script function: Scripts Realtime
Emulation Control Run_Realtime_with_Reset. Watch the window
update. Verify that the ADC result buffer contains the updated values.

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