CHAPTER 4 PORT FUNCTIONS
Preliminary User’s Manual U19014EJ1V0UD
76
4.3 Registers Controlling Port Function
Port functions are controlled by the following three types of registers.
•
Port mode registers (PM0, PM1, PM3, PM6, PM12)
•
Port registers (P0, P1, P3, P6, P12)
•
Pull-up resistor option registers (PU0, PU1, PU3, PU12)
(1) Port mode registers (PM0, PM1, PM3, PM6, and PM12)
These registers specify input or output mode for the port in 1-bit units.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
When port pins are used as alternate-function pins, set the port mode register by referencing
4.5 Settings of
Port Mode Register and Output Latch When Using Alternate Function
.
Figure 4-15. Format of Port Mode Register
7
1
Symbol
PM0
6
1
5
1
4
1
3
1
2
1
1
PM01
0
PM00
Address
FF20H
After reset
FFH
R/W
R/W
PM17
PM1
PM16
PM15
PM14
PM13
PM12
PM11
PM10
FF21H
FFH
R/W
1
1
1
1
1
PM3
1
1
1
PM33
PM32
PM31
PM30
FF23H
FFH
R/W
PM6
1
1
PM61
PM60
FF26H
FFH
R/W
1
PM12
1
1
1
1
PM122
PM121
PM120
FF2CH
FFH
R/W
PMmn
Pmn pin I/O mode selection
(m = 0, 1, 3, 6, 12; n = 0 to 7)
0
Output mode (output buffer on)
1
Input mode (output buffer off)
electronic components distributor