thereby change the operating speed of
the 08M processor. In fact, the 08M
can run at any one of the speeds
available to the 28X1 via its setfreq
command.
Figure 15 lists the values to place
in the OSCCON register for each of
the 08M’s possible operating speeds.
However, before you start
experimenting, it’s important to know
that this is not something to be
undertaken lightly. Accidentally
“poking” the wrong value and/or the
wrong special function register can
have unexpected results — including
crashing your program. Also, even
when the 08M’s operating speed is
changed correctly, it may no longer
respond to your trying to download an
updated program. If that happens,
powering down the 08M circuit,
initiating a new download, and then
re-powering the circuit should enable
the download to proceed normally.
It’s also important to remember
that most of the 08M’s time-sensitive
commands will operate proportionally
slower at lower resonator speeds. For
example, at 4 MHz, a pause 500
statement will (of course) take 500 mS
to complete; at 31 kHz the same
statement will take more than one
minute to complete! Finally, some
commands will not work at all; for
example, the infraout command only
functions at 4 MHz. So, if you want to
slow Tex down as an additional power-saving tactic, you will first need to
issue a setfreq m4 statement (or poke
the OSCCON register appropriately),
then issue the command, and then re-poke the OSCCON register to return
to the slower speed. I wrote a simple
program that does exactly that; if
you’re interested in experimenting
with it, you can also download from
the N&V website.
PICAXE PRIMER
consumption. At 4 MHz with BOD
enabled, it was approximately 840 µA;
at 31 kHz with BOD disabled, that
figure dropped to 135 µA — a savings
of about 700 µA or 0.7 mA.
In order to understand how
significant that difference may be, I
also measured the current draw of the
PIR module. When I moved in front of
it, the module drew about 140 µA;
with no motion, the current draw
dropped to about 120 µA. Of course,
the total current draw of the 08M and
the PIR module together is much
smaller than the 22 mA required to
drive the IR-LED, but that happens
only a very small percent of the time. I
suspect that the 08M current-saving
tactics may significantly increase
battery life. In order to find out for
sure, I intend to do some long-term
testing — I’ll keep you posted when
the results are in.
Okay, that’s it for this month. In
the meantime, if you do your own
testing of a battery-powered 08M
project, I would be very interested in
learning about your results. NV
August 2010 19