📝 Asynchronous Software Approach IC 8251 in 8085A Microprocessor (15 MCQs)
Software-Controlled Asynchronous Transmission and Reception
The asynchronous software approach uses the 8251A status and data registers to exchange characters with the 8085A without requiring a separate interrupt routine. Software repeatedly checks transmitter and receiver readiness, writes data when the transmit buffer is available and reads received characters when the receive buffer contains a complete byte. Start and stop framing is handled automatically by the USART.
Polling TxRDY and RxRDY Through the Status Register
The status register provides TxRDY and RxRDY indications. Status bit D0 identifies an empty transmit input buffer, while D1 indicates that received data is available. The processor can test these bits using input and logical instructions. The TxRDY output pin is additionally conditioned by the transmitter enable and CTS conditions, unlike its status-register bit.
Software Sequence for Sending and Receiving Characters
For transmission, software reads status, tests D0 and writes a character to the data port when the bit is set. For reception, it tests D1 and reads the data port when a character is ready. The receive-ready indication is automatically cleared by the data read, while writing a character resets the transmit-ready indication.
Example of Polling Before Sending a Character
Assume the status port is 81H and the data port is 80H. The 8085 executes IN 81H, ANI 01H and JZ WAIT until D0 becomes one. It then loads 41H into the accumulator and executes OUT 80H to transfer the character for transmission.
Software Polling for Continuous Serial Data Exchange
A polling routine can handle both directions by checking D0 and D1 during repeated execution. This approach is straightforward for systems with moderate communication activity, but processor time is consumed while checking readiness. If the processor does not read a received character before another arrives, the previous character may be overwritten and an overrun error recorded.
Clarifying Status Polling and Asynchronous Framing
'Software must generate every start and stop bit' is incorrect because the 8251A inserts and checks them. 'TxRDY always means transmission is completely finished' is incorrect because it indicates input-buffer availability; TxEMPTY indicates that transmission storage is empty. 'Reading status removes received data' is incorrect because the receive data port must be read.
Polling Loops and Status-Bit Interpretation in Exams
Trace IN, ANI and conditional-branch instructions used to test D0 and D1. Distinguish status-register TxRDY from the external TxRDY pin, and identify the data-port read that clears RxRDY. Explain how polling differs from interrupt-driven communication and how delayed reception can cause overrun.
Asynchronous Software and Status Terms
- Polling - Repeated software status checking.
- D0 - Status bit for transmit readiness.
- D1 - Status bit for receive readiness.
- ANI - Masks selected accumulator bits.
- RxRDY - Indicates a complete received character.
- TxEMPTY - Indicates an empty transmitter.
📝 All Asynchronous Software Approach IC 8251 in 8085A Microprocessor MCQs
Q1. What is the maximum number of bytes that the 8257 DMA controller can transfer without CPU intervention?
📖 Explanation: The controller’s terminal count register uses only the lower 14 bits to hold the byte count. Therefore the largest value it can represent is , but the specification states a maximum transfer of 16 K bytes, i.e., 16384 bytes. Options A, C, and D are too small or too large. The correct answer is 16384 bytes, which matches the hardware limit and allows a full block transfer without CPU involvement.
Q2. Which pin on the 8257 DMA controller is used to request the CPU to relinquish the bus?
📖 Explanation: HRQ stands for HOLD Request. When a peripheral needs the bus, it asserts HRQ, signalling the CPU to release control. The CPU then acknowledges with HLDA. This mechanism enables the DMA controller to take over the bus. Options B, C, and D refer to different signals that either acknowledge the request or indicate readiness, but they are not the request itself. Hence HRQ is the correct pin for requesting the CPU to relinquish the bus.
Q3. Why are the two most significant bits of the terminal count register ignored in the 8257 DMA controller?
📖 Explanation: The terminal count register is 16 bits wide, but the DMA controller only uses the lower 14 bits to count bytes. The upper two bits are therefore reserved and ignored during normal operation. This design simplifies the hardware because the maximum transfer size is limited to 16 K bytes. Options A and D describe unrelated functions, and B incorrectly suggests channel selection. The correct answer states that only 14 bits store the byte count.
Q4. How does the Address Enable (AEN) pin affect the operation of the 8257 DMA controller when multiple devices share the address bus?
📖 Explanation: AEN (Address Enable) is used when several devices share the same address lines. When AEN is asserted, the DMA controller is permitted to drive the address bus; otherwise the bus remains idle, preventing contention. This ensures that only one device presents an address at a time. Option A reverses the role, option C misstates CPU responsibility, and option D ignores the pin’s purpose. Therefore the correct answer is that AEN allows the DMA controller to place an address only when asserted.
Q5. What is the primary advantage of using the DMA controller’s Read/Write Logic block instead of having the CPU perform all data transfers?
📖 Explanation: The Read/Write Logic block inside the 8257 handles the actual data movement between memory and I/O devices. By managing reads and writes directly, the CPU is freed from moving each byte, which speeds up overall system performance and lowers interrupt load. Option A is unrelated to speed, option C describes a negative effect not intended, and option D adds functionality the controller does not provide. Hence the primary advantage is offloading byte‑by‑byte transfers from the CPU.
Q6. In a system where Channel 2 of the 8257 is configured for block transfer mode, how does the modulo 128 feature influence successive transfer cycles?
📖 Explanation: In block‑transfer mode, the modulo 128 setting causes the address register to wrap around after reaching a 128‑byte boundary. This means that after the low 7 bits overflow, the high bits are cleared, allowing the DMA to repeatedly write within a fixed 128‑byte window. Option A suggests a full reset, which is not the case; option C confuses modulo with terminal count; option D denies any effect. Therefore the correct answer describes masking the high address bits to keep the address within a 128‑byte page.
Q7. Explain why the Terminal Count (TC) signal is essential for synchronizing the end of a DMA operation with the peripheral device.
📖 Explanation: The Terminal Count (TC) line is asserted when the byte counter in the terminal count register reaches zero, signalling the end of the current transfer. This allows the peripheral to know that the expected amount of data has been moved and can prepare for the next operation or generate an interrupt. Option A confuses TC with CPU signaling, option B is partially true but not the primary role, and option D describes a reset function not performed by TC. Hence the correct answer is that TC indicates the terminal count register has reached zero.
Q8. A microcontroller needs to move 10 KB of sensor data to memory using the 8257 DMA controller. Which channel configuration ensures the transfer completes without exceeding the terminal count limit?
📖 Explanation: A 10 KB transfer equals 10 240 bytes, which fits within the 14‑bit limit of the terminal count register (maximum 16 384 bytes). By loading the start address into the chosen channel’s address register and programming the terminal count register with 10 240, the DMA controller will move exactly the required amount. Options B and D exceed the needed count, while option C would stop after only 8 192 bytes, leaving data incomplete. Therefore the correct configuration uses Channel 0 with a terminal count of 10 240.
Q9. If a peripheral asserts DRQ0 while the CPU is executing a critical routine, what sequence of signals must occur for the DMA transfer to proceed without data loss?
📖 Explanation: When DRQ0 goes active, the DMA controller raises HRQ to request control of the bus. The CPU responds by asserting HLDA, indicating it has released the bus. The controller then asserts DACK0 to acknowledge the specific channel and begins the transfer. The peripheral does not drive the bus directly (option C), and the CPU does not simply ignore or reset (options A and D). This handshake ensures a smooth handover without data loss, making option B the correct sequence.
Q10. During a DMA transfer, the CPU receives a HOLD request (HRQ). What steps should the CPU take to correctly respond, and what pin indicates the CPU’s acknowledgment?
📖 Explanation: When the DMA controller asserts HRQ, the CPU must finish the instruction it is currently executing, then place the bus in a high‑impedance state and assert HLDA to acknowledge the request. This handshake guarantees that the DMA controller can safely take over the bus. Option A would cause contention, option C is unrelated to handling HRQ, and option D misuses the READY pin, which signals bus availability rather than acknowledgment. Thus the correct response is that the CPU asserts HLDA after completing the current instruction.
Q11. A system designer wants to chain two DMA transfers so that after the first 8 KB block completes, the second block of 4 KB automatically starts on the same channel. Which registers must be programmed, and how should the terminal count values be set?
📖 Explanation: To chain transfers on the same channel, the programmer must first load the address register with the starting address of the first 8 KB block and set the terminal count register to 8192. After the first transfer completes, the CPU (or an interrupt) reloads the address register with the start address of the second 4 KB block and updates the terminal count to 4096. Options B uses separate channels, C assumes auto‑reload which the 8257 does not provide, and D misinterprets the modulo function. Therefore option A correctly describes the required steps.
Q12. In a system where multiple masters can request the bus, how can the READY pin be utilized to prevent bus arbitration conflicts during overlapping requests?
📖 Explanation: In a system with multiple bus masters, the READY pin is used by the DMA controller to sense whether the bus is currently granted to another master. When READY is low, the bus is busy and the DMA controller holds off its request until the line goes high, preventing arbitration conflicts. Option A reverses the direction of control, option B is false because the controller monitors READY, and option D describes a function that does not exist. Hence the correct answer is that READY indicates the bus is busy, causing the DMA controller to defer its request.
Q13. A designer observes that after a DMA transfer, the memory contents are corrupted for the last 2 bytes transferred. Which pin or internal logic fault is most likely responsible, and how should the design be corrected?
📖 Explanation: If the last two bytes are corrupted, it often points to a timing problem where the DMA controller fails to properly acknowledge the channel before the final data phase ends. A faulty DACK signal can cause the peripheral to think the transfer is still ongoing, leading to incomplete write cycles. HRQ (option A) is related to bus arbitration, TC (option C) signals completion but does not affect individual bytes, and AEN (option D) deals with address bus control. Therefore the most likely cause is a DACK timing error.
Q14. A designer loads the address register with an odd address while the device requires word‑aligned addresses. What effect does this have on the transfer, and how can it be remedied?
📖 Explanation: The 8257 expects word‑aligned addresses for devices that transfer 16‑bit words. Loading an odd start address causes the low-order bit to be ignored, so the controller will read or write a byte at an unintended location, leading to corrupted data for the first and possibly the last bytes. The controller does not abort the operation (option A) nor does it add extra cycles (option B). It also cannot auto‑correct the address (option D). Hence the correct effect is data corruption due to misalignment.
Q15. If the terminal count register is loaded with the value and the DMA controller is started, how many bytes will actually be transferred before TC is asserted?
📖 Explanation: The terminal count register uses 14 bits for the byte count, so the maximum representable value is . Loading this value means the DMA controller will transfer 16 383 bytes before asserting the TC signal. Options B, C, and D exceed the 14‑bit capacity, and option A correctly reflects the maximum count achievable with the given register width.