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
.
Содержание C28 Series
Страница 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Страница 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Страница 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Страница 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Страница 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Страница 275: ...Appendix eZdsp F2812 eZdsp F2812 Connector Header and Pin Diagram C28x Appendix A eZdsp F2812 A 3 ...
Страница 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Страница 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Страница 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Страница 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Страница 281: ...Appendix JP7 JP8 JP11 JP12 Boot Mode Select JP9 PLL Disable DS1 DS2 LEDs C28x Appendix A eZdsp F2812 A 9 ...
Страница 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...