Skip to main content
ykn
Associate III
February 28, 2022
Question

How to receive unknown byte of data in stm32h743 series for modbus?

  • February 28, 2022
  • 2 replies
  • 1437 views

Hi ,

I want to use my controller as a modbus slave.

there is interrupt call back function which receive predefine data.

but the modbus function like 15,16 have 10 to 11 byte of data and other function has 8 byte ,

how to receive that

thanking you

This topic has been closed for replies.

2 replies

ykn
yknAuthor
Associate III
March 1, 2022

hi there,

after some search on google, i found this solution

looks like it would be very useful to me

https://controllerstech.com/uart-dma-with-idle-line-detection/

Pavel A.
March 1, 2022

Perhaps that solution will be less useful that you hope.

It relies on the "idle detection" feature. The RX idle condition occurs after one character time of silence (aka "idle character") and this timeout is not configurable.

But the Modbus protocol requires gap between messages to be at least 3.5 characters.

For this the UART has the Receive timeout feature (RTO). The HAL library seems to support it, but using it is more complicated that it should be. Look for more specific Modbus examples.