![](http://datasheet.mmic.net.cn/390000/PD784976A_datasheet_16826985/PD784976A_95.png)
95
CHAPTER 4 PORT FUNCTIONS
User
’
s Manual U15017EJ2V0UD
4.3 Port Function Control Registers
The following two types of registers control the ports.
Port mode registers (PM2, PM4 to PM6)
Pull-up resistor option registers (PUO, PU2)
(1) Port mode registers (PM2, PM4 to PM6)
These registers are used to set port input/output in 1-bit units.
PM2 and PM4 to PM6 are independently set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets these 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. Pins P00 to P03 and P10 to P17 are input pins.
2. Pins P100 to P107 are output pins.
3. Pins P64, P65, and P67 also function as external interrupt request inputs. If they are not
used as interrupt input pins, set the external interrupt rising edge enable register (EGP0)
and external interrupt falling edge enable register (EGN0) to
“
Interrupt Disable.
”
Or, set
the interrupt mask flags (PMKn where n = 0 to 2) to 1. Otherwise, the interrupt request
flag is set when the port function is placed in output mode and its output level is changed,
leading to inadvertent interrupt servicing.
Table 4-3. Port Mode Register and Output Latch Setting When Alternate Function Is Used
Pin Name
Alternate Function
PM
××
P
××
Pin Name
Alternate Function
PM
××
P
××
Function Name
Input/output
Function Name
Input/output
P20
TI00
Input
1
×
P60
SI1
Input
1
×
P25
SI0/R
X
D0
Input
1
×
P61
SO1
Output
0
0
P26
SO0/T
X
D0
Output
0
0
P62
SCK1
Input/output
1/0
×
/0
P27
SCK0
Input/output
1/0
×
/0
P63
TIO50
Input/output
1/0
×
/0
ASCK0
Input
1
×
P64
INTP0
Input
1
×
P55
SI2
Input
1
×
P65
INTP1
Input
1
×
P56
SO2
Output
1
0
P66
TIO51
Input/output
1/0
×
/0
P57
SCK2
Input/output
1
×
/0
P67
INTP2
Input
1
×
Cautions 1. The setting of PM27 and PM62 varies depending on the clock selected by bits 1 and 0 (SCLn1
and SCLn0) of serial operation mode register n (CSIMn).
Internal clock (SCLn1, SCLn0
≠
0, 0): 0
External clock (SCLn1, SCLn0 = 0, 0): 1
Set SCK2 of the
μ
PD784975A to PM
××
= 1 (input) regardless of the setting of the internal or
external clock.
2. Because the P64, P65, and P67 pins function alternately as external interrupt request inputs,
if the output level is changed by setting the port function to output mode, the interrupt request
flag is set. To use output mode, therefore, be sure to preset the interrupt mask flag to 1.
3. When the pins of these ports are being used for an alternate function, executing a read
instruction for these ports results in undefined data being read.
Remark
×
:
PM
××
: Port mode register
P
××
:
Port output latch
don
’
t care