CHAPTER 4 PORT FUNCTIONS
Preliminary User’s Manual U16315EJ1V0UD
98
4.3 Registers Controlling Port Function
Port functions are controlled by the following three types of registers.
•
Port mode registers (PM0, PM1, PM3, PM6, PM7, PM12, PM14)
•
Pull-up resistor option registers (PU0, PU1, PU3, PU7, PU12, PU14)
•
Input switch control register (ISC)
(1) Port mode registers (PM0, PM1, PM3, PM6, 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-19. Format of Port Mode Register
7
1
Symbol
PM0
6
1
5
1
4
1
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
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
1
0
PM140
FF2EH
FFH
R/W
PMmn
Pmn pin I/O mode selection
(m = 0, 1, 3, 6, 7, 12, 14; n = 0 to 7)
0
Output mode (output buffer on)
1
Input mode (output buffer off)