Lab 5: System Initialization
Run the Code – Watchdog Reset
9. Place the cursor on the first line of code in
main()
and set a breakpoint by right
clicking the mouse key and select
Toggle breakpoint.
Notice that line is
highlighted with a red dot indicating that the breakpoint has been set.
10. Single-step your code into the
“main loop”
section and watch the lines of code
execute. If you don’t want to see each line execute, place the cursor in the
“main
loop”
section (on the
asm(“ NOP”);
instruction line) and right click the mouse key
and select
Run To Cursor
. This is the same as setting a breakpoint on the selected
line, running to that breakpoint, and then removing the breakpoint.
11. Run your code for a few seconds by using the <F5> key, or using the
Run
button on the
vertical toolbar, or using
Debug Run
on the menu bar. After a few seconds halt
your code by using Shift <F5>, or the Halt button on the vertical toolbar. Where did your
code stop? Are the results as expected? If things went as expected, your code should be
in the
“main loop”
.
12. Modify the
InitSysCtrl()
function to enable the watchdog (WDCR). This will
enable the watchdog to function and cause a reset. Save the file and click the
“Build”
button. Then reset the DSP by clicking on
Debug Reset CPU
. Under
Debug
on
the menu bar click
“Go Main”
.
13. Place the cusor in the
“main loop”
section, right click the mouse key and select
Run To Cursor
.
14. Run your code. Where did your code stop? Are the results as expected? If things went
as expected, your code should stop at the breakpoint.
Setup PIE Vector for Watchdog Interrupt
The first part of this lab exercise used the watchdog to generate a CPU reset. This was tested
using a breakpoint set at the beginning of
main()
. Next, we are going to use the watchdog
to generate an interrupt. This part will demonstrate the interrupt concepts learned in the
previous module.
15. Add the following files to the project:
PieCtrl_5_6_7_8_9.c
DefaultIsr_5_6_7.c
Check your files list to make sure the files are there.
16. In
Main_5.c
, add code to call the
InitPieCtrl()
function. There are no passed
parameters or return values, so the call code is simply:
InitPieCtrl();
17. Using the “PIE Interrupt Assignment Table” shown in the previous module find the
location for the watchdog interrupt,
“
WAKEINT
”
.
C28x - System Initialization
5 - 17
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...