beautypg.com

3 registers controlling port function – NEC PD78F9488 User Manual

Page 91

background image

CHAPTER 4 PORT FUNCTIONS

User’s Manual U15331EJ4V1UD

91

4.3 Registers Controlling Port Function

The ports are controlled by the following three types of registers.

• Port mode registers (PM0 to PM3, PM5, PM8)
• Pull-up resistor option registers (PUB0 to PUB3)
• Port function registers (PF7, PF8) (

µPD78F9488, 78F9489 only)

(1) Port mode registers (PM0 to PM3, PM5, PM8)

Input and output can be specified in 1-bit units.
These registers can be set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets these registers to FFH.
When using the port pins as their alternate functions, set the port mode register and the output latch as
shown in Table 4-3.

Caution Because P30 to P33 function alternately as external interrupt inputs, when the output level

changes after the output mode of the port function is specified, the interrupt request flag
will be inadvertently set. Therefore, be sure to preset the interrupt mask flag (PMK0 to
PMK3) before using the port in output mode.

Figure 4-15. Port Mode Register Format

Symbol

7 6 5 4 3 2 1 0

Address

After

reset

R/W

PM0 PM07 PM06 PM05 PM04 PM03 PM02 PM01 PM00 FF20H

FFH R/W

PM1

1 1 1 1 1 1

PM11

PM10

FF21H

FFH

R/W

PM2 1

1 PM25 PM24 PM23 PM22 PM21 PM20 FF22H

FFH R/W

PM3 1

1

1 PM34 PM33 PM32 PM31 PM30 FF23H

FFH R/W

PM5

1 1 1 1

PM53

PM52

PM51

PM50

FF25H

FFH

R/W

PM8 PM87 PM86 PM85 PM84 PM83 PM82 PM81 PM80 FF28H

FFH R/W

PMmn

Pmn pin input/output mode selection

(m = 0 to 3, 5, 8, n = 0 to 7)

0

Output mode (output buffer on)

1

Input mode (output buffer off)

Remark PM8 can only be used when one of pins P80 to P87 is selected as a port function pin by a mask

option or port function register 8 (PF8).

This manual is related to the following products: