dwinhmi / DWIN_DGUS_HMI

Official Arduino Libabry for DWIN DGUS T5L HMI Displays
19 stars 12 forks source link

Please provide error control code using CRC #14

Open rtek1000 opened 4 months ago

rtek1000 commented 4 months ago

Hi, I don't know why all the tutorials I saw on the internet about using Dwin displays don't deal with CRC error control.

It is very important to have error handling in noisy environments, especially in places that have machines with brush motors and other types of machines with high power switching and commutation.

From what I understand, Dwin displays use the Modbus-type CRC16 calculation, but with the bytes swapped.

So I asked for some guidance on an Arduino library that calculates the CRC16 Modbus, but needs to change the bytes before comparing with the Dwin communication data.

https://github.com/RobTillaart/CRC/issues/40

rtek1000 commented 4 months ago

Code added:

https://github.com/dwinhmi/DWIN_DGUS_HMI/pull/16

rtek1000 commented 4 months ago

Added more functions with CRC, response check as well

rtek1000 commented 4 months ago

Source code: https://github.com/rtek1000/DWIN_DGUS_HMI/blob/master/src/DWIN.cpp