Introduction to Data Communication Techniques

11
Dr. Bassel Soudan Microprocessors & Interfacing 1 Introduction to Data Communication Techniques

Transcript of Introduction to Data Communication Techniques

Page 1: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 1

Introduction to Data Communication Techniques

Page 2: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 2

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.

Page 3: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 3

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.

Page 4: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 4

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.

Page 5: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 5

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.

Page 6: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 6

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.

Page 7: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 7

Microprocessor Controlled Communications

• There are several techniques for the microprocessor to control the communications:– Unconditional– Polling– Interrupt– RDY signal– Handshake

Page 8: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 8

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.

Page 9: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 9

Microprocessor-controlled Data Transfer

3. 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.

4. 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.

Page 10: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 10

Microprocessor-controlled Data Transfer

5. 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.

Page 11: Introduction to Data Communication Techniques

Dr. Bassel SoudanMicroprocessors & Interfacing 11

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.