Introduction to Data Communication Techniques
Microprocessors & Interfacing
Dr. Bassel Soudan
1
Data Communication Formats
•
The microprocessor communicates with its peripherals is one of two ways: – Synchronous. • At agreed upon points in time. • The sender and receiver must be synchronized to the same clock signal.
– Asynchronous. • At irregular intervals.
Microprocessors & Interfacing
Dr. Bassel Soudan
2
Data Communication Formats (Contd.)
• • •
Synchronous is usually used for high-speed data transfer where no time can be lost. Asynchronous is used for low speed.
Transfer between the microprocessor and I/O devices is primarily Asynchronous.
Microprocessors & Interfacing
Dr. Bassel Soudan
3
Modes of Data Transfer
•
The microprocessor transfers the data to its peripheral devices in one of two modes: – Parallel. • All of the bits are sent at the same time over multiple wires. – Faster. – Short distance.
– Serial. • The bits are sent one at-a-time over a single wire. – Slower. – More economical.
Microprocessors & Interfacing
Dr. Bassel Soudan
4
Interfacing Techniques for Peripheral Devices
•
The microprocessor identifies the peripherals based on their interfacing technique either as: – Memory-mapped. • The device uses an address from the memory address range. • The microprocessor treats the device as a regular memory location.
– Peripheral-mapped. • The device uses a special address known as a port number. • The peripherals do not interfere with the memory address range.
Microprocessors & Interfacing
Dr. Bassel Soudan
5
Controlling Data Communication
•
There are two ways to control the transfer of data between the microprocessor and its peripherals: – Microprocessor-controlled: • The microprocessor initiates the communication with the peripheral.
– Peripheral-controlled. • The peripheral initiates the communication.
Microprocessors & Interfacing
Dr. Bassel Soudan
6
Microprocessor Controlled Communications
•
There are several techniques for the microprocessor to control the communications: – – – – –
Unconditional Polling Interrupt RDY signal Handshake
Microprocessors & Interfacing
Dr. Bassel Soudan
7
Microprocessor-controlled Data Transfer
•
Most I/O devices are slow, therefore, the microprocessor needs to control the process to make sure data is not lost. There are 5 ways to control the process: 1. Unconditional. • •
The microprocessor assumes that the device is always ready. (Like the LEDs). When the data is ready, the microprocessor sends it directly to the device.
2. Polling (status check). • •
The microprocessor stays in a loop checking the status of the device until it is ready. Wasteful of resources.
Microprocessors & Interfacing
Dr. Bassel Soudan
8
Microprocessor-controlled Data Transfer 1. Interrupt. •
•
When the device is ready it sends an interrupt signal to the microprocessor. The microprocessor stops executing the program, services the device and then goes back to what it was doing. More useful for data input type operations.
2. READY signal. •
•
•
When the device is not ready it resets the ready signal. Basically stalling the microprocessor. When it becomes ready it sets the signal. Resting the ready signal may be done in response to the an attempt by the microprocessor to send data to the device. More useful for data output type operations.
Microprocessors & Interfacing
Dr. Bassel Soudan
9
Microprocessor-controlled Data Transfer 1. Handshake. •
• •
Signals are exchanged before the beginning of the data transfer to make sure the device and the microprocessor are both ready. Very similar to the polling technique but it can be used in both directions. Most commonly used for modems, communication networks.
Microprocessors & Interfacing
Dr. Bassel Soudan
10
Peripheral- Controlled Data Transfer
•
This is used when the device is much faster than the microprocessor. – Example DMA. • The DMA controller send a HOLD signal to the microprocessor. • The microprocessor releases the system bus. • The DMA controller transfers the data directly to memory without the intervention of the microprocessor. • The microprocessor is “officially” not stalled. However, there is little that the microprocessor can do without the system bus.
Microprocessors & Interfacing
Dr. Bassel Soudan
11