This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

serial communication problem

sir.,
i wrote the following code in keil compiler., but eventhough i didnt specified while loop.,the code is executing in infinite loop. may i know y ?

my code:

#include <reg51.h>

void main()

{

TMOD = 0x20;
SCON = 0x50;
TH1 = 0XFD;
TR1 = 1;
TI = 1;
printf ("Hello World\n\r");
TI=0;
}

Parents
  • What do you think happens when the program leaves main()?

    Do you think there are some command line prompt that will show up, waiting for a program command to execute?

    An embedded application using the standard Keil startup files are never expected to exit. In this case, the code will restart again and again - but having a main() that exists is int this specific case not allowed. Another version of the Keil tools could just as well do something else - hang after end of main() or run random instructions found in the memory.

Reply
  • What do you think happens when the program leaves main()?

    Do you think there are some command line prompt that will show up, waiting for a program command to execute?

    An embedded application using the standard Keil startup files are never expected to exit. In this case, the code will restart again and again - but having a main() that exists is int this specific case not allowed. Another version of the Keil tools could just as well do something else - hang after end of main() or run random instructions found in the memory.

Children