Rev. 5.00, 09/03, page 423 of 760
13.3.3
Reading the Time
Figure 13.3 shows how to read the time. If a carry occurs while reading the time, the correct time
will not be obtained, so it must be read again. Part (a) in figure 13.3 shows the method of reading
the time without using interrupts; part (b) in figure 13.3 shows the method using carry interrupts.
To keep programming simple, method (a) should normally be used.
Write 0 to CF in RCR1
Note: Set AF to 1 so that alarm
flag is not cleared.
Clear CIE in RCR1 to 0
Read RCR1 and check CF
Write 0 to CIE in RCR1
Carry flag = 1?
No
Yes
Clear the carry flag
Disable the carry
interrupt
Read counter
register
Write 1 to CIE in RCR1,
and write 0 to CF in RCR1
Note: Set AF in RCR1 to 1 so that
alarm flag is not cleared.
Interrupt
generated?
No
Yes
Enable the carry
interrupt
Clear the carry flag
Disable the carry
interrupt
Read counter
register
To read the time
without using interrupts
b. To use interrupts
a.
Figure 13.3 Reading the Time
Содержание SH7709S
Страница 2: ......
Страница 44: ...Rev 5 00 09 03 page xliv of xliv ...
Страница 62: ...Rev 5 00 09 03 page 18 of 760 ...
Страница 128: ...Rev 5 00 09 03 page 84 of 760 ...
Страница 146: ...Rev 5 00 09 03 page 102 of 760 ...
Страница 224: ...Rev 5 00 09 03 page 180 of 760 ...
Страница 246: ...Rev 5 00 09 03 page 202 of 760 ...
Страница 266: ...Rev 5 00 09 03 page 222 of 760 ...
Страница 370: ...Rev 5 00 09 03 page 326 of 760 ...
Страница 432: ...Rev 5 00 09 03 page 388 of 760 ...
Страница 532: ...Rev 5 00 09 03 page 488 of 760 ...
Страница 598: ...Rev 5 00 09 03 page 554 of 760 ...
Страница 630: ...Rev 5 00 09 03 page 586 of 760 ...
Страница 656: ...Rev 5 00 09 03 page 612 of 760 ...
Страница 684: ...Rev 5 00 09 03 page 640 of 760 ...
Страница 700: ...Rev 5 00 09 03 page 656 of 760 ...
Страница 758: ...Rev 5 00 09 03 page 714 of 760 ...
Страница 807: ...SH7709S Group Hardware Manual REJ09B0081 0500O ADE 602 250C ...