Hi everybody, i´m lastly working with a project about of communication RS485.
I´m trying comunicate a arduino with a device with RS485, using a MAX485 and a Arduino Mega 2560.
I tried use several librarys but the communication always is failed, and i don´t have a response of the device, i notice that the librarys not are the problem, i confirm this using same librarys but with a Arduino-Master and Arduino-Slave, and thereby this work´s excelent.
I read in somewhere that the MAX485 and several chips need wait 25ms to enable the Receiver output (RE=LOW), and i think that the message (query) don´t is sending correctly becouse if i don´t wait the 25ms, and i try to read the response maybe i read my last bits of the query or simply the query is don´t sending completly.
Then i want check this generating my own code and send the query with serial port1(e.g.Serial1.write) with the respective MAX485, and then immediately read the response with serial port2(e.g.Serial2.read) with the respective MAX485, thereby i don´t need wait 25ms and read immediately.
My problem for this is that the query on MOUDBUS RTU Protocol need CRC error check, and i don´t understand how generate this, i read about of some librarys but i don´t know what parameter assign.
maybe my solution is really laborious and maybe the last suitable, but is this only one idea that I have,
any suggestion is grateful.