Anyone can help me to check the simple code (the program is work).
The problem is when i using Keil to simulate the result is.. 1.029805sec at 1000 looping but...when practically is not ~1sec (it take more then few min).
So, i change it to 1 at DELAY_T0_Wait(1); then in practical the result nearly to ~1sec.
Very happy you can explain to me but i still got a bit blur blur..., please can you help me to modified my code. So, i can study/try from the code, if i still not understand it so we come and discuss more further can we?
I can't see anything wrong with this code (from Chapter 6: "Meeting real-time constrains", Embedded C), even if it doesn't use interrupts ..
Can you post the compiled code which you try to use in real microcontroller ..
Regards,
IanP
I am using that i post it to run it in real microcontroller. Only the different with the code is.. the book is given DELAY_T0_Wait(1000); then i change it to DELAY_T0_Wait(1); because if i using the book given value i can't achieve ~1sec in real microcontroller.
So, you mean that is no problem with the code when you using my code? you got change the N=1000 or N=1 on code then run it in practical way? At N=1000 the code i need to wait the pin1.0 with LED blinking very long...what's the broblem?? Is it my hardware problem??
I have tried the N=1000 option and the resultant square wave has ≈0.7s period ..
So, more than less it is manageable ..
On the other hand why your 89C52 behaves differently .. I really don't know ..
Regards,
IanP