Question: I implemented the program but there are errors like r 0 is an invalid operand. and i tried to solve the errors through chatgpt but
I implemented the program but there are errors like ris an invalid operand.
and i tried to solve the errors through chatgpt but the digital clock is not visible on edsimmicrocontroller Pls help me with this solution
As you can see there is no output on lcd module as well as on segment display
I want a digital clock using segment display or lcd module on edsim. I should be hh:mm:ss
Code you have given is:
ORG H ; Origin SJMP MAIN ; Jump to main program ORG BH ; Timer interrupt vector AJMP TIMERISR ; Jump to Timer ISR MAIN: MOV TMOD, #H ; Timer in mode bitMOV TH#EH ; Load high byte for sec delay MOV TL#H ; Load low byte for sec delay SETB TR; Start Timer SETB ET; Enable Timer interrupt SETB EA ; Enable global interrupts MOV R#H ; Initialize seconds MOV R#H ; Initialize minutes MOV R#H ; Initialize hours DISPLAYLOOP: CALL DISPLAYTIME ; Display current time SJMP DISPLAYLOOP ; Repeat TIMERISR: CLR TR; Stop Timer MOV TH#EH ; Reload high byte MOV TL#H ; Reload low byte INC R; Increment seconds CJNE R#EXITISR ; Check if seconds reached CLR R; Reset seconds INC R; Increment minutes CJNE R#EXITISR ; Check if minutes reached CLR R; Reset minutes INC R; Increment hours CJNE R#EXITISR ; Check if hours reached CLR R; Reset hours EXITISR: SETB TR; Restart Timer RETI ; Return from interrupt DISPLAYTIME: MOV AR; Move hours to accumulator CALL DISPLAYDIGIT MOV AR; Move minutes to accumulator CALL DISPLAYDIGIT MOV AR; Move seconds to accumulator CALL DISPLAYDIGIT RET ; Return from subroutine DISPLAYDIGIT: ;; Code to display digit on sevensegment implement multiplexing hereRET END ; End of program
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
