How to enable RS485 support for MAX14830 UART expander driver.

cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable RS485 support for MAX14830 UART expander driver.

1,490 Views
Contributor III

Hello,

    I have interfaced UART expander chip ( MAX14830 ) with imx6ul. Now able to loopback the tx and rx at UART level. After UART we have connected the RS485 duplex transreceiver. Now looking to check RS485 data with loopback.

Now I have seen in the expander driver  (drivers/tty/serial/max310x.c) , provided support for the RS485.

I have added some debug prints in the rs485 config function, but its not called.

How to enable the rs485 support in the driver?

Regards,

Surendra

Labels (2)
0 Kudos
5 Replies

186 Views
NXP TechSupport
NXP TechSupport

Hello Surendra,

    I checked datasheet of MAX14830, it is a bridge of SPI to 4-channel UARTS, if you need one channel of UART to work at RS485 mode, you should add UART to RS485 circuits.

    MAX310x.c is just a linux driver of SPI to UART, you can't obtain RS485 function through it.


Have a great day,
TIC Weidong Sun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

186 Views
Contributor III

Hello Weidong Sun,

   Thanks for your reply !!  We already added support of RS485 circuit. Also in the datasheet also clearly mentioned about the RS485 support in  "QUAD RS-485 INTERFACE CONTROLLED THROUGH SPI".

Also, if you check the latest or kernel 4.15 driver ( max310x.c), added one fucntion related to the rs485 configuration.

So looks in the driver support for the RS485 also.

My question is, how "max310x_rs485_config" function will call so that rs485 functionality will enable. I function SER_RS485_ENABLED flag is their but how it will enable ?

Regards,

Surendra

 

0 Kudos

186 Views
Contributor III

Hello,

          [ It's for the users who are looking the same].

For the RS485 functionality, we have used   SN65HVD73 transreceiver having rs 485 functionality. To enable the functionality of the RS485 with RTS control bit, need to enable only RTS bit in max14830.

I am able to communicate with RS485.

Regards,

Surendra

0 Kudos

186 Views
Contributor I

Hi

I see a similar issue..

Would you mind elaborating what you did to toggle the RTS pin?

Did you enable AutoRTS in reg 0x13 or are you forcing it using the RTS bit in 0x0b?

Did you manage to get it calling the enable-rs485 routine in the driver?

When I enable hardware flow control (using 'stty -F /dev/ttyMAX0 crtscts' i.e AutoRTS/AUTOCTS is set to 1) I see simliar issues you reported in a later thread, i.e the port "hangs". No activity on SPI. My first thought about this was that it got stuck in an IRQ routine or so, but it doesn't seem to be the case...

Also, what did you do with the CTS signal? On the board I have it is left floating. The datasheet is not clear about this.

Thanks

0 Kudos

186 Views
Contributor III

Hello Andersson,

      To enable the RS-485 functionality just add in max310x_set_termios,

    lcr |= MAX310x_LCR_RTS_BIT

Thanks,

Surendra

0 Kudos