🎓 BookMCQ
← Back to 15. Applications of Microprocessor

📝 Real Time Clock with On/Off Timer in 8085 Microprocessor (32 MCQs)

Time-Based Scheduling with an External Real-Time Clock

A real-time clock (RTC) provides the 8085 microprocessor with the current time and, depending on the device, calendar information such as date and day. The microprocessor reads these values and compares them with programmed switching times. An associated on/off timer controls an external device according to the comparison, allowing scheduled operation without relying exclusively on software delay loops.

Clock Source, Time Registers and Interface Hardware

An RTC maintains time using a clock source, commonly a crystal oscillator, and stores seconds, minutes and hours in internal registers. Many devices also retain time through a backup battery. Interface logic connects the RTC to the 8085 through appropriate bus or serial connections, depending on the selected RTC device.

Comparing Current Time with Programmed Switching Times

The 8085 reads the RTC values, converts or interprets their stored representation, and compares them with the programmed ON and OFF times. When the ON condition occurs, software activates an output. At the OFF time, it clears that output. A separate flag prevents the same scheduled event from being executed repeatedly during one time interval.

Example of Operating a Device Between Two Scheduled Times

Suppose a controller must operate a pump from 08:00 to 08:30. The 8085 reads the RTC registers and checks the hour and minute. At 08:00 it activates the pump through an output driver; at 08:30 it deactivates it. The RTC continues maintaining time independently of the switching program.

Applications of Scheduled Switching and Countdown Control

Scheduled operation is useful for irrigation pumps, lighting systems, laboratory equipment and automatic appliances. The RTC supplies time-of-day information, while software determines the switching rules and duration. The 8255 programmable peripheral interface can provide additional input/output connections when the RTC, control switches and output drivers exceed the processor's available interface requirements.

Distinguishing Real-Time Clock Functions from Software Timing

'The 8085 contains an internal calendar clock' is incorrect because it requires an external timekeeping device. 'A software delay preserves the correct time after power loss' is incorrect because ordinary program delays do not provide battery-backed timekeeping. 'The RTC directly drives a pump' is incorrect because a suitable driver and switching circuit control the load.

RTC Register Reading and ON/OFF Conditions in Examinations

Identify the RTC time registers, interface method and backup supply. Trace how the processor reads time, compares hours and minutes, and changes an output at the scheduled boundaries. Distinguish an RTC from a programmable interval timer, and explain why output drivers and event flags are required for reliable scheduled switching.

Timekeeping and Scheduled-Control Terms

  • RTC - Maintains current time and date.
  • Crystal - Provides a stable clock reference.
  • Backup Battery - Preserves timekeeping when main power fails.
  • ON Time - Programmed activation time.
  • OFF Time - Programmed deactivation time.
  • Event Flag - Prevents repeated scheduled action.
8
Easy
14
Medium
10
Hard

📝 All Real Time Clock with On/Off Timer in 8085 Microprocessor MCQs

Q1. What is the purpose of the monitor program located at 0347 H in the real‑time clock design?

A.Clear the 7‑segment display
B.Initialize the timer registers ✅
C.Increment the seconds counter
D.Store the current time in RAM
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The routine at 0347 H is called before any display operation to erase any previous digits on the six FNDs, ensuring a clean start for the next update. Option B describes a different routine that sets up the timer, while Option C is performed by the time‑keeping loop, and Option D refers to a memory‑write routine. Clearing the display prevents residual segments from misleading the user, which is essential for a reliable clock interface.

Q2. How many seven‑segment displays (FNDs) are used to show hours, minutes, and seconds in the described clock system?

A.Four ✅
B.Six
C.Eight
D.Two
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The design employs six FNDs: four in the address field for hours and minutes, and two in the data field for seconds. Option A mentions only the hour‑minute displays, ignoring the seconds. Option C exaggerates the count, and Option D omits the hour‑minute portion. Using six displays allows a complete HH:MM:SS representation, which is necessary for a functional real‑time clock.

Q3. Which registers must be loaded with 00 h or 01 h before calling the display routine, and why?

A.A and B, to select address or data field ✅
B.C and D, to set timer mode
C.A and C, to enable interrupts
D.B and D, to reset counters
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The display routine checks registers A and B: a value of 00 h tells the monitor to read memory locations for the address field, while 01 h directs it to the data field. This selection determines whether hours/minutes or seconds are shown. Options B, C, and D refer to unrelated registers or functions, so they do not affect the display selection.

Q4. Why is it necessary to update the time every second in a digital clock implemented with an 8085 microprocessor?

A.To keep the displayed time synchronized with real time
B.To prevent overflow of the seconds register ✅
C.To refresh the LCD contrast
D.To trigger the watchdog timer
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Updating each second aligns the software counter with the passage of real time, ensuring the clock reflects actual hours, minutes, and seconds. While overflow handling (Option B) is also required, the primary reason is synchronization. Options C and D describe unrelated hardware functions that are not part of the basic time‑keeping loop.

Q5. In the timer routine, what is the effect of executing the instruction INX H when the seconds register reaches 60?

A.It resets seconds to 00 and increments minutes ✅
B.It clears the display completely
C.It halts the microprocessor
D.It writes the time to EEPROM
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When the seconds count reaches 60, the routine uses INX H to add one to the minutes memory location and then stores 00 h back into the seconds location, effectively rolling over the seconds and advancing minutes. Options B, C, and D describe actions that are not part of the normal roll‑over process in a clock implementation.

Q6. If the on/off timer is set to turn a device on at 07:30 am and off at 19:45 pm, which memory locations must contain the start and stop times respectively?

A.2050 H for start, 2053 H for stop
B.2051 H for start, 2054 H for stop
C.2052 H for start, 2055 H for stop
D.2050 H for stop, 2053 H for start ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The monitor program displays memory 2050 H‑2055 H sequentially: 2050 H‑2051 H hold the hour and minute of the start time, while 2053 H‑2054 H hold the hour and minute of the stop time. Therefore the correct pairing is start at 2050 H and stop at 2053 H. Options B and C shift the locations, and Option D reverses the order, leading to incorrect timing behavior.

Q7. Which of the following best describes how the on/off timer functionality is achieved in the 8085 design?

A.By comparing the current time with preset start/stop values and toggling an output line ✅
B.By using a hardware relay that follows the seconds counter
C.By generating a PWM signal whose duty cycle represents the on period
D.By storing a countdown value that decrements each minute
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The timer logic continuously reads the current HH:MM from memory and checks whether it matches the preset start or stop values; when a match occurs, the program sets or clears an output pin that drives the external load. Options B, C, and D describe hardware techniques not implemented in the given software‑centric design.

Q8. A student modifies the program so that the seconds display increments by 2 each cycle. What unintended effect is most likely to appear?

A.The clock will run twice as fast, skipping odd seconds
B.The display will show blank segments ✅
C.The minutes will never increment
D.The hour counter will overflow after 12 hours
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Increasing the seconds counter by 2 each iteration causes the software clock to advance 2 seconds per real second, effectively doubling the speed and omitting every other second from the display. This does not blank the display (Option B), nor does it stop minute or hour updates (Options C and D), which still occur based on the altered seconds count.

Q9. During testing, the clock stops updating after reaching 23:59:59. Which programming mistake most likely caused this behavior?

A.Missing a wrap‑around from 23 h to 00 h in the hour register
B.Using BCD instead of binary for seconds ✅
C.Failing to increment the minutes register
D.Leaving the display routine uninitialized
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: If the hour register is not reset after 23 h, the program will never satisfy the condition to continue counting, causing the update loop to stall. Using BCD (Option B) is acceptable if handled correctly, and the minutes increment (Option C) is unrelated to the observed halt. An uninitialized display routine (Option D) would affect output, not the counting logic.

Q10. What is the primary advantage of using the Vinytics kit’s ROM/EPROM monitor programs at 0347 H and 05D0 H instead of writing custom display code?

A.They provide tested, bug‑free routines that reduce development time ✅
B.They increase the clock’s accuracy by hardware timing
C.They allow the microprocessor to operate at higher clock speeds
D.They enable wireless communication with the display
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The built‑in monitor routines are pre‑verified to clear the display and show memory contents, so designers can focus on time‑keeping logic rather than low‑level display handling. This saves development effort and avoids introducing new bugs. Options B, C, and D describe capabilities not offered by those ROM routines.

Q11. Which instruction pair correctly saves the current hour and minute before incrementing the seconds counter?

A.MOV M,A followed by INX H
B.LDAX B followed by DCR B
C.STA 2050 H followed by INX H ✅
D.PUSH B followed by POP D
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: STA 2050 H stores the accumulator (which holds the hour) into memory location 2050 H, and INX H then moves the HL pair to the next address for the minute. This sequence correctly preserves the hour‑minute pair before the seconds are updated. Options A, B, and D involve unrelated registers or stack operations that do not achieve the required memory storage.

Q12. If the on/off timer is required to activate a motor for exactly 3 hours and 15 minutes each day, which combination of start and stop times should be programmed?

A.Start 06:00 am, Stop 09:15 am ✅
B.Start 12:00 pm, Stop 03:15 pm
C.Start 18:30 pm, Stop 21:45 pm
D.Start 00:00 am, Stop 03:15 am
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Starting at 18:30 pm and stopping at 21:45 pm yields a duration of 3 hours 15 minutes, matching the requirement. Option A provides a 3 hour 15 minute interval but earlier in the day; however the question does not restrict the time of day, so Option C is a correct example. Options B and D either give the wrong interval length or start at midnight, which may be undesirable for many applications.

Q13. Why must registers A and B be set to either 00 h or 01 h before invoking the display routine?

A.The routine uses these values as flags to select address or data field display ✅
B.They initialize the timer prescaler
C.They enable interrupt handling for the clock
D.They set the microprocessor’s power‑down mode
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The monitor routine interprets the contents of A and B as selectors: 00 h tells it to fetch memory locations for the address field (hours/minutes), while 01 h directs it to the data field (seconds). This flag mechanism simplifies the routine. Options B, C, and D describe unrelated initialization tasks that are not part of the display selection process.

Q14. During a simulation, the seconds display flickers intermittently. Which hardware or software factor is the most plausible cause?

A.Missing debounce on the external clock input causing irregular increments
B.Using an incorrect BCD conversion routine ✅
C.Overloading the address bus with too many peripherals
D.Running the microprocessor at a frequency lower than 1 MHz
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: If the external clock signal that drives the seconds counter is not properly debounced, the microprocessor may receive spurious pulses, leading to occasional double‑increments or missed ticks, which appear as flickering. Incorrect BCD conversion (Option B) would affect digit values, not timing stability. Bus overload (Option C) and low clock speed (Option D) would not produce intermittent flicker in the seconds display.

Q15. A design requires the clock to display time in 12‑hour format with AM/PM indication. Which additional step is needed in the software?

A.Convert hour values greater than 12 to hour ‑ 12 and set a flag for PM
B.Replace the seven‑segment decoder with a 14‑segment one ✅
C.Add a hardware divider to generate the AM/PM signal
D.Increase the oscillator frequency to 2 MHz
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: To switch from 24‑hour to 12‑hour format, the program must detect hour values above 12, subtract 12, and set a separate flag that drives an AM/PM indicator on the display. Changing the decoder (Option B) does not perform the arithmetic conversion, and a hardware divider (Option C) is unnecessary because the conversion is purely logical. Raising the oscillator frequency (Option D) does not affect the display format.

Q16. Which memory locations (2050 H–2055 H) are used to store the current time, and what does each hold?

A.2050 H = hour, 2051 H = minute, 2052 H = second tens, 2053 H = second units, 2054 H = unused, 2055 H = unused
B.2050 H = hour tens, 2051 H = hour units, 2052 H = minute tens, 2053 H = minute units, 2054 H = second tens, 2055 H = second units ✅
C.2050 H = hour, 2051 H = minute, 2052 H = second, 2053 H = unused, 2054 H = unused, 2055 H = unused
D.2050 H = seconds, 2051 H = minutes, 2052 H = hours, 2053 H = unused, 2054 H = unused, 2055 H = unused
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The monitor routine expects six consecutive bytes: hour tens and units are stored at 2050 H and 2051 H, minute tens and units at 2052 H and 2053 H, and second tens and units at 2054 H and 2055 H. Option B matches this arrangement. Options A, C, and D misplace the fields, leading to incorrect time representation on the display.

Q17. What is the effect of setting register A to 01 h and register B to 00 h before calling the display routine?

A.The routine will display the seconds field only
B.The routine will display the hour and minute fields only ✅
C.Both fields will be displayed simultaneously
D.The display will be cleared before showing any data
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: When A = 01 h, the monitor interprets the request as a data‑field display, which corresponds to the seconds digits. Register B = 00 h is ignored for this selection. Thus only the seconds are shown. Option B describes the opposite selection, Option C is not supported by the routine, and Option D would require calling the clear routine at 0347 H, not the display routine.

Q18. If the clock is to be powered by a battery that supplies 5 V, which voltage regulator configuration ensures stable operation of the 8085 and the display?

A.Use a 5 V linear regulator to feed both the microprocessor and the FND driver
B.Use a 12 V regulator and step‑down converter for the microprocessor only
C.Connect the battery directly to the 8085 without regulation ✅
D.Use a 3.3 V regulator for the microprocessor and boost to 5 V for the display
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: A 5 V linear regulator provides a clean, stable supply that matches the 8085’s required voltage and also powers the seven‑segment driver circuitry, preventing voltage fluctuations that could cause timing errors. Options B and D introduce unnecessary conversion stages, and Option C risks brown‑out or over‑voltage conditions, compromising reliability.

Q19. During debugging, a student observes that the minute value never changes from 00. Which logical error most likely explains this behavior?

A.The minutes increment code is placed after an unconditional jump that bypasses it
B.The seconds register is never reset to 00 after reaching 60 ✅
C.The hour register is incorrectly used to store minutes
D.The display routine overwrites the minute memory locations each cycle
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: If the program jumps over the minutes‑increment block after handling seconds, the minute value will never be updated, remaining at 00. Resetting seconds (Option B) is necessary but does not affect minute increments. Using the hour register for minutes (Option C) would corrupt hour data, while overwriting minutes each cycle (Option D) would cause rapid changes, not a static zero.

Q20. Which of the following statements correctly explains the role of BCD (Binary‑Coded Decimal) in the clock’s display logic?

A.Each decimal digit is stored in a 4‑bit nibble, simplifying conversion to seven‑segment patterns
B.BCD allows the clock to run at twice the speed of a binary counter
C.BCD reduces power consumption by half compared to binary representation
D.BCD enables direct interfacing with the monitor’s ROM routines without conversion ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: BCD stores each decimal digit (0‑9) in a 4‑bit group, making it straightforward to map the value to the corresponding seven‑segment pattern for display. Options B and C are unrelated to BCD’s purpose, and Option D misstates the need for conversion; the monitor routine still expects BCD values for proper digit rendering.

Q21. A designer wants the on/off timer to activate a load only when the current minute is a multiple of 5. Which logical condition should be added to the program?

A.IF (MIN MOD 5) = 0 THEN TURN ON ✅
B.IF MIN AND 0x05 = 0x00 THEN TURN ON
C.IF MIN XOR 5 = 0 THEN TURN ON
D.IF MIN SHIFT‑RIGHT 1 = 0 THEN TURN ON
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Testing the lower three bits of the minute value with an AND mask of 0x05 isolates the bits that determine divisibility by 5; when the result is zero, the minute is a multiple of 5. Option A describes a high‑level modulo operation not directly available in 8085 assembly. Option C uses XOR incorrectly, and Option D shifts bits unrelated to the divisor, making them unsuitable.

Q22. What is the consequence of neglecting to debounce the external push‑button that sets the on/off timer start time?

A.Multiple rapid toggles may be registered, causing an incorrect start time to be stored
B.The microprocessor will enter an infinite loop
C.The display will show blank segments for the hour field
D.The clock will lose synchronization with real time ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: A mechanical button can generate several voltage transitions when pressed, and without debouncing the program may record several successive increments, resulting in a start time that differs from the intended value. Options B and C describe unrelated failures, and Option D concerns the time‑keeping loop, not the button input.

Q23. Which instruction sequence correctly implements a one‑second delay using the 8085’s built‑in instruction timing, assuming a 3 MHz clock?

A.MVI C,0x3E → DCR C → JNZ -2 ✅
B.MVI B,0xFF → DCR B → JNZ -2
C.MVI A,0x00 → INX H → JMP -3
D.MVI D,0x3E → DCR D → JNZ -2
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: At 3 MHz each machine cycle takes 13 MHz=0.33 μs\frac{1}{3\,\text{MHz}} = 0.33 \mu\text{s}. The MVI, DCR, and JNZ instructions together consume about 7 cycles, so 0x3E (62) iterations produce roughly 62 × 7 × 0.33 μs≈1 ms62 × 7 × 0.33 \mu\text{s} ≈ 1 \text{ms}. Repeating this loop 1000 times yields a one‑second delay. Option A shows the correct register and loop count; Options B, C, and D either use wrong registers or lack the appropriate iteration count.

Q24. If the on/off timer must be disabled during a maintenance window from 02:00 am to 02:30 am, which programming approach ensures the output line stays low during that interval?

A.Add a condition that forces the output low when hour = 02 and minute ≤ 30
B.Replace the timer routine with a NOP instruction for 30 minutes ✅
C.Use a hardware switch to manually disconnect power during the window
D.Increase the seconds counter to skip the interval
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: By checking the current hour and minute values each cycle, the program can force the control line to a low state whenever the time falls within 02:00‑02:30, effectively disabling the load. Option B would halt the entire clock, Option C requires external hardware not described in the design, and Option D manipulates the seconds counter without guaranteeing the line stays low for the full half‑hour.

Q25. Which of the following best explains why the clock uses six separate FNDs instead of a single multi‑digit display module?

A.Separate FNDs simplify wiring and allow independent control of each digit
B.A single module cannot display seconds accurately ✅
C.Multiple FNDs reduce power consumption compared to one large display
D.The kit does not support multi‑digit modules
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Using individual seven‑segment units lets the designer address each digit directly via memory locations, making it easy to update hours, minutes, and seconds independently. Option B is inaccurate because a single module could still show seconds, Option C is false—more LEDs generally increase power, and Option D is irrelevant; the kit can drive multiple digits, but separate FNDs are chosen for simplicity.

Q26. When the clock reaches 23:59:59 and rolls over to 00:00:00, which registers must be cleared to avoid residual values?

A.Hour, minute, and second registers all reset to 00 h
B.Only the second register is cleared; hour and minute remain unchanged ✅
C.The carry flag must be reset, but registers stay as is
D.No registers need clearing because the program handles rollover automatically
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: At midnight the program must explicitly set hour, minute, and second memory locations to 00 h; otherwise leftover values would cause an incorrect display. Option B would leave the hour at 23, Option C misidentifies the issue as a flag problem, and Option D is wrong because the software does not automatically clear the registers without explicit instructions.

Q27. Why is it important to initialize the stack pointer (SP) before entering the main time‑keeping loop?

A.The stack is used for subroutine calls; an undefined SP can corrupt memory ✅
B.The SP determines the clock frequency
C.The SP controls the on/off timer output line
D.The SP sets the display brightness
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A proper SP value points to a safe RAM area, ensuring that when the program calls subroutines (e.g., for display or delay) the return addresses are stored correctly. An undefined SP could overwrite time data, causing erratic behavior. Options B, C, and D describe functions that the SP does not influence.

Q28. If the designer wants to add a feature that beeps every minute, which additional hardware and software modification is required?

A.Connect a buzzer to an output pin and toggle it each time the minute register increments
B.Replace the seven‑segment decoder with an audio decoder
C.Increase the oscillator frequency to generate audible tones directly
D.Add a second microprocessor dedicated to sound generation ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: A simple buzzer driven by a GPIO pin can be turned on when the minute counter rolls over, producing a beep each minute. The software must detect the minute increment and pulse the pin. Options B and C involve unnecessary hardware changes, and Option D adds complexity not needed for a basic audible alert.

Q29. Which statement correctly describes how the on/off timer interacts with the real‑time clock to control an external load?

A.The timer checks the current HH:MM against preset limits and sets a control line high or low accordingly ✅
B.The timer uses a separate oscillator to decide when to turn the load on
C.The timer directly writes the load state into the memory locations 2050 H‑2055 H
D.The timer relies on user input each second to manually toggle the load
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The program continuously compares the stored start and stop times with the current clock values; when a match occurs, it drives an output pin that switches the external device on or off. Options B, C, and D describe mechanisms that are not part of the described software‑controlled timer logic.

Q30. What is the effect of using BCD addition instead of binary addition for the seconds counter?

A.The counter correctly rolls over from 59 to 00 without extra correction logic ✅
B.The counter will count up to 99 before rolling over
C.The counter will skip odd seconds
D.The counter will cause a hardware overflow error
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: BCD addition automatically handles the decimal limit of 59, so when the lower digit reaches 9 and the next increment occurs, the routine carries to the tens digit and resets to 00, eliminating the need for separate overflow checks. Binary addition would count to 255 before rolling over, requiring additional code. Options C and D are incorrect consequences of using BCD.

Q31. If the clock’s oscillator drifts by +5 seconds per hour, what correction method can be applied in software to maintain accuracy?

A.Periodically subtract one second from the counter every 12 minutes
B.Increase the delay loop by adding extra NOPs each minute
C.Replace the oscillator with a crystal resonator
D.Ignore the drift; the error is negligible ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: A drift of +5 s/h equals about one extra second every 12 minutes (since 12 min × 5 s/h = 1 s12 \text{min} × 5 \text{s/h} = 1 \text{s}). By subtracting a second from the software counter at that interval, the clock’s displayed time stays aligned with real time. Options B and C involve hardware changes, while Option D dismisses the error, which would accumulate noticeably over a day.

Q32. Which of the following is a valid reason to use the monitor program at 05D0 H after updating the memory locations for time?

A.It refreshes the six FNDs with the new hour, minute, and second values ✅
B.It writes the new time to non‑volatile storage
C.It resets the microprocessor to start from address 0000 H
D.It disables the on/off timer until re‑enabled
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The routine at 05D0 H reads the six consecutive memory locations (2050 H‑2055 H) and drives the six seven‑segment displays to show the updated time. Options B, C, and D describe actions that are not performed by this display routine.

🔗 Related Topics (MCQs)