Home > other >  STC15W serial communication, serial port communication (65536 - (FOSC/4/BAUD))
STC15W serial communication, serial port communication (65536 - (FOSC/4/BAUD))

Time:11-01

Everybody is good! I am a novice, 51 single-chip microcomputer serial port communication is not very well, ask the following (FOSC/4/BAUD)), why here except 4, thought for a long time all don't understand,
T2L=(65536 - (FOSC/4/BAUD));//set the baud rate reshipment value
T2H=(65536 - (FOSC/4/BAUD)) & gt;> 8;
AUXR |=0 x14;//T2 for 1 t mode, and start the timer 2
IE2=0 x01;//can make a serial port interrupt
2-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

CodePudding user response:

Check the building Lord, MCLKO_S1 and MCKO_S0 is 1, so frequency is 4 frequency division,
  • Related