Hello,
I am trying to communicate with an RS485 tranceiver via UART in blocking mode exactly as it is in the lpc board keil Examples. The Uart configuration and Pin configuration are shown in the pictures bellow. The problem is that although I can see the data in analyzer connected to the bus. I don't receive anything in my RX buffer. The last picture is my receive function. Any Ideas what is going on?
Thanks In advance,
Hello and thanks for your help,
The RTS Pin is controlled via Software and that is the reason why I don't check this bits. Also I noticed that when I try to transmit data from the mcu the data are captured correctly from the analyzer. Do you think that configuring this bits will actually help?
Thanks,
Hi,
You said that “The RTS Pin is controlled via Software and that is the reason why I don't check this bits.”, but you configured the FUNC bits of IOCON->PIO[0][9] as 0x01, which means that the PIO0_9 pin functions as RTS of FC4, you can NOT manipulate the RTS with software like GPIO does, the RTS signal will be driven by UART module automatically, in the case, you have to configure the bits I said in last Email.
You can configure the PIO0_9 pin as GPIO function with FUNC bits of IOCON->PIO[0][9] as 0x00, you can configure the direction of PIO0_9 as output, in the case, you can set the GPIO or clear the GPIO so that you can control the transceiver direction of RS485.
If you still have question, pls post the RS485 hardware connection.
BR
XiangJun Rong
Hello and thank you for your reply,
That was the solution to my problem. It is solved.
Hi,
If you want to use RTS signal to control RS485 transceiver direction, you have to configure the OESEL,
OEPOL, and OETA bits in the CFG register.
BTW,I suggest you check the RTS pin signal via scope.
Hope it can help you
BR
XiangJun Rong