i have made a program /blinking led/ but i think its too fast, how can i make a 1/2 sec delay using Keil C
My chip is 89c51 on 4Mhz /i dont know how to calculate a speed/
for (i=0; i<????????; i++){
for(j=0; j<?????; j++);
}
to calculate time, you can never use these "for loops" to adjust accurate timing. you should use one of the timers on board of the 89c51 chip that you use. this is the only way to achieve accurate timing. if you need further help please send me and i'll provide help for using timers.
ezshereef is right, you have 2 timers inside the AT89c51. timer 0 and timer 1, you cane use them to generate very accurate delay or scheduled events, they are easy to use.
keil has simulation to these timers you can use to calculat the delay u want
best regards
Ahmed