99 Minute Timer

Originally published on www.bhargavaz.net in year 2000.

There is a cute little appnote on using 12C508 to replace electromechanical timers. The appnote can be found on Microchip's site.

Get Appnote 1_001.pdf

It is a timer circuit that gives times up to 99 minutes. The hardware is slick but the code has too many bugs. I built the hardware with one display (Units) only. The software assembled with trivial warnings. Like, I had to replace RETURN with 'retlw 0'.

I plan to use this circuit with my home brewed EPROM eraser :-) I'm looking for an enclosure now.

The main problem with the code was improper timing and the one minute lag in turning relay on and off. The problem found was the code started counting TMR0 before the user started the timer. So the timer would display the value that user entered but counted from the middle.

When the user started the timer the relay would turn on after one minute of counting and turned off after one minute the timer stopped.

I have also modularized the code so that the parts may be reused. The modified code is here - timer.zip (no place to put on blogger - ask me in comments if you want it).
Here is the hexdump of the corrected code
:10000000680AE20103089F0825080D0899084908B5
:1000100041081F08010819086F006D006E0070008C
:10002000680069006A006B006C0000080E022D0079
:100030000602180E2E006E024D012F006F061005ED
:10004000F0058F063005F0050008000C2600180C9E
:1000500006006100430C020000081007360A100475
:10006000A802A6050A0C88014306680030073E0A6C
:100070003004A9020A0C890143066900090201093A
:100080003300080201093400090208014306A40AEA
:100090002B024307A40AFE0C740150096F0A0008E2
:1000A000100C3200740373030306580A0604590A3D
:1000B00006050000000026050000000026040000E0
:1000C0000000F202520A4605000046040604000839
:1000D0000C092509FA0C31001609F0076C0A110207
:1000E000810143076F0AFA0CF101AA02190C8A0177
:1000F00043076F0A6A00AB020A0C8B014307940A9C
:100100006B00AC023C0C8C014307940A6C00280283
:1001100043078E0A090C2800E9008F0AE80009024B
:1001200008014307940A9D0A16090B024306A60A12
:10013000050F43076F0A2D096F0AA604FE0C330052
:10014000340050090300680A50096F0A2D0950094C
:020150006F0A34
:021FFE000A00D7
:00000001FF

Comments