sleep/underclocking question

gengis

New Member
It is my understanding from reading the archives, that if I "poke $8F,%01000000" I slow the clock from 4 to 1 MHZ and this saves a bit of power, and I can expect nap, pause and sleep to be multiplied by a factor of four?

first part of my 14M program
b5=0 'reset picture count
low 1 'Pin 12 shutter low
pause 1000 'allow caps time to charge
poke $8F,%01000000 'Set clock to 1 MHz
pause 5 'allow clock to stabilize
goto start

I went in and divided all my pause settings by 4 and the program behaves the same as it did before the clock speed change. BUT my sleep command is about 4 times too short! Went from four minutes to one minute.

I tweaked it in software and multiplied the variable controlling the sleep by 4 times and it is back to normal.

My sleep variable is set by an adc so I suppose the adc could also be affected by timing, is that possible?
 

hippy

Ex-Staff (retired)
PAUSE will be affected but SLEEP and NAP have their timing controlled by the 31kHz oscillator so will not be affected.
 

gengis

New Member
I was debating whether to amend my original post because I did find the statement in the archives about sleep and nap NOT BEING effected by clock speed - what I'm experiencing is it is speeding up by a factor of ~four. So it is, or seems to be, affecting it, but not in the way I originally expected it to.
 

hippy

Ex-Staff (retired)
That does seem odd. Maybe try a simple loop with a SLEEP, a TOGGLE for a LED and nothing else to see what effect switching to low speed before entering the loop has ?
 
Top