You are on page 1of 3

24Hour Clock Using Counters

There are three counters used in the following application to count the time.

24Hour Clock Using Counters

24Hour Clock Using Counters


This small program starts working the instant the PC is put into run. The key
to its operation is based on the special auxiliary device M8013. This device
provides an oscillating 1 sec pulse. By associating the counter C000 with this
clock pulse, the number of elapsed seconds can be counted. If this count is
reset at 60 events then the position within the current minute will be known. To
enable this cycle to operate continuously the counter C000 actually resets itself
on completion of its 60 counts.
If the number of times C000 resets is counted by a second counter the number
of elapsed minutes will be known.
Therefore following the same logic as before but using C001 to count the
minutes and one step further using C002 to count the hours completes a full
independent clock. The time is simply read directly from the 3 counters. A 24
hour clock can be made by making the set value of C002 equal to 24 or a
standard 12 hour clock can be operated when the set value is made equal to 12.

You might also like