Mitsubishi Electric M32R Series User Manual page 356

Mitsubishi 32-bit risc single-chip microcomputers
Table of Contents

Advertisement

10
(2) Correction function of TOP single-shot output mode
If you want to change the counter value during operation, write a value to the TOP correction
register, the value by which you want to be increased or reduced from the initial count set in the
counter. To add, write the value you want to add to the correction register directly as is; to
subtract, write the two's complement of the value you want to subtract to the correction register.
Correction of the counter is performed synchronously with a clock period next to the one in which
the correction value was written to the TOP correction register. In this case, one down-count in
the clock period during which the correction was performed is canceled. Therefore, note that the
counter value actually is corrected by (correction register value + 1).
For example, if the initial counter value is 7 and you write a value 3 to the correction register when
the counter has counted down to 3, then the counter underflows after a total of 12 counts.
Count clock
Prescaler delay
Enable
Counter
Reload
7
register
Interrupt
Note 1: What you actually see in the cycle immediately after reload is the
Note 2: This diagram does not show detail timing information.
Figure 10.3.11 Example of Counting in TOP Single-shot Output Mode When Count is
Corrected
Count value =(7+1)+(3+1)=12
1
2
3
4
(Note 1)
(7)
6
5
4
Correction
register
previous counter value, and not 7.
10.3 TOP (Output-related 16-bit Timer)
5
6
7
8
6
5
4
3
+3
3
10-86
MULTIJUNCTION TIMERS
9
10
11
12
3
2
1
0
Underflow
H'FFFF
Ver.0.10

Advertisement

Table of Contents
loading

Table of Contents