4-10 Chapter 4 I/O Ports
MB89190/190A series
4.2 Port 0
4.2.2 Explanation of Port 0 Operation
The operation of port 0 is explained.
T Operation of port 0
Output port operation
– When the corresponding bit of the DDR0 register is set to 1, the port becomes an output port.
– For the output port, the operation of the output transistor is enabled, and data of the output latch is
output to the pin.
– When data is written to the PDR0 register, data with it retained at the output latch is output to the
pin.
– When the PDR0 register is read, the value of the pin can be read.
Input port operation
– When the corresponding bit of the DDR0 register is set to 0, the port becomes an input port.
– For the input port, the output transistor is set to OFF and the pin is set to high impedance.
– When data is written to the PDR0 register, data is retained at the output latch, but is not output to
the pin.
– When the PDR0 register is read, the value of the pin can be read.
External interrupt input operation
– The bit of the DDR0 register that corresponds to the external interrupt input pin is set to 0 to set
that pin to an input port.
– When the PDR0 register is read, the value of the pin can be read irrespective of whether the
external interrupt input and the interrupt request output are enabled or disabled.
Analog input operation (only MB89190A series)
– The bit of the DDR0 register that corresponds to an analog input pin is set to 0 to disable operation
of the output transistor.
– When the PDR0 register is read, the value of the output latch can be read.
– Set the corresponding bit of the ENI0 register to 0, to disable the port input.
Reset operation
– When the CPU is reset, the value of the DDR0 register is initialized to 0, so the output transistors
are all set to OFF (input port), and the pin becomes high impedance.
– The PDR0 register cannot be initialized by reset, so when using a pin as an output port, set the
output data at the PDR0 register, and then set the corresponding DDR0 register to the output port.
Stop mode operation
When the standby control register pin state specification bit (STBC: SPL) is 1 at the point when control
transits to the stop mode, the pin becomes high impedance. This is because the output transistor is
forcibly set to OFF irrespective of the value of the DDR0 register. The input is fixed to prevent leakage
due to the opening of the input.