šŸŽ“ BookMCQ
← Back to 8. Programmable Peripheral Interface (PPI) 8255A

šŸ“ 8255A Operational Modes (12 MCQs)

Three Operating Modes of the Programmable Peripheral Interface

The 8255A provides three operating modes that determine how its 24 I/O lines communicate with external devices. Mode 0 provides simple input and output, Mode 1 supports strobed transfers using handshaking signals, and Mode 2 provides bidirectional bus communication through Port A. Group A and Group B can be configured independently within their supported mode combinations.

Mode 0 Simple Input and Output Configuration

Mode 0 supports basic input and output without handshaking or interrupt generation. Port A, Port B and the two four-bit sections of Port C can be configured independently as inputs or outputs. Output data is latched, whereas input data is not latched. This mode provides sixteen possible input/output direction combinations.

Mode 1 Strobed Input and Output with Handshaking

Mode 1 allows Port A and Port B to operate as eight-bit input or output ports using handshaking signals from Port C. Input and output data are latched. Group A uses selected upper Port C lines, while Group B uses lower Port C lines. Interrupt requests are available when the associated interrupt-enable conditions are satisfied.

Mode 2 Bidirectional Communication Through Port A

Mode 2 allows Port A to transmit and receive eight-bit data through the same bidirectional interface using handshaking signals. It uses five Port C lines, PC3–PC7, for control and status. Group B can independently operate in Mode 0 or Mode 1, making it possible to combine bidirectional and ordinary I/O functions.

Example of Selecting Different 8255A Operating Modes

For Mode 0, a control word of 80H configures all ports as outputs. For Mode 1 input on Port A with Group B in Mode 0 and Port B as output, B0H is an appropriate control word. For Mode 2 on Port A with Group B in Mode 0 and Port B as output, C0H can be used.

Misconceptions About 8255A Operating Modes

'Mode 2 is available on Port B' is incorrect because only Port A supports Mode 2. 'Mode 0 provides hardware handshaking' confuses simple I/O with Mode 1. 'Mode 1 inputs are not latched' is incorrect because both input and output data are latched in strobed operation.

Mode Selection and Port Configuration Examination Questions

Compare the three modes by data direction, latching, handshaking and interrupt support. Identify which Port C lines are reserved in Mode 1 and Mode 2. Practise interpreting control words and determining valid combinations of Group A and Group B modes, especially the restriction that Mode 2 applies only to Port A.

8255A Mode and Handshaking Terminology

  • Mode 0 - Basic input/output operation.
  • Mode 1 - Strobed I/O with handshaking.
  • Mode 2 - Bidirectional Port A operation.
  • Group A - Port A and upper Port C.
  • Group B - Port B and lower Port C.
  • Handshaking - Coordinates peripheral data transfers.
2
Easy
6
Medium
4
Hard

šŸ“ All 8255A Operational Modes MCQs

Q1. Which operational mode of the 8255A provides simple input/output without any handshaking signals?

A.Mode 0 – Simple I/O āœ…
B.Mode 1 – Handshaking
C.Mode 2 – Handshaking (input only)
D.Bit Set/Reset (BSR) mode
šŸ’” Difficulty: easy | āœ… Correct: A

šŸ“– Explanation: Mode 0 is the basic mode where the 8255A behaves like three independent 8‑bit ports with no handshaking or control signals. It is chosen when the designer only needs straightforward read or write operations. The other modes involve additional control lines (ACK, STB, etc.) and are unnecessary for simple data transfer, so they are incorrect. This directly matches a scenario where a micro‑processor simply reads a sensor value without any protocol overhead.

Q2. Why is the Bit Set/Reset (BSR) mode often preferred when only a few bits of Port C need to be controlled?

A.It allows changing an entire port at once
B.It requires fewer external wires
C.It lets individual bits be set or cleared without affecting other bits āœ…
D.It provides automatic handshaking
šŸ’” Difficulty: easy | āœ… Correct: C

šŸ“– Explanation: BSR mode uses the three least‑significant bits of the control word to address a specific bit of Port C, while the fourth bit selects set or reset. This means only the targeted bit changes, leaving the remaining seven bits untouched. The other options either describe unrelated functionality or impose unnecessary complexity, making them wrong. In practice, designers use BSR when a single control line, such as an LED, must be toggled independently.

Q3. A system must read data from an external device using handshaking on Group A while sending data out on Group B. Which control word correctly configures the 8255A for Mode 1 with Group A as input and Group B as output?

A.128
B.144
C.176 āœ…
D.224
šŸ’” Difficulty: medium | āœ… Correct: C

šŸ“– Explanation: In Mode 1 the mode‑select bits are 01, Group A direction = 1 (input), Group B direction = 0 (output), and the three low bits are 000. This yields the binary pattern 1011 0000, which is hexadecimal 0xB0. The other hex values either set the wrong mode (0x80 = Mode 0), flip the direction bits (0x90), or enable BSR mode (0xE0). Selecting the correct control word ensures proper handshaking and reliable data exchange.

Q4. How does Mode 1 differ from Mode 2 in the 8255A?

A.Mode 1 supports handshaking on both groups, Mode 2 only on Group A āœ…
B.Mode 1 is for output only, Mode 2 is for input only
C.Mode 1 uses BSR, Mode 2 uses simple I/O
D.Mode 1 and Mode 2 have identical functionality
šŸ’” Difficulty: medium | āœ… Correct: A

šŸ“– Explanation: Mode 1 provides handshaking capability for both Group A (Port A + upper Port C) and Group B (Port B + lower Port C), allowing synchronized data transfer in either direction. Mode 2, however, is limited to handshaking on Group A and forces Group B to operate in simple I/O mode. The other statements either invert the input/output roles or confuse the mode with unrelated features such as BSR, making them incorrect. Understanding this distinction helps engineers select the appropriate mode for bidirectional communication.

Q5. A designer needs to output a 4‑bit BCD value to a display using only simple I/O. Which operational mode should be chosen for the 8255A?

A.Mode 0 – Simple I/O āœ…
B.Mode 1 – Handshaking
C.Mode 2 – Handshaking (input only)
D.Bit Set/Reset (BSR) mode
šŸ’” Difficulty: medium | āœ… Correct: A

šŸ“– Explanation: Mode 0 provides straightforward, non‑handshaking I/O on all ports, which is ideal for driving a display that only requires writing static BCD values. Handshaking modes (Mode 1 and Mode 2) introduce extra control lines that are unnecessary for this simple write‑only task, and BSR mode is intended for manipulating individual bits rather than sending a full nibble. Selecting Mode 0 reduces hardware complexity and matches the application’s requirements.

Q6. In the 8255A control word, which bits identify the selection of Mode 2?

A.D6 = 0 and D5 = 1
B.D6 = 1 and D5 = 0 āœ…
C.D6 = 1 and D5 = 1
D.D6 = 0 and D5 = 0
šŸ’” Difficulty: hard | āœ… Correct: B

šŸ“– Explanation: The mode‑select field occupies bits D6 and D5. Binary 10 corresponds to Mode 2, meaning D6 must be 1 and D5 must be 0. The other combinations represent Mode 0 (00), Mode 1 (01), or an undefined state (11). Recognizing the correct bit pattern is essential when programming the control register, as an incorrect mode selection would cause the device to interpret handshaking signals improperly.

Q7. An external peripheral provides data with ACK and STB signals. To receive this data on Group A while sending data out on Group B, which control word must be loaded?

A.208 āœ…
B.184
C.144
D.160
šŸ’” Difficulty: hard | āœ… Correct: A

šŸ“– Explanation: Mode 2 (binary 10) is required for handshaking on Group A, while Group B must remain in simple I/O (output). Setting D7 = 1, D6 = 1, D5 = 0, D4 = 1 (Group A input), D3 = 0 (Group B output), and D2‑D0 = 000 yields the binary pattern 1101 0000, which is hexadecimal 0xD0. The other options either select the wrong mode or invert the direction bits, leading to failed handshaking or incorrect data flow.

Q8. Why does Mode 2 of the 8255A only allow Group A to operate as an input with handshaking, while Group B is fixed to simple I/O?

A.Group B pins lack the necessary hardware for handshaking
B.Mode 2 was designed for legacy devices that only needed input on one group
C.The internal timing circuitry can only support one handshaking channel at a time āœ…
D.Group A and Group B share the same control lines, making dual handshaking impossible
šŸ’” Difficulty: hard | āœ… Correct: C

šŸ“– Explanation: Mode 2 uses a dedicated handshaking generator that occupies the internal timing resources for only one group. Because the 8255A has a single set of handshaking lines, the designer limited the feature to Group A, leaving Group B to operate in simple I/O. The other choices either misstate hardware capabilities or ignore the timing limitation, which is the core reason for the restriction.

Q9. To expand the micro‑processor’s I/O, a designer wants Port A as input, the upper four bits of Port C as output, and the lower four bits of Port C as input. Which operational mode should be selected?

A.Mode 0 – Simple I/O
B.Mode 1 – Handshaking
C.Bit Set/Reset (BSR) mode āœ…
D.Mode 2 – Handshaking (input only)
šŸ’” Difficulty: medium | āœ… Correct: C

šŸ“– Explanation: BSR mode enables the programmer to set or reset individual bits of Port C without affecting the rest of the port, making it possible to configure the upper half as output and the lower half as input while keeping Port A an input. Simple I/O modes treat the whole port uniformly, and the handshaking modes do not provide per‑bit control, so they are unsuitable for this mixed‑direction requirement.

Q10. Which pin on the 8255A is designated as the Chip Enable (CE) input?

A.Pin 1
B.Pin 20 āœ…
C.Pin 23
D.Pin 28
šŸ’” Difficulty: medium | āœ… Correct: B

šŸ“– Explanation: Pin 20 is the active‑low Chip Enable (CE) pin that must be driven low for the 8255A to respond to a control word or data transfer. The other pins either serve different functions (e.g., data bus lines, reset) or do not exist on the standard DIP package. Recognizing the CE pin is vital for proper interfacing, as an incorrectly tied CE would keep the device permanently disabled.

Q11. A program needs to toggle bit 3 of Port C using BSR mode. Which pair of control words correctly sets then resets that bit?

A.0x0B; 0x0A āœ…
B.0x0A; 0x0B
C.0x0C; 0x0D
D.0x0D; 0x0C
šŸ’” Difficulty: hard | āœ… Correct: A

šŸ“– Explanation: In BSR mode, the three least‑significant bits of the control word specify the bit number (bit 3 = 011 = 0x03) and bit 4 determines set (1) or reset (0). Adding the base value 0x08 for BSR gives 0x0B to set bit 3 and 0x0A to reset it. The other pairs either reverse the order or address a different bit, which would not achieve the desired toggle operation.

Q12. What is the function of the Group B direction bit (D3) in the 8255A control word?

A.It selects between Mode 0 and Mode 1
B.It determines whether Group B operates as input or output āœ…
C.It enables or disables the reset pin
D.It controls the handshaking signals for Group A
šŸ’” Difficulty: medium | āœ… Correct: B

šŸ“– Explanation: Bit D3 indicates the data flow direction for Group B, which comprises Port B and the lower four bits of Port C. Setting D3 = 0 configures the entire group for output, while D3 = 1 configures it for input. The other options describe unrelated control‑word functions, such as mode selection or reset handling, making them incorrect. Proper use of D3 ensures the desired I/O behavior for the lower ports.

šŸ”— Related Topics (MCQs)