848
Chapter 41 Up/Down Counter
5.Operation
5. Operation
This section describes each operation mode for Up/Down Counter.
5.1 Timer Mode CMS[1:0]=“00”
(1) An appropriate bit (Reload enable RLDE) is set.
(2) Up/Down Counter is cleared (“0” is written to CGSC).
(3) The software activates Up/Down Counter.
(4) An underflow occurs.
(5) The reload value is reloaded to Up/Down Counter.
(6) The software clears the underflow flag.
(7) The software enables interrupts.
(8) Up/Down Counter counts down.
(9) An underflow occurs. (An interrupt request has been made.)
(10) The software clears the underflow flag.
(11) Repeat (8) to (10).
CLKS, RLDE
CGSC
CSTR
(1)
(2)
(8)
(7)
(6)
(5)
(4)
(3)
(3)
(9)
(9)
(10)
F
CLKP
divided by 2
F
CLKP
divided by 8
Reload value
Countdown
Interrupt
request
Reload value
Reload value
Interrupt request enabled
Underflow
(Interrupt request)
Cleared by
software
Cleared by
software
Cleared by
software