- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Mode 2—bi-directional I/O
In mode 0 or mode 1, a port works as an input port or an output port. It is dependent if an input device or an output device gets connected to the port. Moreover, this, mode 2 is often called as bi-directional handshake Input Output. It is beneficial for us when the microprocessor receives information, and sometimes sends information to the Input Output device which is connected to 8255. An example to be cited as for the communication process with a floppy disk controller card. Since mode 2 is bi-directional handshake Input Output, it needs more number of handshake lines than the uni-directional mode 1 which is strobed Input Output.
Thus, the operations of mode 2 makes use of the five lines of Port C for the purposes of handshaking. These five lines of Port C ranges from PC7 to PC3. For performing the input operation, PC5, PC4, and PC3 pins provides the handshake signals for Port A when we configure as mode 2. For performing the output operation, PC7, PC6, and PC3 pins provides the handshake signals for Port A when we configure it as mode 2.
Example 1: Configure Port A as bi-directional I/O port, Port B as basic input port, and PC2-0 as output lines.
The required mode definition control word is shown in below −
Bit 0 must be a 0 to indicate that PC2-0 are output lines. In this case it does not mean that the entire Port C lower is output, as PC3 is used for handshaking purposes.
It is to be noted that the bit 3 is a don't care. This is because all the four lines of Port C upper are used for handshaking purposes some of which will be input pins and some others will be outputs. The 8255 will automatically configure these handshake pins, and so it is unimportant whether bit 3 is a 0 or 1.
Bit 4 is a don't care because Port A is required to work in bi-directional mode. The instructions to achieve this requirement assuming the chip select circuit as shown above are as follows.
MVI A, C2H ; Treating X as 0 OUT 23H
- Related Articles
- Mode 1—strobed I/O
- Directional Selection
- What is the difference between Directional Coupler and two-hole directional coupler?
- Comparison of memory-mapped I/O and I/O-mapped I/O
- I/O-mapped I/O or memory-mapped I/O in 8085 Microprocessor
- Demerits of I/O-mapped I/O and merits of memory-mapped I/O
- Merits of I/O-mapped I/O and demerits of memory-mapped I/O
- I/O-mapped I/O in 8085 Microprocessor
- What Is Bi-quadratic Polynomial?
- Evaluate:(i) \( \frac{\sin ^{2} 63^{\circ}+\sin ^{2} 27^{\circ}}{\cos ^{2} 17^{\circ}+\cos ^{2} 73^{\circ}} \)(ii) $sin\ 25^o\ cos\ 65^o + cos\ 25^o\ sin\ 65^o$.
- Differentiate between programmed I/O and interrupt driven I/O.
- Evaluate: $sin^{2}19^{o}+sin^{2}71^{o}$.
- SAP BI retrieving PDF from Web Service
- Find the value of $2^o+3^o+4^o$.
- Maximum sum Bi-tonic Sub-sequence in C++
