forced reboot of SuperPro
Posted: Fri Dec 05, 2014 5:11 pm
I had a need to force the (near) equivalent of a hardware reset on the SuperPro. It doesn't directly support it by any means except a few of the interrupts. With a bit of niggling, I got this to work. Addresses might change on other NXP chips. I'm using the standard BASICTools poke equivalents.
Lloyd
#define WDMOD *&H40000000 ' watchdog mode register
#define WDFEED *&H40000008 ' watchdog timer feed register, must get an "AA" followed by a "55" to work
#define WDTC *&H40000004 ' watchdog timer timeout constant register
.
.
.
interrupt(0) ' turn off interrupts, so my local IRQs cannot interrupt our settings of the Watchdog timer
WDTC = &H000000FF ' set the time constant to the minimum
WDMOD = &H00000003 ' set the WDMOD register to enable interrupts and start the watchdog with WDEN and WDRESET true
WDFEED = &H000000AA ' poke the Watchdog timer feed register with the start of a feed command
WDFEED = &H00000055 ' finish the feed command. At LEAST ONE successful feed must occur to assert WDRESET
WDFEED = &H000000AA ' now start another feed, but this time,
WDTC = &H00000000 ' cause a fault interrupt by not completing it properly with a 0x55
interrupt(1) ' just on GPs to keep things balanced, not that it will have any effect, since a reset is occurring
Lloyd
#define WDMOD *&H40000000 ' watchdog mode register
#define WDFEED *&H40000008 ' watchdog timer feed register, must get an "AA" followed by a "55" to work
#define WDTC *&H40000004 ' watchdog timer timeout constant register
.
.
.
interrupt(0) ' turn off interrupts, so my local IRQs cannot interrupt our settings of the Watchdog timer
WDTC = &H000000FF ' set the time constant to the minimum
WDMOD = &H00000003 ' set the WDMOD register to enable interrupts and start the watchdog with WDEN and WDRESET true
WDFEED = &H000000AA ' poke the Watchdog timer feed register with the start of a feed command
WDFEED = &H00000055 ' finish the feed command. At LEAST ONE successful feed must occur to assert WDRESET
WDFEED = &H000000AA ' now start another feed, but this time,
WDTC = &H00000000 ' cause a fault interrupt by not completing it properly with a 0x55
interrupt(1) ' just on GPs to keep things balanced, not that it will have any effect, since a reset is occurring