Hi,
Sometimes, when i start of stopping a play, the Teensy are into Watchdog / COP reset.
What is wrong,
Thanks.
The Watchdog reset function is:
unsigned long wdt_millis = 0;
void reset_watchdog() {
dma_watchdog_point = 3;
if (millis() > wdt_millis) {
wdt_millis = millis() + 250;
noInterrupts();
WDOG_REFRESH = 0xA602;
WDOG_REFRESH = 0xB480;
interrupts();
}
}
The Watchdog Start function is:
void start_watchdog() {
noInterrupts();
WDOG_UNLOCK = WDOG_UNLOCK_SEQ1; // unlock access to WDOG registers
WDOG_UNLOCK = WDOG_UNLOCK_SEQ2;
delayMicroseconds(1); // Need to wait a bit..
WDOG_TOVALL = 1000;
WDOG_TOVALH = 0;
WDOG_STCTRLH = (WDOG_STCTRLH_ALLOWUPDATE | WDOG_STCTRLH_WDOGEN |
WDOG_STCTRLH_WAITEN | WDOG_STCTRLH_STOPEN); // Enable WDG
interrupts();
}
Sometimes, when i start of stopping a play, the Teensy are into Watchdog / COP reset.
What is wrong,
Thanks.
The Watchdog reset function is:
unsigned long wdt_millis = 0;
void reset_watchdog() {
dma_watchdog_point = 3;
if (millis() > wdt_millis) {
wdt_millis = millis() + 250;
noInterrupts();
WDOG_REFRESH = 0xA602;
WDOG_REFRESH = 0xB480;
interrupts();
}
}
The Watchdog Start function is:
void start_watchdog() {
noInterrupts();
WDOG_UNLOCK = WDOG_UNLOCK_SEQ1; // unlock access to WDOG registers
WDOG_UNLOCK = WDOG_UNLOCK_SEQ2;
delayMicroseconds(1); // Need to wait a bit..
WDOG_TOVALL = 1000;
WDOG_TOVALH = 0;
WDOG_STCTRLH = (WDOG_STCTRLH_ALLOWUPDATE | WDOG_STCTRLH_WDOGEN |
WDOG_STCTRLH_WAITEN | WDOG_STCTRLH_STOPEN); // Enable WDG
interrupts();
}