View previous topic :: View next topic |
Author |
Message |
Dickperez Guest
|
WDT non working on PIC16F777 (PCM Ver. 3.245) |
Posted: Tue Aug 18, 2009 5:02 pm |
|
|
I've not been able to make WDT to work (at the debugger level it never produces a Reset, however it compiles with no errors). Can you take a look and give a suggestion on what I'm doing wrong or missing to do? (I've just included the relevant program portions).
Thanks in advance.
Code: |
#include <16F777.H>
#fuses INTRC, WDT, NOPROTECT, PUT, NOBROWNOUT, MCLR,
#use delay(clock = 8000000)
.
.
.
void main()
{
// Inicializacion del procesador
switch ( restart_cause() )
{
case WDT_TIMEOUT:
{
goto reset1 ;
break;
}
case MCLR_FROM_RUN:
{
goto reset1 ;
break;
}
}
.
.
.
SETUP_WDT(WDT_576MS);
.
.
.
for (;;) {
RESTART_WDT();
all_program_functions()
}
} |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Aug 18, 2009 5:07 pm |
|
|
If you call restart_wdt() in your main loop, you won't get a WDT reset. |
|
|
Dickperez Guest
|
WDT non working on PIC16F777 (PCM Ver. 3.245) |
Posted: Tue Aug 18, 2009 5:12 pm |
|
|
I´ve also tried without the RESTART_WDT() command, and I got the same results.
Are there any reports of bugs for this MCU with the PCM version I´m using? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Aug 18, 2009 5:24 pm |
|
|
Quote: | at the debugger level it never produces a Reset, however it compiles with no errors). |
I noticed you're trying to run this test under the Debugger.
The Microchip ICD2 Help file says:
Quote: | Debugger Limitations
The Watchdog Timer (WDT) cannot be used when debugging. |
The CCS ICD-U40 will likely have the same limitation. |
|
|
|