AnsweredAssumed Answered

RS485 half duplex K64

Question asked by roymessinger on Mar 16, 2017
Latest reply on Mar 16, 2017 by roymessinger

I'm using a transciever to receive/transmit the data and I've set the RTS registers of the chip correctly. 

I'm getting a strange phenomenon in which the data from the tx buffer seems to get back to the rx buffer, even though I'm waiting for the last transmission:

void send_message_in_uart(unsigned char *query, unsigned char string_length)
while ((kUART_TxDataRegEmptyFlag & UART_GetStatusFlags(UART_CH_ACTIVE)))
       UART_WriteBlocking(UART_CH_ACTIVE, query, string_length);

while (!(UART1->S1 & UART_S1_TC_MASK))


I'm getting an endless loops of transmission, which endlessly toggles the RTS line. I think it is because the data from the tx goes back to the rx. In the FRDM board I did not have such behaviour (but I think I've used a transciever which is not half duplex, and definately did not have RTS flow). It could be the data is passed tx->rx on the transciever side, even though the transmission has ended on the CPU side...

I've tried inserting the second 'while' to the first one, but didn't help.

Any ideas?