2022-02-28 04:54 AM
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
2022-03-01 06:18 AM
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/
2022-03-01 10:24 AM
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.