You are on page 1of 13

Communicating with the Microprocessor

THE NEED FOR MICROPROCESSOR I/O


The microprocessor is nothing if it cannot communicate with an outside device. To do this, the microprocessor uses its I/O ports. It gets data to process through the input port, and it delivers the result of its processing through its output port.

THE NEED FOR MICROPROCESSOR I/O


Some microprocessor use a separate addressing method to reach an I/O port; to some the I/O port is just a memory location. External devices use the interrupt to get the microprocessors attention.

Port
Is a hole to allow things to get into or out of something.

Interface
All of the microprocessors circuits which are used to let the microprocessor communicate with an external device.
Serial interface
I/O port, control logic, data format conversion, connector & cables.

CONNECTING THE I/O PORT TO THE MICROPROCESSOR


Memory Mapped
The I/O acts like a read-write RAM at the addressed memory locations.

I/O mapped or I/O Mode


A different control line will be used to for I/O data transfer Control lines: signal the external microprocessor support logic that the data transfer is to be with memory or with an I/O device.

POLLING & INTERRUPTS


Used for servicing the microprocessor.

POLLING
Polling Routine
The microprocessors software simply checks each of the I/O devices every so often. During this check, the microprocessor tests to see if any device needs servicing.

INTERRUPT
Is a special input to the microprocessor s control logic. It is like a hardware subroutine call. When the interrupt is asserted (a signal is sent to the interrupt input), a special purpose sequence in the control logic begins.

INTERRUPT SEQUENCE
1. The microprocessor completes its current instruction. That is, the instruction which is currently being executed is completed. No instruction is cut-off in the middle of its execution.

INTERRUPT SEQUENCE
2. The program counters current contents are stored on the stack. Remember, during execution of an instruction the program counter is pointing to the memory location for the next instruction.

INTERRUPT SEQUENCE
3. The program counter is loaded with the contents of two special memory locations. The addresses of these special memory locations are built into the microprocessors internal logic.

INTERRUPT SEQUENCE
4. Program execution continues with the instruction taken from the memory location pointed to by the new program counter value. 5. The interrupt program continues to execute until a return instruction is executed.

You might also like