how can i generate delay time such as 1 ms or 10 ms or 1 second ..any..using timer 0 or 1 of 8051??
plz give me the code..
thank you
Comments on ‘’ how to delay using 8051 timer 1 or 0? ‘’ ( 1 )
0
Says:
[quote=Timothy post_id=202 time=1488362239 user_id=79]
how can i generate delay time such as 1 ms or 10 ms or 1 second ..any..using timer 0 or 1 of 8051??
plz give me the code..
thank you
[/quote]
sir
top:first you make the timer as 16 bit timer ie mode 1
give the the value for 50 ms ie hex of 50000
give 20 to any register
start the timer with gate
when timer overflows,decriment the register and jump back to top when the register value becomes 0,you will get a dalay of 1 sec
pls check the crystal frequency.this is for 12 mhz.
Also check: [url=http://www.theengineeringprojects.com/2016/01/use-timer-interrupt-8051-microcontroller.html]HOW TO USE TIMER INTERRUPT IN 8051 MICROCONTROLLER[/url]
Reply
top:first you make the timer as 16 bit timer ie mode 1
give the the value for 50 ms ie hex of 50000
give 20 to any register
start the timer with gate
when timer overflows,decriment the register and jump back to top when the register value becomes 0,you will get a dalay of 1 sec
pls check the crystal frequency.this is for 12 mhz.
Also check:
[url=http://www.theengineeringprojects.com/2016/01/use-timer-interrupt-8051-microcontroller.html]HOW TO USE TIMER INTERRUPT IN 8051 MICROCONTROLLER