Rev. 1.0, 03/99, page 177 of 209
c. Ports R1, R2, and R3 are 4-bit I/O ports, accessed in units of 4 bits. Each of ports R1 to R3
are accessed in 4-bit units using the output commands (LRA and LRB) to control the
output level High/Low. The output data is stored in the port data registers (PDR) of the
respective pins. The input commands (LAR and LBR) are used for 4-bit access to read the
pin levels.
d. Table 3 describes the functions of the R1, R2, and R3 ports.
Table 3
Functions of R1, R2, and R3 Ports
Data Control Register R1 (DCR1)
Function
DCR1 switches the I/O pin function of the R1 port. When any bit of DCR1 is cleared
to “0”, the output buffer (CMOS) of the corresponding pin is turned OFF and the
output is set to high impedance. When the respective bit of DCR1 is set to “1”, the
output buffer of the corresponding pin is set ON and the corresponding PDR value is
output.
Data Control Register R2 (DCR2)
Function
DCR2 switches the I/O pin function of the R2 port. When any bit of DCR2 is cleared
to “0”, the output buffer (CMOS) of the corresponding pin is turned OFF and the
output is set to high impedance. When the respective bit of DCR2 is set to “1”, the
output buffer of the corresponding pin is set ON and the corresponding PDR value is
output.
Data Control Register R3 (DCR3)
Function
DCR3 switches the I/O pin function of the R3 port. When any bit of DCR3 is cleared
to “0”, the output buffer (CMOS) of the corresponding pin is turned OFF and the
output is set to high impedance. When the respective bit of DCR3 is set to “1”, the
output buffer of the corresponding pin is set ON and the corresponding PDR value is
output.
Port Data Register (PDR)
Function
The I/O pins of the R ports have built-in PDRs to store the output data. When the LRA
and LRB commands are executed, the contents of the accumulator (A) and B register
(B) are transferred to the PDR of the specified R port. When the corresponding DCR
of the R port is “1”, the output buffer of the appropriate pin is set ON and the value in
the PDR is output via that pin. The PDR is initialized to $F at a reset.
A/D Mode Register 1 (AMR1)
Function
AMR1 is a 4-bit write-only register. Bits AMR13 to AMR10 switch the functions of the
ports dual-function pins.