π Programming of 8251A in 8085A Microprocessor (5 MCQs)
Software Configuration and Data Exchange with the 8251A
Programming the 8251A requires the 8085A to establish the serial format, enable the required functions and manage data transfers through its control and data ports. The mode instruction defines synchronous or asynchronous operation, character length, parity and timing factors. The command instruction controls transmission, reception, error resetting, modem outputs and other operating functions.
Control and Data Access Through the C/D Selection
With C/D high, the processor writes mode or command instructions and reads the status register. With C/D low, it writes transmit characters or reads received characters. The first control write after reset is interpreted as the mode instruction. Later control writes become command instructions unless a reset operation returns the device to initialization.
Readiness Checking and Character Transfer Instructions
Software checks status bit D0 before loading the transmit buffer and status bit D1 before reading the receive buffer. The 8085 can use IN to obtain status, ANI to isolate a bit and conditional branching to wait. OUT transfers a character to the transmitter, while IN from the data port fetches a received character.
Example of Mode and Command Word Programming
For eight-bit asynchronous operation, 16-times clock factor, no parity and one stop bit, write 4EH as the mode word. Then write 05H as the command word to enable TxEN and RxE. With CTS low and the clocks correctly supplied, the processor can transmit and receive data characters.
Managing Errors and Completion During Communication
The status register reports parity, overrun and framing errors, as well as ready and empty conditions. Software can clear the error flags by setting the Error Reset bit in a command instruction. It should read received data promptly, check transmission completion where required and maintain compatible settings with the communicating device.
Correcting Common Errors in 8251A Programming
'The command word must be written before the mode word' is incorrect because mode initialization comes first after reset. 'Received data is read with C/D high' is incorrect because data access requires C/D low. 'Writing a character clears all error flags' is incorrect because the Error Reset command bit performs that operation.
Instruction Sequences and Control-Word Values for Exams
Practise converting mode fields into hexadecimal and tracing the reset, mode and command sequence. Identify C/D values for control, status and character access. Trace status tests using D0 and D1, and explain how the Error Reset bit clears PE, OE and FE without confusing status reads with data reads.
8251A Programming and Register Terms
- Mode Word - Establishes serial format and timing.
- Command Word - Controls communication functions.
- 4EH - Example eight-bit asynchronous mode setting.
- 05H - Enables transmitter and receiver.
- D0 - Transmit-buffer status bit.
- D1 - Receive-buffer status bit.
π All Programming of 8251A in 8085A Microprocessor MCQs
Q1. Which pin on the 8257 DMA controller is used to signal a terminal count?
π Explanation: The terminal count pin (TC) indicates that the programmed number of bytes has been transferred, allowing the controller to stop the DMA operation. Option B is correct because TC is defined for this purpose. DRQ (A) is a request line, HLDA (C) acknowledges a bus hold, and READY (D) signals peripheral readiness, none of which indicate completion of a transfer. Recognizing TC helps designers correctly monitor DMA progress in real hardware.
Q2. What is the purpose of the two most significant bits of the 16βbit terminal count register in the 8257?
π Explanation: The two most significant bits of the terminal count register are reserved to specify the type of operation the device should perform on the channel, such as read or write. Therefore option B is correct. Selecting a channel (A) is done elsewhere, priority (C) is handled by separate priority logic, and interrupt enable (D) is not part of this register. Understanding this encoding ensures correct DMA mode configuration.
Q3. A system needs to transfer exactly 10β―KB of data using DMA channel 1. Which value should be loaded into the terminal count register?
π Explanation: Ten kilobytes equals bytes, which fits within the 14βbit limit of the terminal count field. Option A provides the exact count, while option B is a decimal approximation, option C exceeds the maximum 16β―K limit, and option D represents only 8β―KB. Loading the correct count ensures the DMA controller stops after the intended amount of data, preventing overβrun or underβrun in real applications.
Q4. If the DMA address register for channel 0 is loaded with 0x3C00 and the terminal count register is set to transfer 4β―KB, after the transfer completes, what will be the final address value in the address register?
π Explanation: A transfer of 4β―KB equals bytes. Adding this to the start address 0x3C00 yields 0x4C00, so option A is correct. Option B shows the unchanged start address, option C incorrectly adds only 0x0400, and option D is one byte short of the full range. Knowing the address progression is crucial when designing DMAβdriven memory moves, as it determines where the next operation should begin.
Q5. How does the HRQ (HOLD Request) pin interact with the microprocessor during a DMA operation?
π Explanation: When the DMA controller asserts HRQ, it asks the CPU to relinquish control of the system bus so the DMA can perform its transfer without contention. This makes option B correct. HRQ does not reset the CPU (A), does not signal transfer completion (C), and does not supply a clock (D). Recognizing the HRQ function helps engineers coordinate CPUβDMA handshaking in embedded systems.