Acqua technical documentation Buy

How to use the RS485 on Acqua module

This article illustrates how to use the serial ports of Acqua to manage them as RS485 line

RS485 driver IC like MAX485 needs three signals to manage an RS485 bus. These lines are:

  • TXD Transmit data
  • RXD Receive data
  • DE Driver Enable data

Some of the serial ports available on the SAMA5D3x MPU used on Acqua A5 can use the RTS line as a DE line to be used with a RS485 driver chip.

To set the serial ports to work as RS485 instead of RS232 in required to tell to the Linux serial driver to work as RS485 trought the Device Tree Binding definition as explayed below.

Suitable class='acmetable' signals

This is the list of suitable class='acmetable' signal available on Acqua pinout useful to implements up three RS485 lines.

usart0 - /dev/ttyS1

Signal Description SAMA5D3x line Acqua line
TXD0 TX line (out) PD18 J2.14
RXD0 RX line (inp) PD17 J2.18
RTS0 DE/RTS Driver enable PD16 J2.14
usart0: serial@f001c000 {
    pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts_cts>;
    linux,rs485-enabled-at-boot-time;
    rs485-rts-delay = <0 20>;
    status = "okay";
};

usart1 - /dev/ttyS2

Signal Description SAMA5D3x line Acqua line
TXD1 TX line (out) PB29 J2.46
RXD1 RX line (inp) PB28 J2.45
RTS1 DE/RTS Driver enable PB27 J2.42
usart1: serial@f0020000 {
    pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
    linux,rs485-enabled-at-boot-time;
    rs485-rts-delay = <0 20>;
    status = "okay";
};

usart2 - /dev/ttyS3

Signal Description SAMA5D3x line Acqua line
TXD2 TX line (out) PE26 J2.46
RXD2 RX line (inp) PE25 J2.45
RTS2 DE/RTS Driver enable PE24 J3.11
usart2: serial@f8020000 {
    pinctrl-0 = <&pinctrl_usart2 &pinctrl_usart2_rts_cts>;
    linux,rs485-enabled-at-boot-time;
    rs485-rts-delay = <0 20>;
    status = "okay";
};

usart3 - /dev/ttyS4

Signal Description SAMA5D3x line Acqua line
TXD3 TX line (out) PE19 J3.7
RXD3 RX line (inp) PE18 J3.8
RTS3 DE/RTS Driver enable PE17 J3.5
usart3: serial@f8024000 {
    pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts_cts>;
    linux,rs485-enabled-at-boot-time;
    rs485-rts-delay = <0 20>;
    status = "okay";
};

Links

Sergio Tanzilli
Systems designer, webmaster of www.acmesystems.it and founder of Acme Systems srl

Personal email: tanzilli@acmesystems.it
Web pages: https://www.acmesystems.it --- https://www.acmestudio.it
Github repositories: https://github.com/tanzilli --- https://github.com/acmesystems
Telegram group dedicated to the Acme Systems boards: https://t.me/acmesystemssrl

Home page Acqua technical documentation Buy