We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi!i want to know how to to give a delay of 0.1 second in keil assembley of 8051 microcontroller, using timers. it would be great if any of you could help, esp with the code. i can give small delays easily but this is somewhat large....i have a project due and i am stuck at this. thankyou in advance:)
A stopwatch have a fast hand that runs around the face many times. So you have a slower hand that counts number of times the fast hand have gone around.
Same with timers. The timer ticks comes quickly. So just as Erik said - inside the ISR you count up a variable to know how many interrupts you have had. With a 8-bit counter, you can count 0..255 interrupts. With a 16-bit counter, you can count 0..65535 interrupts. So no problem at all to measure times thousands or millions or quadrillions of times longer than the timer interrupt period.
A normal digital watch can only count 0..59 for seconds. But it still manages to handle time longer than that. Every overflow counts as a minute. Every minute overflow counts as an hour. Every hour overflow counts as a day.
So back to you - why do you think you need a loop?
thankyou so very much:) i wanted to use looping because i thought that if a smaller delay func is called many times, it would be equivalent to a larger delay. and also would you mind explaining what is delay over head??and roll over?? thankyou again:)i wouuld be grateful.