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

PIC16F630 and wake-up from sleep

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



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PIC16F630 and wake-up from sleep
PostPosted: Mon Mar 31, 2008 2:12 am     Reply with quote

Hi to all,

I use PIC16F630 with it's internal oscillator in remote controller. I wake-up PIC with interrupt on change of RA port and all work fine. In this first step WDT isn't enabled. I need now to introduce a function were I need to wake up PIC every fix time, for example 3 seconds. I understand I cannot use timer because I don't use external oscillator but can I enable and disable WDT during execution of program ?
Have you got any suggestion to solve problem ?

Regards,
Fabri
Matro
Guest







PostPosted: Mon Mar 31, 2008 2:48 am     Reply with quote

You can enable your watchdog just before sleep instruction. In that way the PIC will wake-up when watchdog will overflow.
After wake-up you can turn off the watchdog for the rest of the code.
But be aware that teh watchdog frequency is very very variable according to temperature and some other parameters.

Matro.
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Mon Mar 31, 2008 3:39 am     Reply with quote

Hi,

Which way can I use to write config register in normal flow of program ?

I read in datasheet and Microchip says:
"Address 2007h is beyond the user program memory space. It belongs to the special configuration memory space (2000h - 3FFFh),
which can be accessed only during programming."

Regards,
Fabri
Ttelmah
Guest







PostPosted: Mon Mar 31, 2008 4:35 am     Reply with quote

You don't.
You enable the watchdog, in the configuration bits, then just ensure that it is reset regularly in your code, till you get to where you want to sleep. Reset it immediately before you go to sleep, and the chip will wake up, when it triggers.
On these chips, there is no separate watchdog enable. Once it is enabled in the configuration, it is 'on'.

Best Wishes
Matro
Guest







PostPosted: Mon Mar 31, 2008 5:12 am     Reply with quote

Since the chip you have chosen has no soft En/Dis-able bit for watchdog, the only way is to make it run every time. And to clear it regularly in your code to avoid a time-out reset.
I thought a sof bit was available. That's why i wrote that you can stop it.
But actually you can't.

Matro.
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