I believe there's a bug in the UART receive function on the ATmega128A. It seems that the 0x00 byte is being interpreted as a string terminator, causing the reception to stop prematurely.
For example, if I try to receive the following byte stream:
23 1B 44 66 00 21 63 1E
Only these bytes are received:
23 1B 44 66
However, if the data stream doesn't contain 0x00, the entire message is received correctly.
Interestingly, I also tried receiving the data byte-by-byte using the following C code, but encountered the same issue:
Code: Select all
MX_UINT8 i = 0;
for (i = 0; i < FCV_RX_SIZE; i++)
{
FCV_U1_CHAR = FCD_047b1_UART1__ReceiveChar(20);
FCV_U1_RX1[i] = FCV_U1_CHAR;
}
I'm stuck at this point. Any advice or workaround would be greatly appreciated.
Thanks in advance!