RonHackett
Member
In an earlier thread I stumbled on the fact that enablebod and disablebod are actually inverted in the 28X1, which Technical confirmed and said would be fixed in the next software release (see http://www.picaxeforum.co.uk/showthread.php?t=9551).
I'm still working on ways to reduce power consumption in the 28X1, and I have again stumbled on another mystery (I stumble a lot!), this time related to the hibernate command (and probably not unrelated to the BOD inversion).
I have a simple circuit: LED on output 7, switch on ULPWU input (as per p.55 in the manual) and all unused inputs tied low.
In an attempt to measure current consumption during hibernation, I tried the following code:
Upon reset, I measure 247uA after the LED blinks (which is what I would expect if the 28X1 is starting up with BOD disabled), and 0.1uA during the hibernation (which is pretty amazing if it's accurate!).
However, every subsequent iteration yields 326uA after the LED blinks (which makes sense if hibernate enables BOD when it exits), but (surprisingly) 133uA during hibernation. My guess is that somehow BOD never gets disabled again during hibernation, which is a mystery to me because I thought hibernate automatically disables BOD upon entry.
To see if I could force a "disablebod", I tried inserting an "enablebod" (go figure!) just before the hibernation, but all current measurements stay the same - so I'm stumped again.
To make matters even more confusing, the above code produces similar results at all internal resonator speeds I tried (of course, with higher currents at higher speeds), EXCEPT at 31k. In that case, it really gets strange - the LED never lights, and the supply current is a constant 108uA.
That result is mind-boggling, to say the least - I have no idea if the program is running or hibernating!
If anyone can shed any light on all this I would be eternally grateful, and if there is a bug in the hibernate command (related to the BOD inversion?), I hope it's also easily fixable in a software update.
I'm still working on ways to reduce power consumption in the 28X1, and I have again stumbled on another mystery (I stumble a lot!), this time related to the hibernate command (and probably not unrelated to the BOD inversion).
I have a simple circuit: LED on output 7, switch on ULPWU input (as per p.55 in the manual) and all unused inputs tied low.
In an attempt to measure current consumption during hibernation, I tried the following code:
Code:
main:
setfreq k125
high 7 ; blink LED
pause 50 ; (make longer for higher freqs)
low 7
pause 250 ; allow time to check supply current
hibernate 1 ; stay here until manual wake-up switch is pressed
goto main
However, every subsequent iteration yields 326uA after the LED blinks (which makes sense if hibernate enables BOD when it exits), but (surprisingly) 133uA during hibernation. My guess is that somehow BOD never gets disabled again during hibernation, which is a mystery to me because I thought hibernate automatically disables BOD upon entry.
To see if I could force a "disablebod", I tried inserting an "enablebod" (go figure!) just before the hibernation, but all current measurements stay the same - so I'm stumped again.
To make matters even more confusing, the above code produces similar results at all internal resonator speeds I tried (of course, with higher currents at higher speeds), EXCEPT at 31k. In that case, it really gets strange - the LED never lights, and the supply current is a constant 108uA.
That result is mind-boggling, to say the least - I have no idea if the program is running or hibernating!
If anyone can shed any light on all this I would be eternally grateful, and if there is a bug in the hibernate command (related to the BOD inversion?), I hope it's also easily fixable in a software update.