I have an RS422 interface set up between an Arduino and a custom-built device. The device is set to transmit a 16-bit header, followed by 66 bytes of data, at a baudrate of 460,800 and at 200Hz. This cannot be changed.
I have read online that the Arduino serial can handle 460,800 bps without a problem. In fact, I have successfully communicated between MatLab and Arduino at that baudrate without problems. I have also confirmed that the device works, as when it is connected directly to the computer, it is read fine.
When I try to read the data using the Arduino, I don't get what is expected. The header I'm supposed to be getting is 0x55AA. I am, however, getting 0xD56A most of the time, but sometimes I get values like 0xB5CA. It seems the second half of each byte is correct, but not the first, and I have some bits going high and some going low when they shouldn't. Because of this, I question the validity of the data being transmitted.
Can someone explain to me why this is happening, and what solutions I can try to remedy this, please?
Thanks
UPDATE: I have looked through with an oscilloscope and I can see the waveform coming out as 0x55AA, as it should be. I have increased the Arduino serial buffer, and changed boards, but the problem persists.
I managed to get it working at a lower baudrate (115,200), but I need to have it set at 460,800. At this lower baudrate, I would get 0x55AA, but as sson as I ramp it up to 460,800, I lose this data and it becomes as mentioned above.