10
10-162
MULTIJUNCTION TIMERS
10.8 TOU (Output-Related 24-Bit Timer)
32180 Group User’s Manual (Rev.1.0)
The TOU counters operate as a 24-bit down-counter when in single-shot output, delayed single-shot output or
continuous output mode. After the timer is enabled (by writing to the enable bit in software or upon occurrence of
the event selected by the TOU enable source select bit), the counter starts counting synchronously with the
count clock. Bits 8–15 and bits 16–31 are the 8 high-order and the 16 low-order bits of the counter, respectively.
Bits 0–7 are ignored.
When writing to the counter separately in high and low-order bits, rewrite the 8 high-order bits first and then the
16 low-order bits. The 8 high-order bits become effective when the 16 low-order bits are rewritten. If the counter
is rewritten in the reverse order beginning with the 16 low-order bits, the value of the 8 high-order bits is not
reflected until the next time the 16 low-order bits are rewritten. If the 8 high-order bits are read before the CPU
has finished rewriting the 16 low-order bits after rewriting the 8 high-order bits. The read value shows the
previous data (when not counting) or the current count of the previous data (when count is in progress), and not
the new rewritten data. If the counter is written to in 32-bit units, it is rewritten successively in order of the 8 high-
order bits and then the 16 low-order bits automatically.
During PWM output or single-shot PWM output mode, the TOU counters operate as a 16-bit down-counter
where only the 16 low-order bits are effective. For details, see Section 10.8.5, Paragraph (2), “TOU counters
during PWM output and single-shot PWM output modes.”
To read the counter on-the-fly, make sure the read timing does not coincide with an underflow of the 16 low-
order bits (8 high-order bits decremented). When reading the counter on-the-fly, take the appropriate measure
to ensure that the read value is correct by, for example, reading the counter twice in succession.
Figure 10.8.3 Example of How to Read the Counter Value
Count clock
Counter value
Lower counter read
Upper counter read
Read value (first time)
FF 0000
FE FFFF
FE FFFE
FF FFFF
Read value is incorrect
Smaller of the two (Note 1)
FE FFFF
Read value (second time)
Correct value
Note 1: If the counter underflows, the 8 high-order bits become 'FF' and the read value cannot be
guaranteed to be correct. Check the count enable bit to see if count is in progress as necessary.
Notes: • In cases where the count clock is significantly fast compared with the read interval, read also
the lower counter twice as necessary.
• If interrupt processing, etc. occurs while reading the counter, the read value cannot be guaranteed
to be correct. Therefore, disable interrupts during read.
Содержание M32R/ECU Series
Страница 17: ...12 This page is blank for reasons of layout...
Страница 18: ...CHAPTER 1 OVERVIEW 1 1 Outline of the 32180 Group 1 2 Block Diagram 1 3 Pin Functions 1 4 Pin Assignments...
Страница 712: ...CHAPTER 18 OSCILLATOR CIRCUIT 18 1 Oscillator Circuit 18 2 Clock Generator Circuit...
Страница 794: ...CHAPTER 22 TYPICAL CHARACTERISTICS...
Страница 795: ...22 22 2 32180 Group User s Manual Rev 1 0 TYPICAL CHARACTERISTICS To be written at a later time...
Страница 796: ...APPENDIX 1 MECHANICAL SPECIFICAITONS Appendix 1 1 Dimensional Outline Drawing...
Страница 798: ...APPENDIX 2 INSTRUCTION PROCESSING TIME Appendix 2 1 32180 Instruction Processing Time...
Страница 802: ...APPENDIX 3 PROCESSING OF UNUSED PINS Appendix 3 1 Example Processing of Unused Pins...