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

Setting up watch dog for PIC16F18857

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



Joined: 08 Mar 2017
Posts: 40

View user's profile Send private message

Setting up watch dog for PIC16F18857
PostPosted: Wed Jul 12, 2017 12:02 pm     Reply with quote

Doubt how to config watchdog for pic16f18857. In PIC configuration has other parameter to setup, WDT_WINDOW_PERCENT that I am not sure what setup.
Idea is to set watchdog to reset each 4SEC . CCS V5.071.
The test program below should print ”RESET” after approx 4 sec…but the result is printing only “running”…does anyone have any idea what could be ?
Code:

#include <16F18857.h>
#use delay(crystal=20M)
#FUSES NOBROWNOUT
#FUSES NOLVP
#FUSES WDT
#FUSES NOPPS1WAY
#FUSES STVREN
#FUSES NOMCLR

void main()
{
setup_wdt(WDT_ON |WDT_4S | WDT_WINDOW_100_PERCENT |WDT_CLK_31000);
printf ("RESET\r\n ");
while(TRUE)
  {
   delay_ms(500);
   printf ("running\r\n ");
  }
}
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