You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a second mega or any other board I would also try spying on the serial communication. That is, run your first mega with your desired program connected to your RS485 adapter and your modbus device. On your second mega connect the Rx of Serial1 to the Tx of the RS485 adapter, the Rx of Serial2 to the Rx of the adapter. Then run a very simple program that mirrors both back to the terminal: while (Serial1.available()) Serial.print(Serial1.read()); while (Serial2.available()) Serial.print(Serial2.read());
Hi, i trying to use this library on Mega:
HardwareSerial modbusSerial = Serial2;
modbusMaster modbus;
modbusSerial.begin(2400);
modbus.begin(101, modbusSerial);
float val = modbus.uint16FromRegister(0x04, 1, bigEndian);
TTL to RS485 adapter blink 8 times TX on boot, then Mega hangs on any type read register attempt.
Any suggestion how to debug this?
The text was updated successfully, but these errors were encountered: