CHAPTER 4 PORT FUNCTIONS
76
4.3 Port Function Control Registers
The following two types of registers control the ports.
Port mode registers (PM0, PM1, PM2, PM3, PM7, PM11, PM12)
Pull-up resistor option register (PUO)
(1) Port mode registers (PM0, PM1, PM2, PM3, PM7, PM11, PM12)
These registers are used to set port input/output in 1-bit units.
PM0, PM1, PM2, PM3, PM7, PM11, and PM12 are independently set with a 1-bit or 8-bit memory
manipulation instruction.
RESET input sets PM0 and PM7 to 1FH, other registers to FFH.
When a port pin is used as its alternate function pin, set the port mode register and the output latch according
to Table 4-3.
Cautions
1.
2.
3.
Pins P00 and P04 are input-only pins.
Pins P80 and P81, P90 to P97 and P100 to P107 are output only pins.
As port 0 has an alternate function as external interrupt request input, when the port
function output mode is specified and the output level is changed, the interrupt request
flag is set. When the output mode is used, therefore, the interrupt mask flag should be
set to 1 beforehand.
Table 4-3. Port Mode Register and Output Latch Setting when Alternate Function is Used
Pin Name
Alternate Function
PMxx
Pxx
Pin Name
Alternate Function
PMxx
Pxx
Function Name
Input/
Output
Function Name
Input/
Output
P00
INTP0
Input
1 (fixed)
None
P30 to P32
TO0 to TO2
Output
0
0
TI0
Input
1 (fixed)
None
P33, P34
TI1, TI2
Input
1
×
P01, P02
INTP1, INTP2
Input
1
×
P35
PCL
Output
0
0
P03
INTP3
Input
1
×
P36
BUZ
Output
0
0
CI0
Input
1
×
P110 to P117
FIP18 to FIP25
Output
0
0
P04
Note
XT1
Input
1 (fixed)
None
P120 to P127
FIP26 to FIP33
Output
0
0
P10 to P17
Note
ANI0 to ANI7
Input
1
×
Note
If a read is executed to these ports in the alternate function mode, the read data will be undefined values.
Caution
When Port 2 is used as serial interface pin, input/output and the output latch should be set
according to functions. For setting, refer to Figure 14-3. Serial Operating Mode Register 0
Format and Figure 15-3. Serial Operating Mode Register 1 Format.
Remark
×
: don't care
PMxx : Port mode register
Pxx
: Port output latch