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

The application

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



Joined: 19 Oct 2003
Posts: 24
Location: Cambridge, UK

View user's profile Send private message Send e-mail

The application
PostPosted: Sat Apr 10, 2004 4:41 am     Reply with quote

Hi,

Thanks for your ideas so far.

The application is a simple timer, it must count for a period of 6 months and then let the user know 6 months has ellapsed by flashing an LED.

During the six months count, the LED will be off and no other components will be drawing power - just the PIC.

SO, can i use an external 32kHz crystal - put the PIC into sleep mode and wake on a Timer 1 interrupt??????. If so, how?

The 6 month accuracy doesn't need to be great. Take 6 months as being 366/2 days (183 days).
Tolerance on this is +/- 5 days.

Im wondering whether I do actually need to put the PIC to sleep. If not in sleep mode, then at 3V, 32kHz the data sheet says the PIC will draw 28uA worste case, Timer1 will draw 7uA worste case. Total = 35uA.
Am I right?

So, for a 200mAH CR2032, this means 200mA/35uA hours = 5714 hours

5714/24 = 238 days which is approx. 8 months which is pushing it a little.

I notice the mAH for a CR2032 is different from one manufacturer to another. Some are around the 250mAH which would give me around 10 months which is better.

So can I put pic to sleep and wake on interrupt?
Do you think the WDT will be accurate enough?

Confused


Regards,
Darren
dazlogan



Joined: 19 Oct 2003
Posts: 24
Location: Cambridge, UK

View user's profile Send private message Send e-mail

PostPosted: Sat Apr 10, 2004 4:42 am     Reply with quote

sorry, the above was supposed to be a reply to my PIC12F629 thread!

Embarassed
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 10, 2004 1:19 pm     Reply with quote

Well, you know, the old web search helps. http://www.google.com
Searching for this:
PIC Timer1 oscillator sleep int char
Gives this:
http://www.mindspring.com/~tcoonan/pwrmgr.c
This is CCS code. The part that may interest you are
his parameters for the setup_timer_1() function,
and his explanation.
He has tons of code that you don't need. He has
a small amount of ASM code, some of which applies
to the USART, which doesn't exist in your PIC.
So that's not really a problem.

I suggest that you make as small a demo program
as possible, and try to get that working first.

Also, AN580 and AN582 on the Microchip site contain
helpful information. The source code is in ASM, but
you can read the comments and look at what they're
doing, and translate it to C.

Above all, you, not us, must do this project.
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