Serial Communication Gibberish

I have three Arduino megas that I am getting to talk to each other via rs485. I have been testing this a couple weeks now, and I am now at the stage where we have finished a circuit board onto which the mega will be inserted. Before the completion of the circuit board. I was building the protocol with the rs485 shield v.1.0 from dfRobot. On the circuit board we have remade the rs485 converter thanks to circuit diagram being posted on the internet.

Since inserting the mega on to this new board, all the ASCII characters I am send down the Serial, come out the other end as gibberish characters.
Funny note, we turned it on this morning and plugged it in only for it to receive the first message clearly. Following on from that every message is garbled.

I have heard this could be a grounding issue, though I’m unsure as to why. When I was testing with the shield, I was only using A and B, though both arduinos were powered via the same PCs USB. It seems as though the message is getting caught in a cache or buffer and the following messages I send are getting merged to form gibberish. It’s also strange that the messages that are received by the slave arduinos are of the correct length (2 characters or 8 depending on what was sent), it’s just the characters.
I’ve included a picture of our board. The ICs that are missing are just isolators because we are also driving some 24V motors from the same board. In an attempt to solve the problem we have just bypassed them for the time being.
Hopefully there’s someone out there that can help me.

Thanks in advance.

A schematic diagram would be better than a picture of the board as there is no way to trace connections.

If the fist serial message from power on is good an subsequent ones bad then maybe it's a code issue (also not supplied) where baud rates/clock frequencies are being altered?

I will dig up the circuit diagram of the board, but this image is of the rs485 shield circuit that we have successfully used in the past. We have recreated this on the board pictured above where we’re pretty sure the problem lies now.
We are only using the circuit in the centre here. A slight modification we’ve done is that the enable switch (EN1/EN2) is actually routed to an arduino pin so we can switch it on and off with code. Hence permanently in manual transmit mode when the enablePin is brought high.
An interesting thing I’ve found since is that when I add a 100ms delay between reading characters in Serial1.Event() it reads the message a lot clearer, though from time to time it still picks up gibberish. So I’m sure that the message is still being transmitted correctly. I’ve checked that the baud rates are the same.
I’m not sure if it’s relevant but I am also running a high speed encoder using a single interrupt pin.

Thanks again :slight_smile:

The sketch does not show a ground or where the opto isolators are in relation to the RS485 transceiver.