CHAPTER 4 PORT FUNCTIONS
User’s Manual U16899EJ2V0UD
104
4.3 Registers Controlling Port Function
Port functions are controlled by the following three types of registers.
•
Port mode registers (PM0, PM1, PM3 to PM7, PM12, PM14)
•
Port registers (P0 to P7, P12 to P14)
•
Pull-up resistor option registers (PU0, PU1, PU3 to PU5, PU7, PU12, PU14)
(1) Port mode registers (PM0, PM1, PM3 to PM7, PM12, and PM14)
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 input sets these registers to FFH.
When port pins are used as alternate-function pins, set the port mode register and output latch as shown in Table
4-4.
Figure 4-21. Format of Port Mode Register
7
1
Symbol
PM0
6
PM06
5
PM05
4
PM04
3
PM03
2
PM02
1
PM01
0
PM00
Address
FF20H
After reset
FFH
R/W
R/W
7
PM17
PM1
6
PM16
5
PM15
4
PM14
3
PM13
2
PM12
1
PM11
0
PM10
FF21H
FFH
R/W
7
1
PM3
6
1
5
1
4
1
3
PM33
2
PM32
1
PM31
0
PM30
FF23H
FFH
R/W
7
1
PM4
6
1
5
1
4
1
3
PM43
2
PM42
1
PM41
0
PM40
FF24H
FFH
R/W
7
1
PM5
6
1
5
1
4
1
3
PM53
2
PM52
1
PM51
0
PM50
FF25H
FFH
R/W
7
1
PM6
6
1
5
1
4
1
3
PM63
2
PM62
1
PM61
0
PM60
FF26H
FFH
R/W
7
PM77
PM7
6
PM76
5
PM75
4
PM74
3
PM73
2
PM72
1
PM71
0
PM70
FF27H
FFH
R/W
7
1
PM12
6
1
5
1
4
1
3
1
2
1
1
1
0
PM120
FF2CH
FFH
R/W
7
1
PM14
6
1
5
1
4
1
3
1
2
1
1
PM141
0
PM140
FF2EH
FFH
R/W
PMmn
Pmn pin I/O mode selection
(m = 0, 1, 3 to 7, 12, 14; n = 0 to 7)
0
Output mode (output buffer on)
1
Input mode (output buffer off)