I am sorry to address this problem once again on this forum (although previous topic was in another sub forum) but it seems I am not able to solve this problem.
Namely, I use MINI-32 development board which has PIC32MX534F064H. I use HID Bootloader from MikroE and also MikroC for PIC32 (although the problem is the same when usin XC32 compiler).
So, whenever I want to clear watchdog timer MCU resets. Here is my test program:
Code: Select all
void main() {
AD1PCFG = 0xFFFF; // configure AN pins as digital
WDTCONSET = (1 << 15); // start watchdog timer
TRISD = 0; // set direction to be output
TRISG = 0; // set direction to be output
LATD = 0; // turn OFF the PORTD leds
LATG = 0; // turn OFF the PORTG leds
while (1) {
// WDTCONSET = 0x01; // kick the dog!!
DATA = ~DATA; // Toggle DATA LED
Wait(); // 1s pause
STAT = ~STAT; // Toggle STAT LED
Wait(); // 1s pause
}
}
If I move clearing of the watchdogtimer outside the while loop, it wont restart.
Additionally, windowed watchdog mode is disabled by default (cleared bit).
Could anybody provide some working example of watchdogtimer usage for this processor.
Thanks for your suggestions in advance.