EasyManuals Logo
Home>Texas Instruments>Microcontrollers>TMS320F2837 D Series

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 #201 background imageLoading...
Page #201 background image
Lab 7: Control Peripherals
TMS320F2837xD Microcontroller Workshop - Control Peripherals 7 - 51
Adc.c
Gpio.c
CodeStartBranch.asm
Lab_5_6_7.cmd
Dac.c
Main_7.c
DefaultIsr_7.c
PieCtrl.c
DelayUs.asm
PieVect.c
ECap.c
SineTable.c
EPwm.c
SysCtrl.c
F2837xD_Adc.c
Watchdog.c
F2837xD_GlobalVariableDefs.c
Xbar.c
F2837xD_Headers_nonBIOS_cpu1.cmd
Note: The ECap.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.c, setup ePWM1 to implement the PWM waveform as described in the objective
for this lab exercise. 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). Directly make use of the global variable names for the TBPRD and
CMPA values which have been set using #define in the beginning of Lab.h file. Within
the Project Explorer window, the Lab.h file is located in the include folder under
/Lab_common/include. (As a challenge, you could calculate the values for TBPRD and
CMPA). Notice that ePWM2 has been initialized earlier in the code for the ADC lab
exercise. Save your work.
Build and Load
4. Click the “Build” button and watch the tools run in the Console window. Check for
errors in the Problems window.
5. Click the “Debug” button (green bug). A Launching Debug Session window will open.
Select only CPU1 to load the program on (i.e. uncheck CPU2), and then click OK. Then
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. Using a jumper wire, connect the PWM1A (header J4, pin #40) to ADCINA0 (header J3,
pin #30) on the LaunchPad. Refer to the following diagram for the pins that need to be
connected.

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