|
|
View previous topic :: View next topic |
Author |
Message |
dazlogan
Joined: 19 Oct 2003 Posts: 24 Location: Cambridge, UK
|
The application |
Posted: Sat Apr 10, 2004 4:41 am |
|
|
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?
Regards,
Darren |
|
|
dazlogan
Joined: 19 Oct 2003 Posts: 24 Location: Cambridge, UK
|
|
Posted: Sat Apr 10, 2004 4:42 am |
|
|
sorry, the above was supposed to be a reply to my PIC12F629 thread!
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Apr 10, 2004 1:19 pm |
|
|
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. |
|
|
|
|
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
|