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

setup_wdt() on different CCS version

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



Joined: 19 Oct 2011
Posts: 12

View user's profile Send private message

setup_wdt() on different CCS version
PostPosted: Mon Feb 06, 2012 12:47 pm     Reply with quote

At the very beginning, I use CCS v4.032.
and I can handle a period wake up by using the following code


Code:

#include <16F88.h>
#FUSES INTRC, WDT, NOPROTECT ,NOLVP, NOBROWNOUT
#use delay(clock=8000000)

void main()
{
….………..
……………
setup_wdt(WDT_ON|WDT_18MS);
while(1)
{
 output_high(LED);
 delay_ms(2);
 output_high(LED);
 delay_ms(2);

 sleep();

 delay_ms(2);
}
}



But now I use the same code in CCS v4.057, my PIC16 can not wake up.
I have tried the following two solutions, but none of them work.

1)
Code:

#include <16F88.h>
#FUSES INTRC, NOWDT, NOPROTECT ,NOLVP, NOBROWNOUT
#use delay(clock=8000000)

void main()
{
….………..
……………
setup_wdt(WDT_ON|WDT_18MS); //watchdog setup to wake up PIC periodically
while(1)
{
 output_high(LED);
 delay_ms(2);
 output_high(LED);
 delay_ms(2);

 sleep();

 delay_ms(2);

}
}


2)
Code:

#include <16F88.h>
#FUSES INTRC, WDT, NOPROTECT ,NOLVP, NOBROWNOUT
#use delay(clock=8000000)

void main()
{
….………..
……………
setup_wdt(WDT_18MS); //watchdog setup to wake up PIC periodically
while(1)
{
 output_high(LED);
 delay_ms(2);
 output_high(LED);
 delay_ms(2);

 sleep();

 delay_ms(2);
}
}


Does anyone have the same problem and how to solve it? 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