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

Turning on the WDT for PIC18F66J60

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



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

Turning on the WDT for PIC18F66J60
PostPosted: Sun Jul 28, 2013 5:19 am     Reply with quote

Greetings! I have a problem with the WDT.
Here is my program:
Code:

#include <18F66J60.h>
#FUSES HS,WDT,WDT128
#use delay(clock=10M)

void main()
{
   setup_wdt(WDT_ON);
   int p=RESTART_CAUSE();
   while(1)
   {
      delay_ms(100);
      delay_ms(100);
      delay_ms(100);
   }
}

I tested this program with the MPLAB SIM and in real. The result - the WDT doesn`t restart the microcontroller. In the SIM I receive a message for WDT event but there is no restart - the program continues from the while cycle! What am I doing wrong?!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 28, 2013 4:00 pm     Reply with quote

This is an MPLAB issue which you should ask on the Microchip forum,
but anyway I'll give you a hint. Go to the Debugger/Settings menu
and look at the Break Options tab and then look at WDT Timeout settings.
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