Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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
8051 has build in timer hardware to count time while doing another job! Thats why you have to use interrupt!But I want to use hardware to count time, it is because the 8051 is doing another job at the same time!
If you want to use interrupt, i'll write sample code for you.the µc(8051) without using interrupt