CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

WDT problem with 16F88

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Amin



Joined: 19 Feb 2004
Posts: 15

View user's profile Send private message

WDT problem with 16F88
PostPosted: Sun Feb 27, 2005 6:49 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Feb 27, 2005 7:07 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Feb 27, 2005 8:06 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group