I am getting some behavior I didn’t expect, and that I don’t understand, when using half duplex mode on Serial 1. I am trying to implement a 1-wire UART to communicate to a PGA308 (programmable gain amplifier). I believe I have the communications working… mostly. At least, the data that I get back from the chip looks all correct, it’s just the way I have to get the data that seems odd.
The issue I am having is that after sending data to the chip to program registers and then sending the commands to read back a register value, when I do a Serial1.read() all the commands I sent out are stored in the RX buffer. Is that the expected behavior? That would imply that if I sent too much data before I wanted to read anything in from the chip that I could overflow my RX buffer?
Do I really need to read back in all the commands I just sent before I can get to the useful information? That seems like a waste of processing time.