CHAPTER 4 PORT FUNCTIONS
User’s Manual U18172EJ2V0UD
59
(1) Port mode registers (PM2 to PM4)
These registers are used to set the corresponding port to the input or output mode in 1-bit units.
Each port mode register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
When a port pin is used as an alternate-function pin, set its port mode register and output latch as shown in
Table 4-3.
Caution Because P21 and P32 are also used as external interrupt pins, the corresponding interrupt
request flag is set if each of these pins is set to the output mode and its output level is
changed. To use the port pin in the output mode, therefore, set the corresponding interrupt
mask flag to 1 in advance.
Figure 4-8. Format of Port Mode Register
Address: FF22H, After reset: FFH, R/W
Symbol
7 6 5 4 3 2 1 0
PM2
1 1 1 1
PM23
PM22
PM21
PM20
Address: FF23H, After reset: FFH, R/W
Symbol
7 6 5 4 3 2 1 0
PM3
1 1 1 1 1
PM32
1 1
Address: FF24H, After reset: FFH, R/W
Symbol
7 6 5 4 3 2 1 0
PM4
1
Note
1
Note
1
Note
1
Note
PM43
1
Note
1
Note
PM40
PMmn
Selection of I/O mode of Pmn pin (m = 2 to 4; n = 0 to 3)
0
Output mode (output buffer ON)
1
Input mode (output buffer OFF)
Note
At program initialization, set PM41, PM42, and PM44 to PM47 to "0".