Clear RCR1.CIE to 0
Disable carry interrupts
Clear RCR1.CF to 0
(Write 1 to RCR1.AF so that alarm flag
is not cleared)
Clear carry flag
Read counter register
Yes
Carry flag = 1?
No
Read RCR1 register and check CF bit
(a) Reading time without using interrupts
Clear carry flag
Set RCR1.CIE to 1
Enable carry interrupts
Clear RCR1.CF to 0
(Write 1 to RCR1.AF so that alarm flag
is not cleared)
Clear carry flag
Read counter register
Yes
Interrupt generated?
No
Clear RCR1.CIE to 0
Disable carry interrupts
(b) Reading time using interrupts
Figure 11.3 Examples of Time Reading Procedures
If a carry occurs while the time is being read, the correct time will not be obtained and the read
must be repeated. The procedure for reading the time without using interrupts is shown in (a), and
the procedure using carry interrupts in (b). The method without using interrupts is normally used
to keep the program simple.
Rev. 6.0, 07/02, page 287 of 986