View previous topic :: View next topic |
Author |
Message |
Amin
Joined: 19 Feb 2004 Posts: 15
|
WDT problem with 16F88 |
Posted: Sun Feb 27, 2005 6:49 pm |
|
|
I have issues setting the WDT
I used this
#fuses WDT ,HS, NOMCLR, BROWNOUT, NOLVP
.
.
.
.
.
switch ( restart_cause() )
{
case WDT_TIMEOUT:
{ printf("\r\nRestarted processor because of watchdog timeout!\r\n");
break;}
case NORMAL_POWER_UP:
{ printf("\r\nNormal power up!\r\n");
break; }
}
setup_counters (RTCC_INTERNAL, WDT_2304MS);
setup_adc_ports(VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_counters(RTCC_INTERNAL,RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
and
tried also setup_wdt(XXX);
and
the WDT keeps restarting the thing.
Thanks for the help _________________ McMaster Solar Car Project
http://www.solarcar.mcmaster.ca |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Feb 27, 2005 7:07 pm |
|
|
Do you want the watchdog timer to be running ?
If not, use the NOWDT fuse.
If you do want it running, then you have to periodically
restart it with the restart_wdt() function, otherwise the
watchdog will timeout and will reset your PIC.
Look at the CCS example file, EX_WDT.C to see how
to do this. |
|
|
Amin
Joined: 19 Feb 2004 Posts: 15
|
|
Posted: Sun Feb 27, 2005 8:06 pm |
|
|
Thanks
I need it running and Yeah I was doing that (restart_wdt);
but It wasn't even getting close to that.
But I figured what the problem is
for the record for
for 16F88 I used
setup_counters (RTCC_INTERNAL, WDT_576MS); _________________ McMaster Solar Car Project
http://www.solarcar.mcmaster.ca |
|
|
|