- This topic has 2 replies, 2 voices, and was last updated 11 years, 5 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › LCD display for 8051 F340
I have written some assembly code for a digital clock.
As far as I can tell the timer works properly.
; Timer2_ISR:
;
; Every 0.2 seconds this ISR will be called.
; You will need to add code to take action during this IRS.
;
;*****************************************************************************
T2ISR:
; ADD YOUR TIMER2 ISR CODE HERE!!!!
clr TF2H ; Clears Timer 2 flag because unlike
; timers 0 & 1 the hardware does not
; clear timer 2 flag automatically
; during an ISR
DJNZ 50H, FIVE ; 5 TIMES COUNTER FOR 1 SECOND TIMER
MOV 50H, #5 ; RELOAD 50H
INC TIME_SECOND ; +1 SECOND
DJNZ 55H, FIVE ; 60 SECONDS COUNTER
MOV 55H, #60 ; RELOAD 55H
INC TIME_MINUTE ; +1 MINUTE
DJNZ 56H, FIVE ; 60 MINUTES COUNTER
MOV 56H, #60 ; RELOAD 56H
INC TIME_HOUR ; +1 HOUR
DJNZ 57H, FIVE ; 13 HOURS COUNTER
MOV 57H, #13 ; RELOAD 57H
FIVE: reti ; Return to “where ever” from interrupt
I am having trouble having it display to my LCD.
I know I would have to use a sub-routine to call the display; or maybe use push and pop. I am not sure….
Hi Cory.,.,
I am Dinesh And I am Working on 8051F340 Since last 6 months
You should use Timer0 for generating Desired delay. There is same mathod which is used in
Hello Denish,
Thank you for taking the time to try and assist me, but I do not see the rest of your post. It ends at “the same method as in”…
Thanks regardless haha.