Interfacing with a general-purpose processor
- The most common communication situation in ES is the input and output (I/O) of data to and from a general-purpose processor.
- I/O is relative to the processor: input means data comes into the processor, while output means data goes out of the processor.
- The three processor I/O issues are: I/O addressing, interrupts, and direct memory access.
- A general-purpose processor in this section means a microprocessor.
I/O addressing
- A microprocessor may have tens or hundreds of pins, which are control pins and input pin.
- control pins are like pin for clock input.
- input pin is for resetting the microprocessor.
- processor I/O pins are used to communicate data to and from the microprocessor.
- pins to support I/O: ports, and system buses.
- A port is a set of pins that can be read and written just like any register in the microprocessor.
- The port is usually connected to a dedicated register.
- In contrast to a port, a system bus is a set of pins consisting of address pins, data pins, and control pins (for strobing or handshaking).
- The microprocessor uses the bus to access memory as well as peripherals.
- The access to the peripherals as I/O. But don’t normally consider the access to memory as I/O.
- Since the memory is considered more as a part of the microprocessor.
- A microprocessor may use one of two methods for communication over a system bus:
- Memory-mapped I/O or I/O mapped I/O (Standard I/O).
Interrupts
Interrupt-driven I/O:-
- It is one of the issues in Microprocessors.
- Servicing: – The program running on a microprocessor read and process data from a peripheral whenever that peripheral has new data.
- To identify the new data at unpredictable intervals is by checking for a 1 in a particular bit in a register of the peripheral.
- This repeated checking by the microprocessor for data is called polling.
- Polling is simple to implement, but data process is not quick.
- To overcome the polling, most microprocessors uses concept of external interrupt.
- It uses a pin Int.
- At the end of executing each machine instruction, the processor’s checks Int.
- If Int is asserted, the microprocessor jumps to a particular address at which a subroutine exists which is called an Interrupt Service Routine, or ISR. Such I/O is called interrupt-driven I/O.
- There are two methods to identify the address of the ISR.
Interrupt address vector:-
- The address to which the microprocessor jumps on an interrupt is fixed.
- The assembly programmer either puts the ISR there, or jumps to the real ISR there. If not enough bytes are available in the memory.

Vectored Interrupt:-
- Here, peripheral must provide the address.
- It is Common when microprocessor has multiple peripherals connected by a system bus.

Direct Memory Access:-
- The data being accumulated in a peripheral should be first stored in memory before being processed by a program running on the microprocessor.
- Such temporary storage to await processing is called buffering.
- Peripheral to memory transfer without DMA causes inefficiencies.
- The I/O method of direct memory access (DMA) eliminates these inefficiencies.
- A DMA controller is a separate single-purpose processor.

