I have a half duplex RS485 Master - Slave network using MAX485 ICs. I have found that I need to keep the Driver Enable pin HIGH after Serial.write(), otherwise the ATmega328 hangs after 5 minutes or so. I have experienced this behavior when using a delay of 1, but If I change it to 20, it seems to be OK (17+ hours and counting).
What is the correct value I should be using? and how is this worked out?
Also why would the ATmega328 crash like this? I would just see the TX_LED stay on, and the slave stop responding.
#define TX_LED 13
#define DRIVER_ENABLE 2
byte address1 = 0x31; //1
byte address2 = 0x32; //2
void sendPacket(byte address)
delay(20); //Delay to allow transmission.