HD404669 Series
51
R Port
The R port consist of 38 input/output pins and 3 input pins that can be addressed in groups of 4 bits. Data
can be input using the LAR and LBR instructions, and data can be output using the LRA and LRB
instructions. Output data is stored in the port data register for the corresponding pin.
The R port data control registers (DCR0 to DCR4 and DCR6 to DCRA: $030 to $034, and $036 to $03A)
are used to turn the R port output buffers on and off. The DCR registers are mapped to addresses in the
RAM area. (figure 29.)
The R0
0
to R0
4
port pins have shared functions as the external interrupt input pins
INT
1
to INT
4
. Port mode
register B (PMRB $024) is used to set these pins to their peripheral function usage. (figure 31.)
The R4
0
port pin has a shared function as the EVND peripheral function pin. Port mode register C (PMRC:
$025) bit 1 (PMRC1) is used to switch the function of this pin. (figure 32.)
The R3
1
and R3
2
port pins have shared functions as the TOC and TOD peripheral function pins. Timer
mode register C2 (TMC2: $014) bits 0 to 2 (TMC20 to TMC22) and timer mode register D2 (TMD2: $015)
are used to set these pins to their peripheral function usage. (figures 33 and 34.)
The R4
1
to R4
3
port pins have shared functions as the
SCK
1
, SI
1
, and SO
1
peripheral function pins. Serial
mode register 1A (SM1A: $005) bit 3 (SM1A3) and port mode register A (PMRA: $004) bits 0 and 1
(PMRA0 and PMRA1) are used to set these pins to their peripheral function usage. (figures 30 and 35.)
The R4
3
/SO
1
pin can be set to function as an NMOS open drain output with the output buffer off.
Miscellaneous register (MIS: $00C) bit 2 (MIS2) is used for this setting. (figure 37.)
The RD
0
and RD
1
port pins have shared functions as the COMP
0
and COMP
1
peripheral function pins. The
compare enable register (CER: $018) is used to set these pins to their comparator pin functions. (figure 36.)
Bit
Initial value
Read/Write
Bit name
3
—
—
Not used
2
—
—
Not used
0
0
W
PMRA0
1
0
W
PMRA1
PMRA0
0
1
R4
3
/SO
1
mode selection
R4
3
SO
1
Port mode register A (PMRA: $004)
PMRA1
0
1
R4
2
/SI
1
mode selection
R4
2
SI
1
Figure 30 Port Mode Register A (PMRA)