uart communication issue with parity bit disabled

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

uart communication issue with parity bit disabled

跳至解决方案
2,470 次查看
creatorwonny
Contributor III

Hi

I already posted a question in the following link about issue in modbus communication that slave received one packet as several packets when master sends many data to the slave. The solution I found was setting the parity bit of uart to either even or odd instead of none. 

[NORMAL]

Rx:01 10 00 00 00 64 C8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D4 93

[ERROR]

Rx:01 10 00 00 00
Rx:64 C8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Rx:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D4 93

https://community.nxp.com/t5/i-MX-RT/Modbus-serial-communication-error-in-UART3-but-not-UART1-on/m-p...

I still don't understand why the issue can be solved by setting the parity. I tested the communication on my desk where there's almost no noise. So I believe the communication should work with parity bit disabled. Is there an issue in uart communication related to parity bit? Does anyone have idea how it can solve this issue?

[Information]

BOARD: iMXRT1060 EVK

SDK: 2.9.3

TOOL: Modbus Slave from www.modbustools.com

0 项奖励
回复
1 解答
2,465 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
The specification states that when using "no parity" that you use 2 stop bits (Taken from pages 6-7 in Modicon Modbus Protocol Reference Guide PI-MBUS-300 Rev. J).
This is essentially the same as using 1 stop bit with "mark parity".
Have a great day.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,466 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
The specification states that when using "no parity" that you use 2 stop bits (Taken from pages 6-7 in Modicon Modbus Protocol Reference Guide PI-MBUS-300 Rev. J).
This is essentially the same as using 1 stop bit with "mark parity".
Have a great day.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复
2,455 次查看
creatorwonny
Contributor III

Hi @jeremyzhou 

Thanks a lot for the information. I tested communication with setting of non-parity and 2 stop bits, and the communication worked very well. 

0 项奖励
回复