English
Language : 

M16C28 Datasheet, PDF (314/423 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/Tiny SERIES
M16C/28 Group (M16C/28, M16C/28B)
17. Programmable I/O Ports
• Example of INT5 Digital Debounce Function (if P17DDR = "0316")
f8
P17
Data Bus
Digital Debounce Filter
Clock
Port In
Signal Out
Reload Value
(write)
Count Value
(read)
To INT5
Data Bus
f8
Reload Value
Port In
Signal Out
Count Value
FF
FF
1
03
03 02 01
2
3
03 02 01 00 FF
4
5
Reload Value
03
FF
(continued)
Port In
(continued)
Signal Out
(continued)
Count Value
(continued)
FF
03 02 01 00
FF
6
7
03 02 FF
8
9
1. (Condition after reset). P17DDR=FF16. Pin input signal will be output directly.
2. Set the P17DDR register to "0316". The P17DDR register starts decrement along the f8 as a counter source, if the pin input level (e.g.,"L")
and the signal output level (e.g.,"H") are not matched.
3. The P17DDR register will stops counting when the pin input level and the signal output level are matched (e.g., both levels are "H") while
counting.
4. If the pin input level (e.g.,"L") and the signal output level (e.g.,"H") are not matched the P17DDR register will start decrement again after the
setting value is reloaded.
5. When the P17DDR register is underflow, it stops counting and the signal output will output the same as pin input level (e.g."L").
6. If the pin input level (e.g.,"H") and the signal output level (e.g., "L") are not matched again, the P17DDR register will start decrement again
after the setting value is reloaded.
7. When the P17DDR register is underflow, it stops counting and the signal output will output the same as pin input level (e.g."H").
8. If the pin input level (e.g.,"H") and the signal output level (e.g., "L") are not matched again, the P17DDR register will start decrement again
after the setting value is reloaded.
9. Set the P17DDR register to "FF16". The P17DDR register starts counting after the setting value is reloaded. Pin input signal will be output
directly.
Figure 17.12 Digital Debounce Filter
Rev. 2.00 Jan. 31, 2007 page 294 of 385
REJ09B0047-0200