R01UH0092EJ0110 Rev.1.10
Page 183 of 807
Jul 31, 2012
M16C/64C Group
13. Programmable I/O Ports
13.3.5
Port Pi Register (Pi) (i = 0 to 10)
Data input/output to and from external devices is accomplished by reading and writing to the Pi register.
Each bit in the Pi register consists of a port latch to hold the output data and a circuit to read the pin
status.
For ports set to input mode, the input level of the pin can be read by reading the corresponding Pi
register, and data can be written to the port latch by writing to the Pi register.
For ports set to output mode, the port latch can be read by reading the corresponding Pi register, and
data can be written to the port latch by writing to the Pi register. The data written to the port latch is
output from the pin. Each bit in the Pi register corresponds to one port.
In memory expansion and microprocessor modes, the Pi register for the pins functioning as bus control
pins (A0 to A19, D0 to D15,
CS0
to
CS3
,
RD
,
WRL
/
WR
,
WRH
/
BHE
, ALE,
RDY
,
HOLD
,
HLDA
, and
BCLK) cannot be modified (writing a value has no effect).
Since P7_0, P7_1, and P8_5 are N-channel open drain ports, when set to 1, the pin status becomes
high-impedance.
When the CM04 bit in the CM0 register is 1 (XCIN-XCOUT oscillation function) and bits PD8_6 and
PD8_7 in the PD8 register are 0 (input mode), values of bits P8_6 and P8_7 in the P8 register are
undefined.
b7 b6 b5 b4
b1
b2
b3
b0
Bit Symbol
Bit Name
RW
Function
Pi_0
Port Pi_0 bit
The pin level of any I/O port which is set
to input mode can be read by reading the
corresponding bit in this register.
The pin level of any I/O port which is set
to output mode can be controlled by
writing to the corresponding bit in this
register.
0 : Low level
1 : High level
RW
Pi_1
Port Pi_1 bit
RW
Pi_2
Port Pi_2 bit
RW
Pi_3
Port Pi_3 bit
RW
Pi_4
Port Pi_4 bit
RW
Pi_5
Port Pi_5 bit
RW
Pi_6
Port Pi_6 bit
RW
Pi_7
Port Pi_7 bit
RW
Port Pi Register (i = 0 to 10)
Symbol
Address
Reset Value
P0 to P3
03E0h, 03E1h, 03E4h, 03E5h
XXh
P4 to P7
03E8h, 03E9h, 03ECh, 03EDh
XXh
P8 to P10
03F0h, 03F1h, 03F4h
XXh
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...