Teensy 3.6 Watchdog Timer.

Status
Not open for further replies.

Elijahc99k

New member
Hi,
So far i have gather that the watchdog timer on the teensy 3.6 using arduino ide can be enabled. I haven't found however on how to disable it.

this is what I use to enable it.
noInterrupts();
//watchDog timer
WDOG_UNLOCK = WDOG_UNLOCK_SEQ1;
WDOG_UNLOCK = WDOG_UNLOCK_SEQ2;
delayMicroseconds(1); // Need to wait a bit..
WDOG_STCTRLH = 0x0001; // Enable WDG
WDOG_TOVALL = 200; // The next 2 lines sets the time-out value. This is the value that the watchdog timer compare itself to.
WDOG_TOVALH = 0;
WDOG_PRESC = 0; // This sets prescale clock so that the watchdog timer ticks at 1kHZ instead of the default 1kHZ/4 = 200 HZ
interrupts();

This is what I use to kick the dog.

noInterrupts();
WDOG_REFRESH = 0xA602;
WDOG_REFRESH = 0xB480;
interrupts()

However; when the run is finished I can't disable it.

Basic over view of my program. User Inputs testing variables. It Starts enabling the Watchdog timer. Then runs the desired time. Once the test completes I'm unable to disable the watch dog timer. I need the timer in case it freezes the program grabs the test parameter from the sd card and continues where it left off.
 
Status
Not open for further replies.
Back
Top