Chapter 9
16-bit Timer
Up/Down Counting IX - 49
■ Setting Up/Down Counting (1-fold, 2-phase encoding)
Select “1-fold and 2-phase encoding” by the timer count clock source selection of the timer mode register
(TMnMD). The binary counter counts up at the rising edge of the TMnBIN pin when the TMnAIN pin is set to
“1” and counts down at the falling edge as indicated in the following table. When the TMnAIN pin is “L”, count-
ing is not operated. When “1-fold and 2-phase encoding” is set, The TMUD1-0 flag of the TMnMD register is set
to “00” to specify up counting.
Table:9.6.3 Operation Condition of 1-fold, 2-phase encoding
■ Setting Up/Down Counting (4-fold, 2-phase encoding)
Select “4-fold and 2-phase encoding” by the timer count clock source selection of the timer mode register
(TMnMD). The counting up/down condition is as shown in the following table. When “4-fold and 2-phase encod-
ing” is set, the TMUD1-0 flag of the TMnMD register is set to “00” to specify up counting.
Table:9.6.4 Setting Condition of 4-fold, 2-phase encoding
■ Setting Up/Down Counting (Count Clock)
The binary counters counts up or down by the condition of the input pin at the timing of the count clock.
Select “10, or “11” by the timer up/down selection of the timer mode register (TMnMD). The counting up/down
condition is as shown in the following table.
Table:9.6.5 Operation Condition of Count Clock
TMnAIN pin
TMnBIN pin
↑↓
"H" Up counting Down counting
"L" - -
TMnAIN pin
TMnBIN pin
"H" "L" ↑↓
"H" - - Up counting Down counting
"L" - - Down counting Up counting
↑ Down counting Up counting - -
↓ Up counting Down counting - -
TMnAIN pin
At count clock timing
TMUD1 to 0 flag (TMnMD register)
10 11
"H" Up counting
Down counting
"L"
Down counting
Up counting