![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
Example description
This example shows how to use Windowed watchdog timer to generate interrupts to manage the watchdog timer. If the watchdog timer isn't 'fed' within it's window time, it will reset the device. The LED will toggle states on each watchdog feed event. You can also use a terminal program with the UART to select the feed event. If the feed is disabled, the chip will reset.
The example works in one of 3 ways. If '1' is selected, WDT is fed by the sysTick at 20Hz and should never time out (fast LED). If '2' is selcted, the WDT is fed by the watchdog window interrupt (slow LED). If '3' is selected, the watchdog times out and resets the device.
Special connection requirements
Build procedures:
LPC17xx/40xx example quickstart for Keil uVision4
LPC17xx/40xx example quickstart for IAR EWARM
LPC17xx/40xx example quickstart for Code Red Xpresso
Supported boards and board setup:
Embedded Artists' LPC1788 Developer's Kit
Embedded Artists' LPC4088 Developer's Kit
NXP Xpresso LPC1769 board
Submitting LPCOpen issues:
Community support for LPCOpen
Macros | |
| #define | FEED_ON_SYSTICKINT 0 |
| #define | FEED_ON_WARNINT 1 |
| #define | NO_FEED 2 |
Functions | |
| static void | wdt_handle (void) |
| void | WDT_IRQHandler (void) |
| watchdog timer Interrupt Handler | |
| void | SysTick_Handler (void) |
| SysTick Interrupt Handler. | |
| int | main (void) |
| Main entry point. | |
Variables | |
| static volatile int | wdtFeedState |
| static volatile bool | On = false |
| #define FEED_ON_SYSTICKINT 0 |
Definition at line 73 of file watchdog.c.
| #define FEED_ON_WARNINT 1 |
Definition at line 74 of file watchdog.c.
| #define NO_FEED 2 |
Definition at line 75 of file watchdog.c.
| int main | ( | void | ) |
Main entry point.
Main program body.
defined(CHIP_LPC175X_6X)
Definition at line 148 of file watchdog.c.
| void SysTick_Handler | ( | void | ) |
SysTick Interrupt Handler.
SysTick 1mS tick handler.
Definition at line 136 of file watchdog.c.
|
static |
defined(CHIP_LPC175X_6X)
Definition at line 89 of file watchdog.c.
| void WDT_IRQHandler | ( | void | ) |
watchdog timer Interrupt Handler
Definition at line 126 of file watchdog.c.
|
static |
Definition at line 78 of file watchdog.c.
|
static |
Definition at line 77 of file watchdog.c.