RS 485 for RZ/G1E

Hi 

We are working on custom platform based on RZ/G1E.
we need to test RS485 which is configured for HSCIF2.
Using current Renesas Serial driver "drivers/tty/serial/sh-sci.c" is it possible to test RS485 ?
If not is there any way to test RS485 in RZ/G1E?

Thanks and Regards

Rizwan Syed

  • The issue with 485 is that you have to control the external transceiver chip (TX or RX mode). The sh-sci.c driver will not do that for you. So your application will have to do that for you using a GPIO pin. For example, you will leave it in RX mode, and only put it in TX mode when you need to send data, then put it back to RX mode.
    If you do that, it should work as I have known others that have done this successfully.
  • In reply to Chris:

    Hi

    Thank you chris for the reply.

    Is the above suggestion is for half duplex.RX and TX on UART is working fine.
    Actual requirement is to test RS 485 for Multi drop feature with full duplex communication,where our board is master and 16 slaves are connected.

    With MODBUS when i try to read registers after setting slave id for MODBUS it was getting failed and unable to get the required read data.
    Is there any support or an example available?

     

    Thanks and Regards

    Rizwan Syed

  • In reply to rizwan:

    Yes, I was explaining half duplex (which is very popular for RS485).
    If you are using Full Duplex, and your board is the only master on the bus, then you do not need a GPIO to toggle a DE/RE signal on the RS485 transceiver chip.

    I do not have any specific RS485 example. However, RS485 is a simple protocol, so you should look at the signals on a oscilloscope or logic analyzer to make sure you are sending and receiving the expected data on the bus.
  • In reply to Chris:

    Hi

    Thank you chris for the reply.
    Now we are using a MODBUS application from the below link.
    github.com/.../libmodbus
    In application, there are certain flags like SER_RS485_ENABLED are being sued.
    But in our sc-shi.c driver file these flags are not used / supported.
    So we think since the flags are not supported , we are unable to read the data properly even after setting the correct slave id in application.
    Please provide your input

    Thanks and Regards
    Rizwan Syed
  • In reply to rizwan:

    Like you said, since the Renesas serial HW does not have RS485 support, the driver does not handle RS485 transceivers automatically.
    However, from a quick look at the kernel documentation:
    www.kernel.org/.../serial-rs485.txt
    It seems that you can connect the RTS pin to an external RS485 transceiver in order to control it.
    That is what the SER_RS485_xxx commands are doing I think.

    > So we think since the flags are not supported , we are unable to read the data properly even
    > after setting the correct slave id in application.
    Unfortunatly, what you need to do next is hook up a scope and see what is happening on the wires. If you keep trying to debug just by SW, you might be missing a HW issue, and you will never find your answer.
  • In reply to Chris:

    Hi

    Thank you chris for the reply.
    We have seen the link shared by you, we understood that the flags related to RS485 need to be configured through rs485conf structure and using
    ioctl configuration, its sent to driver. Driver receives through ioctl function and writes the configuration to memory/register.

    But in our case, we can implement the same ioctl in driver but since we don't have any RS485 configuration in RZ/G1E controller side, how can this code can be used ?
    Is there any specific function where we can do this configuration and write to memory/register in case of "sc-shi" driver?

    Thanks and Regards
    Rizwan Syed
  • In reply to rizwan:

    But you said you want to use "Full-Duplex", so you should not need the RS485 ioctl commands. You can leave the transmit driver always on, and you can leave the receive driver always on. So then it will just work like normal serial communications, and the current sh_sci driver will work fine.

     

    It's only the case of Half-Duplex that you get into issues (when you have to turn the transceiver on and off)

    Have you confirmed that the Tx signals are reaching the slaves correctly? And that the correct slave is driving the line back to the master (RZ/G)?

  • In reply to rizwan:

    rizwan,

    Have you found the solution to your communication issues?

    Mike Clements
    RenesasRulz Moderator
  • This thread will be archived due to inactivity.

    Mike Clements
    RenesasRulz Moderator