I got the Keil codes form somewhere and modified it a little. Wait function was carrying ; there also! If it is wrong then please give me the correct code? What about time delay?
Why not use the timer for delay? I recommend my solution in actual project. I use a timer to compute the delay. set the controller to power saving mode. if the timer decrease to 0, trigger the timer interrupt serving code, which is a return. and return to the next instruction of the main program.
You dont need wait func at all, inthis case I aways use this:
for (i=0;i<10000;i++)
{
}
Program counting i from 0 to 10000, so you made wait func, witout wait func.
Should you consider to use interrupts for waiting (in serious aplications), couse your program will stop in that point untill i rich 10000, so everything else will be stoped for that time.
Thanks for suggestion, still this doesn’t solves my problem. My hardware is working fine, and problem seems to be on the software side. Here is the hex which I get after compilation
hai
Hope you have added a wait after clearing the port to 0 also.
Instead of HEX check the disassembly window in keil and see how the code is compiled and see if programe is ok in simulator.
How the output is now?
Picstudent