I m able to generate till 9sec Since register limit is 8 bit.
For 1 min ,I need two registers so as to create 1 min delay. Like R0=210& R1=8
But I m not able to form a loop.
a good program is called time8051. **broken link removed**
you just enter your clock speed, and the amount of microseconds, and you have the source code in assembly.
For a 60 second delay, enter 60000000 microseconds.
Here is the code output for an 11.0592 clock:
Code:
; INPUT CLOCK VALUE IN MEGAHERTZ...: 11.0592
; WANTED TIME DELAY IN MICROSECONDS: 60000000
; CLOCK CYCLE TIME................ : 90 ns
; PROCESSOR CYCLE TIME (12)....... : 1085 ns
; TOTAL REQUIRED CYCLES........... : 55296000
; TOTAL TIME (INCLUDING CALL)..... : 60000.0 mS
; USE THE FOLLOWING CODE:
...
CALL TT0
...
...
TT0:MOV VAR4,#2
MOV VAR3,#166
MOV VAR2,#223
MOV VAR1,#117
TT1:DJNZ VAR1,TT1
DJNZ VAR2,TT1
DJNZ VAR3,TT1
DJNZ VAR4,TT1
RET
rename "var" to r.
I would then run the code with an 8051 simulator to verify that it is correct.
Hey guys I tried al ur ways but didnt able to generate 1 min delay.
My clock freq is11.0592 .Below mention code is working for 5 seconds delay.
Actually I want to make a timer which ll be on an instant and will be of after 5min or 5 days. So looking for ur help.