![](http://datasheet.mmic.net.cn/30000/MB90662APFM_datasheet_2367560/MB90662APFM_103.png)
2.4 Multi-Function Timer
98
Chapter 2: Hardware
(4) Output Compare Buffer Transfer Control
While the timer is stopped, values are transferred to the output compare register simultaneously
as they are written to the buffer register.
While the timer is operating, transfers from the compare buffer register to the output compare
register are controlled by the buffer mode select bits (BFS0,1) in the CMCR register, which
select either compare-match or zero-detect transfer mode.
The BFS1 bit selects the buffer mode for compare channels 1 to 3, and the BFS0 bit selects the
buffer mode for compare channel 0.
When a compare-match event causes data to be transferred from the buffer to the output compare
register, the value in the buffer register corresponding to the channel on which the match
occurred is transferred to the output compare register on the next count following the count on
which the match occurred.
Fig. 2.4.9 Compare Buffer Transfer Operation (1)
If zero-detect transfer mode is selected and the zero-detect buffer transfer mask select bit
(TMSK) is set to 0B, then the buffer register value will be transferred to the output compare
register whenever the timer count reaches 0000H.
Also, if the zero-detect buffer transfer mask select bit (TMSK) is set to ‘1’B, the value from the
buffer register will be transferred to the output compare register only at zero-detect events when
a zero-detect interrupt is generated (after the zero detect mask count has been terminated).
Note, however, that no transfer will occur when the count value is 0000H immediately after
startup (including restarts).
Fig. 2.4.10 Compare Buffer Transfer Operation (2)
[CAUTION]
The initial value of the output comapre register is indeterminate. If the timer is
running without setting a value in the output fcompare register, the MB90660A chip
will be comparing the count to an initially indeterminate value.
Timer value
Compare register value
Buffer register value
3
Compare Buffer Transfer: After a Compare-Match Event
4
5
2
1
Match signal
6
7
2
6
0
6
Buffer register overwritten
Timer value
Compare register value
Buffer register value
1
Compare Buffer Transfer: After a Zero-Detect Event
0
X
1
Re-write
Clear timer
2