Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can I make a 1/2 sec delay in 89c51 using Keil C?

Status
Not open for further replies.

syrax

Full Member level 3
Joined
Sep 15, 2005
Messages
183
Helped
11
Reputation
22
Reaction score
3
Trophy points
1,298
Activity points
2,620
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++);
}

Thanks :))
 

how to calculate delay in 89c51 using c

use this little application to generate the exact delay u want..it is in assembly code..u can embedded the assembly code in C.
 

delay in c code in 89c51]

10x it's coll, i try it but have a problem when insert asm i C code
:))
 

Delay in 89c51

there is asm directive to do so.....looks something like #asm Look in the manual for details....
 

Re: Delay in 89c51

hi ,

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.
 

Re: Delay in 89c51

hi

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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top