Section 9 I/O Ports
9.1 Overview
The H8/534 and H8/536 have nine ports. Ports 1, 3, 4, 5, 7, and 9 are eight-bit input/output ports.
Port 2 is a five-bit input/output port. Port 6 is a four-bit input/output port. Port 8 is an eight-bit
input-only port. Table 9-1 summarizes the functions of each port.
Input and output are memory-mapped. The CPU views each port as a data register (DR) located
in the register field at the high end of page 0 of the address space. Each port (except port 8) also
has a data direction register (DDR) which determines which pins are used for input and which for
output. Additional system control registers (SYSCR1 and SYSCR2) control the functions of pins
in ports 1, 6, and 9.
To read data from an I/O port, the CPU selects input in the data direction register and reads the
data register. This causes the input logic level at the pin to be placed directly on the internal data
bus. There is no intervening input latch.
To send data to an output port, the CPU selects output in the data direction register and writes the
desired data in the data register, causing the data to be held in a latch. The latch output drives the
pin through a buffer amplifier. If the CPU reads the data register of an output port, it obtains the
data held in the latch rather than the actual level of the pin.
As table 9-1 indicates, all of the I/O port pins have dual functions. For example, pin 7 of port 1
can be used either as a general-purpose I/O pin (P1
7
), or for output of the TMO signal from the
on-chip 8-bit timer. The function is determined by the MCU operating mode, or by a value set in
a control register.
Outputs from ports 1 to 6 can drive one TTL load and a 90 pF capacitive load. Outputs from ports
7 and 9 can drive one TTL load and a 30 pF capacitive load.
Outputs from ports 1 to 7 and 9 can also drive a Darlington transistor pair. Outputs from port 4
can drive a light-emitting diode (with 10mA current sink). Ports 5 and 6 have built-in MOS pull-
ups for each input. Port 7 has Schmitt inputs.
Schematic diagrams of the I/O port circuits are shown in appendix C.
141