Figure 11.3 Examples Of Time Reading Procedures - Hitachi SH7751 Hardware Manual

Superh risc engine
Table of Contents

Advertisement

Disable carry interrupts
Read counter register
Yes
Enable carry interrupts
Read counter register
Yes
Disable carry interrupts
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 figure
11.3 (a), and the procedure using carry interrupts in figure 11.3 (b). The method without using
interrupts is normally used to keep the program simple.
Clear carry flag
Carry flag = 1?
No
(a) Reading time without using interrupts
Clear carry flag
Clear carry flag
Interrupt generated?
No
(b) Reading time using interrupts

Figure 11.3 Examples of Time Reading Procedures

Clear RCR1.CIE to 0
Clear RCR1.CF to 0
(Write 1 to RCR1.AF so that alarm flag
is not cleared)
Read RCR1 register and check CF bit
Set RCR1.CIE to 1
Clear RCR1.CF to 0
(Write 1 to RCR1.AF so that alarm flag
is not cleared)
Clear RCR1.CIE to 0
Rev. 3.0, 04/02, page 283 of 1064

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sh7751r

Table of Contents