|
|||||||||||
Technical Support Support Resources
Product Information |
C16x/ST10 Watchdog Timer Example ProgramThis example program shows you how to use the watchdog timer on the C16x family. To enable the watchdog timer, the startup code must be modified. By default, the startup code disables the watchdog timer so that users new to the C16x aren't required to handle watchdog resets. To enable the watchdog, look for the following section in the startup code (START167.A66) and set WATCHDOG to 1. //WATCHDOG: Disable Hardware Watchdog //--- Set WATCHDOG = 1 to enable the Hardware watchdog $SET (WATCHDOG = 1); The C program configures the watchdog timer in divide by 2 mode and sets the reload value to 128 (0x80). The _srvwdt_ function executes the srvwdt instruction which services the watchdog. The C program (after a while) stops servicing the watchdog timer and the program resets. A breakpoint is set on the reset vector to output Watchdog Reset and halt execution in the event of a watchdog timer reset. Refer to DEBUG.INI for the breakpoint and function that check the watchdog status. You may open the watchdog timer dialog from the peripherals menu to view the status of the watchdog. To run this example program:
C16X_WDOG.ZIP
(41K)
Wednesday, July 3, 2002 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.