08M time-of-day pgm /w IR remote

southernbob

New Member
The attached program(s) is my attempt to generate a time-of-day
source from a 08M Picaxe. The program uses a servo pulse on
leg 6 as a means of generating a "timer tick". This timer tick
occurring every 20 msec generates an interrupt. These interrrupts
are counted to form minutes then hours resulting in the
time-of-day. To set the correct time an IR remote is used.
The time is set by pressing 1 on the IR remote and then
entering 4 digits (HHMM) for the hours and minutes.
The program will then use that time. If the time is not set
by the remote the time will start out as 00:00. The initial
time can also be set by un-commenting the hour and minute
instuctions at the start of the program and putting in the
desired time before compiling and downloading.
Also, the program has provision for sending 2 option bytes
(entered by pressing channel UP or channel DOWN on the
IR remote) to the connected picaxe for 'what ever' use.
The circuit consists of a 08M with an IR receiver connected to
infrain . The time-of-day can be outputted to the 08M terminal
screen or send to another picaxe by means of a conditional
compile statement. See the program header for more details on
the program operation . The 2nd program is a bare-bones
program for receiving the time-of-day and then displaying
it on the terminal screen for that picaxe (set for a 18X).

The programs have a (.txt) file extension added so that they may
be viewed with a text reader such as NOTEPAD or saved
on your computer. The (.txt) can be deleted before use in the
picaxe editor. Ignore the warning message from Windows
about changing the file extension.
 

Attachments

KMoffett

Senior Member
Southernbob,

For long term timing, like hours, the 08M's internal clock is not very accurate. If you need a cheap, accurate pulse generator to update your counter, you could use a hacked, battery wall clock. With two OR'ing diodes you get 1 second pulses.

http://www.josepino.com/circuits/index?one_second_timebase.jpc

Though he used a 1K resistor to reduce the voltage, I've found that I could still trigger a 08M's input but replacing it with a 1 Meg dropping resistor...drawing only 2uA from the 5v supply. Also, I've found some clock modules that are on metal frames (his was on a PCB), that can be cut down for a very small size (see attached).

Good work.

Ken
 

Attachments

Last edited:

southernbob

New Member
Ken, thanks for the site. I found an old clock and took it apart but the circuit board didn't
look anything like on the site or your picture. It must not be crystal controlled as it has a small coil on the board that sits between two rotating magnets. I have another one that I took apart awhile ago so will try and find that.

This program was more of a programming exercise than anything; learning more about using an IR remote, using interrupts, sending data to another picaxe, and conditional compiles.

I ran it for 3 hours and it was pretty accurate but there are better ways of keeping time.

Bob
 

premelec

Senior Member
Sometimes the crystals are embedded and the pulses to the coils may come out alternating in polarity - but the current drain is miniscule and the units cheap so these are great for slow accurate timing pulses...
 
Top