POFDel equ 250 ;Desired delay in milliseconds
POFDel1:
mov R5,#((Crystal*POFDel)/6180000) ;Work out the djnz delay value
POFDel2:
; mov R4,#0
POFDel3:
djnz R4,POFDel3 ;This inside loop takes 515 cycles
djnz R5,POFDel2 ;This loop happens the correct number of times
; to get closest to the desired delay in ms
ret ;Return when delay is complete
for 250 ms then run it 240 times and you will have a delay of ≈ 1s ..
Hi,
get the number by dividing the 1min time to time period of the clock of the processor. after getting the number, u put in the loop and increment the number until it reaches that number. now the time will be one min...