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 CCS Technical Support

18F66J60`s WDT adjustment

 
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

18F66J60`s WDT adjustment
PostPosted: Sat Mar 08, 2014 9:53 am     Reply with quote

Greetings! I can't change the time interval of the wdt! It's always around 32 seconds. I'm using MPlab v8.91, CCS v4.134.
Here is my code:
Code:

#include <18F66J60.h>
#fuses HS
#fuses WDT,WDT512
#use delay(clock=10M)
void main()
{
   SETUP_WDT(WDT_ON);
   while(1)
   {
      delay_ms(32000);
   }
}

No matter the setting I choose (WDT1, WDT2 and so on) the time for reset doesn't change - 32 seconds. How to deal with this problem?
Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Sat Mar 08, 2014 10:20 am     Reply with quote

Is it actually resetting?.

If you are compiling through MPLAB, the default is to compile in 'debug' mode, and this turns off the watchdog...

Maybe the problem.
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PostPosted: Sat Mar 08, 2014 10:29 am     Reply with quote

I'm using the MPlab SIM and it returns wdt reset and resets the cpu!
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Sat Mar 08, 2014 12:12 pm     Reply with quote

This may be a bug with the sim.

Compile for release mode, and try in a real chip.

Though MPLAB sim, is 99% 'right', it is not 100%.

However the other possibility is that you may be setting the time to 32 seconds with your setup_wdt line. I don't think this is needed (you are setting the watchdog to 'on' in the fuses), and on some chips this line can set the time as well. If there are time options in the .h file for this command, try these, if you want the line. (not near the compiler at present).

Best Wishes
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PostPosted: Sun Mar 09, 2014 11:08 am     Reply with quote

I changed the compiler with newer version and it works fine now!
Thanks!
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