Low power consumption + interrupts

212

Senior Member
I'm an old dog trying to learn new tricks...and having a blast doing so. Even though this forum is a tremendous help to me (thank you), I'm learning at a pretty slow pace anyway. I have however learned to use an interrupt, and have been able to get low power consumption using disablebod and sleep. What I am working right now needs to be low power for battery use, and needs to use an interrupt too. I have read many pages of good info, but have not found how to accomplish this feat. Can someone please help out an old man with this please :) (turning 50 this month)

Oh yeah...08M chip :)
 
Last edited:

Brietech

Senior Member
Could you provide some details about your specific application? We might be able to offer a few suggestions
 

krypton_john

Senior Member
Do I understand correctly that you want the PICAXE to go into a low power state and do nothing at all until the interrupt arrives? How about powering off the chip altogether and having this 'interrupt' signal power it back on? If that suits, then there are a few threads on the forum on the subject of self powering down and powering up PICAXEs.
 

hippy

Ex-Staff (retired)
Interrupt cannot happen during sleep, but what can be done is to go into low power, low speed operation to minimise current draw and use interrupts as one would at full speed. It will take longer to respond to the interrupt but should work. Once in the interrupt routine, full speed operation can be selected.

Nap or Sleep can be used as well if even lower power is needed but the time between checking for interrupts will increase. You lose the maximum ultra-low power target, but if the PICAXE is 90% asleep, 10% awake ( checks for interupt ) before sleeping again, it may still be good enough.
 

212

Senior Member
A lot of what I want to do with the picaxe does not need an immediate response, so the sleep works well. But some things include it being triggered by a PIR sensor, so speed is important, on that part. I have not tried "Nap" yet because I didn't want to wear out the chip checking for an event every few ms lol... I'll see what happens though, because it sure lowers the power.

And thanks for the reminder about the low speed, I have not tried that for size yet.
 

212

Senior Member
This seems to use about 40ua...hope it can work with a PIR trigger cause that's good enough for me. I'll try the slow speed next.

low 0
low 1
low 2
low 4
disablebod

main:
nap 0
if pin3 = 1 then light
goto main

light:
high 4
pause 1000
low 4
pause 1000
goto main
 

lbenson

Senior Member
Under suitable circuit conditions, the power drain of a pixaxe running at 31.25kHz is reputed to approximate the shelf discharge of batteries. See http://www.picaxeforum.co.uk/showthread.php?t=8353 for some details and references to other threads. As hippy points out, such a picaxe would be always ready to respond to an interrupt (tho slowly at first), and could be immediately switched to high-speed mode.
 

212

Senior Member
Thank you lbenson, I read that several times but never bookmarked it....now I did :)

This seems to use about 24ua, and I'm happier still. More things to try too...fun stuff :)

low 0
low 1
low 2
low 4
disablebod

main:
poke $8f,%00000000
if pin3 = 1 then light
goto main

light:

high 4
pause 10
low 4
pause 10
goto main
 
Top