Home > other >  Is the purpose of the program to MCU send a 0 x33 to PC, but why has been repeated, and comment out
Is the purpose of the program to MCU send a 0 x33 to PC, but why has been repeated, and comment out

Time:10-02

#include
Void init ()
{
TMOD=0 x20;//set the timer 1 is the way to work 2
TH1=0 xe8;//initial value, a serial port baud rate 1200
TL1=0 xe8;
TR1=1;
SM0=0;//set the serial port to work 1
The SM1=1;
REN=1;
EA=1;
//ES=1;
}

Void main ()
{
The init ();
SBUF=0 x33;
//while (! TI);
//TI=0;

}

CodePudding user response:

Looking forward to the great god answer, thank you thank you, sent SBUF principle is not very good!

CodePudding user response:

Looking forward to the great god answer, thank you thank you, sent SBUF principle is not very good!

CodePudding user response:

Online waiting for, thank you thank you!!!!!!

CodePudding user response:

MCU without halt instruction, the main () performed will continue to perform the back of the unknown instruction until the restart

 void main () 
{
The init ();
SBUF=0 x33;
//while (! TI);
//TI=0;
while(1);
}

CodePudding user response:

reference 4 floor dceacho response:
microcontroller without halt instruction, the main () performed will continue to perform the back of the unknown instruction until the restart

 void main () 
{
The init ();
SBUF=0 x33;
//while (! TI);
//TI=0;
while(1);
}

Ok, I will try, thank you thank you

CodePudding user response:

reference 4 floor dceacho response:
microcontroller without halt instruction, the main () performed will continue to perform the back of the unknown instruction until the restart

 void main () 
{
The init ();
SBUF=0 x33;
//while (! TI);
//TI=0;
while(1);
}

Is this reason, a rookie in this thank you very much??

CodePudding user response:

Ha ha, children will be very rookie mistakes,

Microcontroller procedures must be in accordance with the following format to write

Int main (void)
{
Initialization;

While (1)
{
Repeat the code;
}
}



CodePudding user response:

refer to 7th floor ba_wang_mao response:
haha, children will be very rookie mistakes,

Microcontroller procedures must be in accordance with the following format to write

Int main (void)
{
Initialization;

While (1)
{
Repeat the code;
}
}

Yes, rookie are trying to learn
  • Related