Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

generate 10 minute delay in power down mode

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
hamedhamedi

Bascom Member



Joined: 12 Feb 2012
Posts: 70

PostPosted: Sun Dec 07, 2014 9:15 pm    Post subject: generate 10 minute delay in power down mode Reply with quote

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
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2473
Location: Queensland

australia.gif
PostPosted: Mon Dec 08, 2014 3:15 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2117

netherlands.gif
PostPosted: Mon Dec 08, 2014 11:48 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
hamedhamedi

Bascom Member



Joined: 12 Feb 2012
Posts: 70

PostPosted: Mon Dec 08, 2014 2:35 pm    Post subject: Reply with quote

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
View user's profile
cored

Bascom Member



Joined: 13 Aug 2008
Posts: 10
Location: Tallinn

estonia.gif
PostPosted: Mon Dec 08, 2014 3:38 pm    Post subject: Reply with quote

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
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2473
Location: Queensland

australia.gif
PostPosted: Mon Dec 08, 2014 9:43 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1198
Location: SYDNEY

australia.gif
PostPosted: Mon Dec 08, 2014 11:05 pm    Post subject: Reply with quote

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
View user's profile
hamedhamedi

Bascom Member



Joined: 12 Feb 2012
Posts: 70

PostPosted: Tue Dec 09, 2014 11:11 am    Post subject: Reply with quote

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
View user's profile
cored

Bascom Member



Joined: 13 Aug 2008
Posts: 10
Location: Tallinn

estonia.gif
PostPosted: Tue Dec 09, 2014 3:39 pm    Post subject: Reply with quote

You can also look into 74HC4060 / CD4060BC
Can somebody suggest a very low power logic family?
Back to top
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2473
Location: Queensland

australia.gif
PostPosted: Wed Dec 10, 2014 12:10 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
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
You cannot attach files in this forum
You cannot download files in this forum