I need help since i can not get the watchdog timer to work on a PIC24HJ256GP610 and 610A
here is my code to understand, on explorer 16 board :
-> normal running before watchdog time out -> Led 0 is blinking to say that RCONbits.WDTO is 0
-> After reset, -> Led 1 should blink to say that RCONbits.WDTO is 1 ! but it never happens !!!! ????
Any idea ?
here is my code :
_FOSCSEL( FNOSC_FRC ); // Fast RC oscillator
_FOSC( FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_XT );
_FWDT( FWDTEN_OFF & WINDIS_OFF & WDTPRE_PR32 & WDTPOST_PS1024 ); // Watchdog Timer
_FICD( JTAGEN_OFF & ICS_PGD1 );
Led0TrisPin = 0; // LedPin is an Output
Led1TrisPin = 0; // LedPin is an Output
RCONbits.SWDTEN = 1; // Enable WatchDog Timer !
if ( RCONbits.WDTO )
RCONbits.SWDTEN = 0;
while(1) // so blink Led for ever !
while (1) // Test function of Watchdog
sleep1ms(10); // Watchdog should not Time Out