RS485 half duplex K64

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RS485 half duplex K64

ソリューションへジャンプ
1,441件の閲覧回数
roymessinger
Contributor V

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))
    __asm("NOP");
}

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?

Roy

0 件の賞賛
返信
1 解決策
1,262件の閲覧回数
mjbcswitzerland
Specialist V

Roy

Why does your circuit have R182 not places and keeps the RX enabled with R188. Like this you are receiving what you send but if you swap the resistors around the transceiver will operate as a typical simplex circuit which may already solve your problems.

Regards

Mark

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,263件の閲覧回数
mjbcswitzerland
Specialist V

Roy

Why does your circuit have R182 not places and keeps the RX enabled with R188. Like this you are receiving what you send but if you swap the resistors around the transceiver will operate as a typical simplex circuit which may already solve your problems.

Regards

Mark

0 件の賞賛
返信
1,262件の閲覧回数
roymessinger
Contributor V

Indeed, Mark. You were right. Once I swapped the resistors (in a typical rs485 half duplex comm.) it all went fine and all is working.

Thank you very much.

0 件の賞賛
返信