Lab 5: System Initialization
5 - 18 C28x - System Initialization
18. Modify main() to do the following:
enable the "WAKEINT" interrupt in the PIE (Hint: use the PieCtrlRegs structure)
enable core INT1 (IER register)
enable global interrupts (INTM bit)
19. In SysCtrl.c modify the system control and status register (SCSR) to cause the
watchdog to generate a WAKEINT rather than a reset.
20. Open and inspect DefaultIsr_5_6_7.c. This file contains interrupt service
routines. The ISR for WAKEINT has been trapped by an emulation breakpoint contained
in an inline assembly statement using “ESTOP0”. This gives the same results as placing
a breakpoint in the ISR. We will run the lab exercise as before, except this time the
watchdog will generate an interrupt. If the registers have been configured properly, the
code will be trapped in the ISR.
21. Modify the configuration file Lab.cdb to setup the PIE vector for the watchdog
interrupt. Click on the plus sign (+) to the left of Scheduling and again on the plus
sign (+) to the left of HWI – Hardware Interrupt Service Routine
Manager. Click the plus sign (+) to the left of PIE INTERRUPTS. Locate the
interrupt location for the watchdog. Right click, select Properties, and type
_WAKEINT_ISR (with a leading underscore) in the function field. Click OK and save
all updates.
Build and Load
22. Save all changes to the files and click the “Build” button. Then reset the DSP, and
then “Go Main”.
Run the Code – Watchdog Interrupt
23. Place the cursor in the “main loop” section, right click the mouse key and select
Run To Cursor.
24. Run your code. Where did your code stop? Are the results as expected? If things went
as expected, your code should stop at the “ESTOP0” instruction in the WAKEINT ISR.
End of Exercise
Note: By default, the watchdog timer is enabled out of reset. Code in the file
CodeStartBranch.asm has be configured to disable the watchdog. This can be
important for large C code projects (ask your instructor if this has not already been
explained). During this lab exercise, the watchdog was actually re-enabled (or disabled
again) in the file SysCtrl.c.