Hello,
I have been having issues with the Serial.read function and I keep thinking that I fixed the problem but it keeps coming back. I am expecting 12 bytes back from a device after I write to a register. The program seems to run fine for a while until all of the sudden Serial.available returns 63. After looking through the forum it sounds like the ring buffer is filled. I am pretty sure its not the device that is causing the issue since I had it working fine with arduino.
My code layout basically looks like
Serial2.write()
if Serial2.available
Serial2.read for 12 bytes
Is there a better way of doing this so that the ring buffer doesn't get filled? Once this happens I am not able to tell which byte is supposed to be which.
Thank you,
Taylor