CHAPTER 12 PORT FUNCTIONS
548
User’s Manual U15195EJ5V0UD
Port Name
Pin Name
Port Function
Function in Control Mode
Block Type
Port 0
P00 to P05
6-bit input
NMI input
Timer/counter output stop signal input
External interrupt input
A/D converter (ADC) external trigger input
Timer 3 output stop signal input
E
Port 1
P10 to P12
3-bit I/O
Timer/counter I/O
External interrupt input
B, K
Port 2
P20 to P27
8-bit I/O
Timer/counter I/O
External interrupt input
B, K, L
Port 3
P30 to P34
5-bit I/O
Serial interface I/O (UART0, UART1/CSI1)
A, C, F, G, H
Port 4
P40 to P42
3-bit I/O
Serial interface I/O (CSI0)
A, C, J
Port DH
PDH0 to PDH5
6-bit I/O
External address bus (A16 to A21)
N
Port DL
PDL0 to PDL15
16-bit I/O
External address/data bus (AD0 to AD15)
M
Port CT
PCT0 PCT1,
PCT4, PCT6
4-bit I/O
External bus interface control signal output
I
Port CM
PCM0, PCM1
2-bit I/O
Wait insertion signal input
Internal system clock output
D, I
Cautions 1. When switching to the control mode, be sure to set ports that operate as output pins or I/O
pins in the control mode using the following procedure.
<1> Set the inactive level for the signal output in the control mode in the corresponding bits
of port n (n = 0 to 4, CM, CS, CT, DH, and DL).
<2> Switch to the control mode using the port n mode control register (PMCn).
If <1> above is not performed, the contents of port n may be output for a moment when
switching from the port mode to the control mode.
2. When port manipulation is performed by a bit manipulation instruction (SET1, CLR1, or
NOT1), perform byte data read for the port and process the data of only the bits to be
manipulated, and write the byte data after conversion back to the port.
For example, in ports in which input and output are mixed, because the contents of the
output latch are overwritten to bits other than the bits for manipulation, the output latch of
the input pin becomes undefined (in the input mode, however, the pin status does not
change because the output buffer is off).
Therefore, when switching the port from input to output, set the output expected value to the
corresponding bit, and then switch to the output port. This is the same as when the control
mode and output port are mixed.
3. The state of the port pin can be read by setting the port n mode register (PMn) to the input
mode regardless of the settings of the PMCn register. When the PMn register is set to the
output mode, the value of the port n register (Pn) can be read in the port mode while the
output state of the alternate function can be read in the control mode.