1
4.
Overview of I/O Ports
The I/O ports consist of seven ports (53 pins) including output-only, input-only, and
general-purpose I/O ports (parallel I/O ports).
The ports also serve as peripherals (I/O pins of peripheral functions) and external bus
pins.
n I/O Port Functions
The functions of the I/O ports are to output data from the CPU via the I/O pins and to fetch
signals input to the I/O pins into the CPU. Input and output are performed via the port data
registers (PDR). Also, for certain ports the direction of each I/O pin can be individually set to
either input or output for each bit by the port data direction register (DDR).
The following lists the function of each port and the peripheral with which the ports also serve as.
•
Port 0: General-purpose I/O port. Also serves as the lower external address/data bus pins.
•
Port 1: General-purpose I/O port. Also serves as the upper external address bus pins.
•
Port 2: Output-only port. Also serves as the external bus control pins.
•
Port 3: General-purpose I/O port. Also serves as peripherals (serial I/O-1 and various
•
Port 4: General-purpose I/O port. Also serves as peripherals (serial I/O-2 and buzzer pins).
•
Port 5: Output-only port. Also serves as peripherals (analog input pins).
•
Port 6: Input-only port. Also serves as peripherals (external interrupt pins).
Table 4.1a lists the functions of each port and Table 4.1b lists the registers for each port.
88
CHAPTER 4 I/O PORTS
counter pins).
MB89620 series