View previous topic :: View next topic |
Author |
Message |
hamedhamedi
Joined: 12 Feb 2012 Posts: 70
|
Posted: Sun Dec 07, 2014 9:15 pm Post subject: generate 10 minute delay in power down mode |
|
|
Hi
I want to generate a 10 minute delay in power down mode. the total power consumption is very critical, so i dont want to use 1 second delay using async timer2.
Any idea?
Thanks
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Mon Dec 08, 2014 3:15 am Post subject: |
|
|
Use one of the 16 bit timers ( usually timer 1 ) and the highest prescaler value to give the longest possible interrupt time. Then count interrupts from that to set a delay up near 10 minutes.
Note that you will have to leave the processor clock and a timer running, which in itself draws some power.
You can improve this by using a low frequency crystal ( eg 32768 Hz ) and switch to that crystal as processor clock for the long delay, then switch back to the normal processor speed as you need. Some processors have alternate inputs for an RTC clock, which you can use for this.
You will probably get lower total power consumption by using an external clock chip, and setting its alarm function to wake up the processor from its deepest sleep mode at the correct delay. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
Posted: Mon Dec 08, 2014 11:48 am Post subject: |
|
|
With the timer2 in async mode you can get max a delay of 8 sec with a CLK/1024
What mcu are you using? If you need really low power then the choice of the cpu and the setup is more important. Switching off all the peripherals save more power.
Every second (or 8 ) waking up from sleep to increase a counter and going back to sleep doesn't consume that much power.
I have made a device that run 1,5year on a Cr2032 doing this. _________________ www.evertdekker.com Bascom code vault |
|
Back to top |
|
|
hamedhamedi
Joined: 12 Feb 2012 Posts: 70
|
Posted: Mon Dec 08, 2014 2:35 pm Post subject: |
|
|
Thank you AdrianJ and Evert.
I use Atmega64. and i search for other cpu but i need 8 interrupt that can handle just with atmega64. my circuit also consist of an lcd and 1 schmit trigger,so i should take care about power consumption.
if you have any other choise for cpu or other choice to lowering power consumption it will be very useful for me.
Regards |
|
Back to top |
|
|
cored
Joined: 13 Aug 2008 Posts: 10 Location: Tallinn
|
Posted: Mon Dec 08, 2014 3:38 pm Post subject: |
|
|
There are some real time clock chips with alarm function (e.g. M41T81SM6F). You could connect its alarm pin to AVR interrupt pin to wake it up. Or you can connect the RTC alarm pin to a voltage regulator enable pin and power off/on the AVR and several peripherals. |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Mon Dec 08, 2014 9:43 pm Post subject: |
|
|
AtMega64 has several different low power modes. Read about them in the Power Management section of the Atmel datasheet, and compare power consumption for the various modes in the Electrical Characteristics, DC Characteristics section.
You can also use the Watchdog timer to produce an interrupt, independent of the timers, and count watchdog timeouts to get long delays.
It depends on your power budget and required timing accuracy as to which of the many options you use. There is no general recommendataion, as it depends too much on what you are trying to achieve. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Mon Dec 08, 2014 11:05 pm Post subject: |
|
|
Hello hamedhamedi
As others have said the lowest power consumption will be with one of the dedicated clock chips
If as you say power consumption is critical then why not use the alarm output of the clock chip
via a FET to turn on the device you are building then have the cpu turn off the power
then no power is consumed
Run the clock chip off its own battery which will last for years.
Regards Paul |
|
Back to top |
|
|
hamedhamedi
Joined: 12 Feb 2012 Posts: 70
|
Posted: Tue Dec 09, 2014 11:11 am Post subject: |
|
|
Hi
thank you for your reply
the accuracy of timing is not important. just i should get a sample from adc per 10 minute.
about watchdog use,it use same power consumption of timer0 in atmega64 in async mode with power down microcontroller, except when watchdog reset the microcontroller all variable of program set to zero that is not good!
also maximum time of watchdog is 2 second.in compare to timer0 in async mode it produce less time.
about the timing ic like "M41T81SM6F", i search to buy it ,but i do not found it in my location.
just another question:
can i use timer0 of atmega64 in ascync mode with external clock?
my idea is to use a low power schmit trigger as oscilator runing in 1khz or less,then get its output pulse to timer0,after overflow of timer0 with 1024 prescale,the microcontroller wakeup and check the adc and go to powerdown again.
thanks. |
|
Back to top |
|
|
cored
Joined: 13 Aug 2008 Posts: 10 Location: Tallinn
|
Posted: Tue Dec 09, 2014 3:39 pm Post subject: |
|
|
You can also look into 74HC4060 / CD4060BC
Can somebody suggest a very low power logic family? |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Wed Dec 10, 2014 12:10 am Post subject: |
|
|
Yes you can certainly use a low power oscillator to feed the clock input directly, just set the fuses to that mode, so the processor knows to use the external input as a clock. The AtMega64 already has inputs for 32KHz clock crystal, separate from the normal crystal clock, which you can use too.
I think you will find that the power will not be as low as you can get with a specialised clock chip, designed for that purpose. There are many such chips, Dallas make several, as well as many other manufacturers.
Look around on suppliers like Element14, Digikey, Mouser, also the hobby people like Sparkfun and Pololu. They all deal internationally. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
|