English
Language : 

AN974 Datasheet, PDF (3/6 Pages) STMicroelectronics – Real time clock with ST7 Timer Output Compare
Real time clock with ST7 Timer Output Compare
These four counters are coded on one byte each and are updated by the Output Compare 1
interrupt routine as shown in Figure 2.
Figure 2. Software Counter Update Flowchart
OC1 INTERRUPT
UPDATE
OCxHR AND OCxLR
REGISTER
INCREMENT 100ms COUNTER
no 100ms CNT yes RESET 100ms COUNTER
= 10 ?
INCREMENT SECOND
COUNTER
no
yes RESET SECOND
SECOND CNT
COUNTER
= 60 ?
INCREMENT MINUTE
COUNTER
no
MINUTE CNT yes
= 60 ?
RESET MINUTE
COUNTER
INCREMENT HOUR
COUNTER
no
HOUR CNT yes RESET HOUR
= 24 ?
COUNTER
3/6