4955 views|7 replies

10

Posts

0

Resources
The OP
 

9-bit serial communication Linux how to receive data [Copy link]

Crotex A8 kernel linux4.1.18

Using RS232 serial communication, the microcontroller sends 9 data bits, the highest bit 1 represents the address, and the highest bit 0 represents the data

The A8 core board receives data. Currently, it can only correctly receive bytes with the highest bit of 0 representing data and the highest bit of 1 representing the address. The result of receiving bytes is 00

Q: How can I correctly receive the data sent by the microcontroller?

This post is from ARM Technology

Latest reply

Then you can only use software to implement a virtual serial port. Hardware serial ports have different modes, and the 9-bit parity check mode cannot ignore the check error. And your protocol compilation is also very non-standard. You should use the command byte parsing function and express it in bits, which seriously lacks communication reliability.   Details Published on 2022-4-1 20:47
 

4

Posts

0

Resources
2
 

It is recommended to read the datasheet, understand the RS232 protocol first, and then design the required timing according to the protocol.

This post is from ARM Technology
 
 
 

277

Posts

0

Resources
3
 

This is a standard duplex communication protocol, just write the program according to the protocol.

This post is from ARM Technology

Comments

Hello, our A8 core board needs to judge the highest bit (i.e. check bit) when receiving data. When the highest bit D8 is 1, D0-D7 represents the address; when the highest bit D8=0, D0-D7 represents the data; when I am receiving data sent by the microcontroller, the byte with D8=1 will report a check error  Details Published on 2022-3-29 18:11
 
 
 

10

Posts

0

Resources
4
 
angel_CN posted on 2022-3-28 22:34 It is recommended to read the Datasheet, understand the RS232 protocol first, and then design the required timing according to the protocol

Hello, I have read the Datasheet document, but did not find the corresponding solution

This post is from ARM Technology
 
 
 

10

Posts

0

Resources
5
 
Verifone posted on 2022-3-29 10:57 This is a standard duplex communication protocol. Just write the program according to the protocol.

Hello, our A8 core board needs to judge the highest bit (i.e. check bit) when receiving data. When the highest bit D8 is 1, D0-D7 represents the address; when the highest bit D8=0, D0-D7 represents the data; when I am receiving data sent by the microcontroller, the byte with D8=1 will report a check error

This post is from ARM Technology
 
 
 

1w

Posts

142

Resources
6
 

What the OP has mentioned is already in the scope of the protocol, which requires software judgment. 232 itself does not care what the high bits are, whatever comes is connected, and how to parse it is another matter. The problem encountered by the OP is obviously caused by a problem in the software parsing programming.

This post is from ARM Technology

Comments

Thank you for your reply. Now it is a software problem. The hardware is working. Now I set the parity check of the serial port parameter c_cflag to 0. Then I want to ignore the check error PE when receiving the byte with the highest bit as 1 and read the content of the RHR register.  Details Published on 2022-4-1 15:44
 
Personal signature上传了一些书籍资料,也许有你想要的:https://download.eeworld.com.cn/user/chunyang
 
 

10

Posts

0

Resources
7
 
chunyang posted on 2022-3-30 15:55 What the OP has mentioned is already in the scope of the protocol, which requires software judgment. 232 itself does not care what the high bit is, whatever comes is connected, how to parse it is another matter. ...

Thank you for your reply. Now it is a software problem. The hardware is OK.

Now I set the parity check of the serial port parameter c_cflag to 0, and then I want to ignore the check error PE when receiving the byte with the highest bit as 1, and read the contents of the RHR register.

This post is from ARM Technology

Comments

Then you can only use software to implement a virtual serial port. Hardware serial ports have different modes, and the 9-bit parity check mode cannot ignore the check error. And your protocol compilation is also very non-standard. You should use the command byte parsing function and express it in bits, which seriously lacks communication reliability.  Details Published on 2022-4-1 20:47
 
 
 

1w

Posts

142

Resources
8
 
Don't call you brother Xu Xiansen posted on 2022-4-1 15:44 Thank you for your reply. Now it is a software problem. The hardware is connected. Now I set the serial port parameter c_cflag parity check to the highest bit as 0...

Then you can only use software to implement a virtual serial port. Hardware serial ports have different modes, and the 9-bit parity check mode cannot ignore the check error. And your protocol compilation is also very non-standard. You should use the command byte parsing function and express it in bits, which seriously lacks communication reliability.

This post is from ARM Technology
 
Personal signature上传了一些书籍资料,也许有你想要的:https://download.eeworld.com.cn/user/chunyang
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list