Current location - Quotes Website - Team slogan - What will happen if the serial port of 32 single chip microcomputer accepts data greater than 255?
What will happen if the serial port of 32 single chip microcomputer accepts data greater than 255?
The data will be inaccurate.

1. For serial communication, you press 9600, n, 8, 1, that is, 8-bit data (binary 2 to the eighth power 0-255), and the maximum is 0xff, that is, 10, that is, the base number is 255.

2. If there is data greater than 255, such as 256, it is 0x 100. And your receiver only receives 00.

3. Therefore, if two 8-bit registers need to send data through 255, three 8-bit registers need to send data through 65535.

4. Then, on the receiving side, for example, R0, R 1 is used, where R0 is the lower 8 bits and R 1 is the upper 8 bits.

5.c, you need to define an appropriate register size, such as char within 255.