User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 525
www.energymicro.com
Table 20.1. TIMER Counter Response in X2 Decoding Mode
Channel A
Channel B
Rising Falling
0 Increment Decrement
1 Decrement Increment
Figure 20.8. TIMER X2 Decoding Mode
Channel A
Channel B
CNT
3 4 5 6 7
8
34567 28
20.3.1.6.2 X4 Decoding Mode
In X4 Decoding mode, the counter increments or decrements on every edge of Channel A and Channel
B, see Figure 20.9 (p. 525) and Table 20.2 (p. 525) .
Table 20.2. TIMER Counter Response in X4 Decoding Mode
Channel A Channel BOpposite Channel
Rising Falling Rising Falling
Channel A = 0 Decrement Increment
Channel A = 1 Increment Decrement
Channel B = 0 Increment Decrement
Channel B = 1 Decrement Increment
Figure 20.9. TIMER X4 Decoding Mode
Channel A
Channel B
34567891011
3 4 5 6 7 8 9
10
11
2
2
CNT
20.3.1.6.3 TIMER Rotational Position
To calculate a position Equation 20.1 (p. 525) can be used.
TIMER Rotational Position Equation
pos° = (CNT/X x N) x 360° (20.1)
where X = Encoding type and N = Number of pulses per revolution.
20.3.2 Compare/Capture Channels
The Timer contains 3 Compare/Capture channels, which can be configured in the following modes:
1. Input Capture
2. Output Compare