4
1 Introduction to Data Transfer and Interfacing Techniques Interfacing When we discuss interfacing, We are interested in 2 things: Designing logic circuits (hardware) and writing instructions (software) to enable the microprocessor to communicate with peripherals (I/O devices). The logic circuits are called I/O ports or interfacing devices. Formats of Data Transfer • The microprocessor communicates with its peripherals in either of two formats: • Synchronous: – At the same time. – The transmitter and receiver are synchronized with the same clock. • Asynchronous: – At irregular intervals. • The Synchronous format is used in high-speed data transmission. • The Asynchronous format is used for low speed data transmission. • Data transfer between the microprocessor and peripherals is primarily synchronous. Modes of Data Transfer • The microprocessor receives (or transmits) binary data in either of two modes: • Parallel The entire word (4-bit, 8-bit, 16-bit) is transferred at one time. • Serial Data are transferred one bit at a time over a single line. • Requires parallel-to-serial or serial-to-parallel conversion. Types of I/O 1

1 - Introduction to Data Transfer and Interfacing

Embed Size (px)

Citation preview

Page 1: 1 - Introduction to Data Transfer and Interfacing

1 Introduction to Data Transfer and Interfacing Techniques

InterfacingWhen we discuss interfacing, We are interested in 2 things:Designing logic circuits (hardware) and writing instructions (software) to enable the microprocessor to communicate with peripherals (I/O devices).

The logic circuits are called I/O ports or interfacing devices.

Formats of Data Transfer• The microprocessor communicates with its peripherals in either of two formats:• Synchronous:

– At the same time.– The transmitter and receiver are synchronized with the same clock.

• Asynchronous:– At irregular intervals.

• The Synchronous format is used in high-speed data transmission. • The Asynchronous format is used for low speed data transmission.• Data transfer between the microprocessor and peripherals is primarily synchronous.

Modes of Data Transfer• The microprocessor receives (or transmits) binary data in either of two modes:• Parallel The entire word (4-bit, 8-bit, 16-bit) is transferred at one time.• Serial Data are transferred one bit at a time over a single line.• Requires parallel-to-serial or serial-to-parallel conversion.

Types of I/OThe microprocessor identifies the peripherals based on their interfacing technique either as:• Memory-mapped A peripheral is connected as if it were a memory location. It is identified with a 16-bit address. Data transfer is implemented using memory-related inst.• Peripheral-mapped A peripheral is identified with an 8-bit address. The microprocessor uses special instructions to implement data transfer.

Controlling Data TransferThere are two ways to control the transfer of data between the microprocessor and its peripherals:• Microprocessor-controlled:

1

Page 2: 1 - Introduction to Data Transfer and Interfacing

The microprocessor initiates the communication with the peripheral. (when peripherals are slow)

• Peripheral-controlled:The peripheral initiates the communication.

Microprocessor Controlled Data Transfer

Microprocessor-controlled data transfer can take place under five different conditions:• Unconditional• Polling (Status check)• Interrupt• With READY signal• With Handshake signal

1. Unconditional:The microprocessor assumes that the peripheral is always available.

For example, displaying data at LED port involves simply enabling the port, transfers data, and going to execute the next inst.

2. Polling (status check): The microprocessor is kept in a loop to check whether data are available. For example, reading data from the Keyboard.

3. InterruptWhen a peripheral is ready to transfer data, it sends an interrupt signal to the microprocessor.

The microprocessor stops executing the program, accepts/sends the data from/to the peripheral, and then return to the program.

4. Data transfer with READY signal:Usually happens when the peripheral’s response time is slower than the execution time of the microprocessor.

The READY signal can be used to extend the execution time (By adding T-states). And is commonly used in a system with slow memory chips

5. Data transfer with Handshake signals:Signals are exchanged between the microprocessor and a peripheral prior to actual data transfer.This is to ensure the readiness of the peripheral and to synchronize the timing of the data transfer.An Example of that would be, interfacing A/D converterHandshake signals can be used with status check or interrupts.

Page 3: 1 - Introduction to Data Transfer and Interfacing

Peripheral-Controlled Data TransferThis is used when the device is much faster than the microprocessor. An example would be the DMA.

– The DMA controller sends a HOLD signal to the microprocessor.– The microprocessor releases the system bus.– The data are transferred at high speed without the intervention of the microprocessor

End of Part 1