Hello, I wrote a simple c program in keil to set the voltage on/off for two motors for 10 sec. But when i debug the program, it runs correctly till the end and at the last step of the code it returns to 1st line of main()again, performing all steps again.So the program seems to run for infinite time. Can you suggest me a solution. The same code when i copied and pasted it to another file and ran it on different pc it runs well!!>>?
PK51 really adds a default LJMP to Main. In C51 examples, the Blinky example has the while(1)around the entire code. This amounts to a LJMP to main so no additional code is added. But if you comment out the while(1) and ending brace, then PK51 will add the additional LJMP to main. Bradford
if this is anything to do with keil ('51, '16x, ARM)Main() is NOT supposed to or supported at exiting.
Erik