Lab 7: Event Manager
Main_7.c Labcfg.cmd
Lab.cdb DSP281x_Headers_BIOS.cmd
User_5_6_7.cmd CodeStartBranch.asm
SysCtrl.c Gpio.c
DSP281x_GlobalVariableDefs.c PieCtrl_5_6_7_8_9.c
DefaultIsr_5_6_7.c Adc.c
Ev_7_8_9_10.c
Setup Shared I/O, General-Purpose Timer1 and Compare1
2. Edit Gpio.c and adjust the shared I/O pins in Group A for the PWM1 function.
3. In
Ev_7_8_9_10.c, setup General-Purpose Timer 1 and Compare 1 to implement the
PWM waveform as described in the objective for this lab. The following registers need
to be modified: T1CON, T1CNT, T1PR, DBTCONA (set deadband units off), CMPR1,
ACTRA, COMCONA. (Hint – the last step should be to enable Timer 1). Make use of
the global variable names and values that have been set using #define in the beginning of
Ev_7_8_9_10.c file. Notice that GPTCONA has been initialized earlier in the code
during Timer 2 setup. Save your work.
Build and Load
4. Save all changes to the files and click the “Build” button.
5. Reset the DSP.
Run the Code – PWM Waveform
6. Open a memory window to view some of the contents of the ADC results buffer. The
address label for the ADC results buffer is
AdcBuf. We will be running our code in real-
time mode, and need to have our window continuously refresh. Enable
Real-time
Mode
and be sure that the Global Continuous Refresh option has been checked.
Note: For the next step using the ADC, check to be sure that the jumper wire connecting
“VREFLO” (pin # P9-18) to “GND” (pin # P9-17) is still in place on the eZdsp™ from
the earlier lab.
7. Using another connector wire provided, connect the PWM1 (pin # P8-9) to ADCIN0 (pin
# P9-2) on the eZdsp™.
8. Run the code in real-time mode and watch the window update. Verify that the ADC
result buffer contains the updated values.
9. Open and setup a graph to plot a 50-point window of the ADC results buffer.
Click:
View Graph Time/Frequency… and set the following values:
C28x - Event Manager 7 - 37