III PERIPHERAL BLOCK:
When OUTINVx = "0" (active high):
The timer outputs a low level until the counter becomes equal to the comparison data A set in the CRxA register. When the counter is incremented to the next value from the comparison data A, the output pin goes high and a comparison A interrupt occurs. When the counter becomes equal to the comparison data B set in the CRxB register, the counter is reset and the output pin goes low. At the same time a comparison B interrupt occurs.
When OUTINVx = "1" (active low):
The timer outputs a high level until the counter becomes equal to the comparison data A set in the CRxA register. When the counter is incremented to the next value from the comparison data A, the output pin goes low and a comparison A interrupt occurs. When the counter becomes equal to the comparison data B set in the CRxB register, the counter is reset and the output pin goes high. At the same time a comparison B interrupt occurs.
Setting clock output fine mode
By default (after an initial reset), the clock output signal changes at the rising edge of the input clock when CRxA[15:0] becomes equal to TCx[15:0].
In fine mode, the output signal changes according to CRxA[0] when CRxA[15:1] becomes equal to TCx[14:0].
When CRxA[0] is "0", the output signal changes at the rising edge of the input clock.
When CRxA[0] is "1", the output signal changes at the falling edge of the input clock a half cycle from the default setting.
Example) CRxA = 3, CRxB = 5
Input clock |
|
Counter value | 0 1 2 3 4 5 0 1 2 3 4 5 0 1 |
Comparison match A signal |
|
Comparison match B signal |
|
TMx output (when OUTINVx = "0") |
|
TMx output (when OUTINVx = "1") |
|
Figure 4.4 Clock Output in Fine Mode
As shown in the figure above, in fine mode the output clock duty ratio can be adjusted in the half cycle of the input clock. However, when the CRxA value is "0", the timer outputs a pulse with a
In fine mode, the maximum value of CRxB is 215 - 1 = 32,767 and the range of CRxA that can be set is 0 to (2
⋅CRxB - 1).
The fine mode is set by the following registers:
Timer 0 fine mode selection: SELFM0 (D6) /
Timer 1 fine mode selection: SELFM1 (D6) /
Timer 2 fine mode selection: SELFM2 (D6) /
Timer 3 fine mode selection: SELFM3 (D6) /
Timer 4 fine mode selection: SELFM4 (D6) /
Timer 5 fine mode selection: SELFM5 (D6) /
When "1" is written to the SELFMx bit, fine mode is set. At initial reset, the fine mode is disabled.
Precautions
1)If a same value is set to the comparison data A and B registers, a hazard may be generated in the output signal. Therefore, do not set the comparison registers as A = B.
There is no problem when the interrupt function only is used.
2)When using the output clock, set the comparison data registers as A ≥ 0 and B ≥ 1. The minimum settings are A = 0 and B = 1. In this case, the timer output clock cycle is the input clock ⋅ 1/2.
3)When the comparison data registers are set as A > B, no comparison A signal is generated. In this case, the output signal is fixed at the off level.
EPSON | S1C33L03 FUNCTION PART |