![](http://datasheet.mmic.net.cn/30000/M30260M3A-XXXGP-U5_datasheet_2358673/M30260M3A-XXXGP-U5_226.png)
16. Programmable I/O Ports
page 212
8
2
3
f
o
5
0
2
,
5
1
.
r
a
M
0
.
1
.
v
e
R
0
1
0
-
2
0
2
0
B
9
0
J
E
R
)
T
6
2
/
C
6
1
M
,
A
6
2
/
C
6
1
M
(
p
u
o
r
G
A
6
2
/
C
6
1
M
16.4 Port Control Register
Figure 16.4.1 shows the port control register.
When the P1 register is read after setting the PCR0 bit in the PCR register to “1”, the corresponding port
latch can be read no matter how the PD1 register is set.
16.5 Pin Assignment Control register (PACR)
Figure 16.5.1 shows the PACR. After reset set the PACR2 to PACR0 bit before you input and output it to
each pin. When the PACR register isn’t set up, the input and output function of some of the pins doesn’t
work.
PACR2 to PACR0 bits: control the pins enabled for use.
At reset these bits equal “000”.
When using the 48 pin version of the M16C/26A and the 48 pin version of the M16C/26T set these
bits to “1002”.
When using the 42 pin version of the M16C/26A set these bits to “0012”.
U1MAP: controls the assignment of UART1 pins.
If the U1MAP bit is set to “0” (P67 to P64) the UART1 functions are mapped to P64/CTS1/RTS1,
P65/CLK1, P66/RxD1, and P67/TxD1.
If the U1MAP bit is set to “1” (P73 to P70) the UART1 functions are mapped to P70/CTS1/RTS1,
P71/CLK1, P72/RxD1, and P73/TxD1.
PACR is write protected by PRC2 bit in the PRCR register. PRC2 bit must be set immediately before the
write to PACR.
16.6 Digital Debounce function
Two digital debounce function circuits are provided. Level is determined when level is held, after applying
either a falling edge or rising edge to the pin, longer than the programmed filter width time. This enables
noise reduction.
________
_______ _____
This function is assigned to INT5/INPC17 and NMI/SD. Digital filter width is set in the NDDR register and
the P17DDR register respectively. Additionally, a digital debounce function is disabled to the port P17
input and port P85 input. Figure 16.6.1 shows the NDDR register and the P17DDR register.
Filter width :
f8
× 1 / (n+1)
n: count value set in the NDDR register and P17DDr register
The NDDR register and the P17DDR register decrement count value with f8 as the count source. The
NDDR register and the P17DDR register indicate count time. Count value is reloaded if a falling edge or
a rising edge is applied to the pin.
The NDDR register and the P17DDR register can be set 0016 to FF16 when using the digital debounce
function. Setting to FF16 disables the digital filter. See Figure 16.6.2 for details.