Aria technical documentation Buy
RS485 driver IC like MAX485 needs three signals to manage an RS485 bus. These lines are:
Some of the serial ports available on the AT91SAMG25 MPU used on Aria G25 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.
This is the list of suitable class='acmetable' signal available on Aria pinout useful to implements up three RS485 lines.
Signal | Description | MCU line | Aria line |
---|---|---|---|
TXD0 | TX line (out) | PA0 | S23 |
RXD0 | RX line (inp) | PA1 | S22 |
RTS0 | DE/RTS Driver enable | PA2 | S21 |
usart0: serial@f801c000 {
pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts>;
linux,rs485-enabled-at-boot-time;
rs485-rts-delay = <0 20>;
status = "okay";
};
Signal | Description | MCU line | Aria line |
---|---|---|---|
TXD1 | TX line (out) | PA5 | S18 |
RXD1 | RX line (inp) | PA6 | S17 |
RTS1 | DE/RTS Driver enable | PC27 | E7 |
usart1: serial@f8020000 {
pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts>;
linux,rs485-enabled-at-boot-time;
rs485-rts-delay = <0 20>;
status = "okay";
};
The DE/RTS pin of usart2 (/dev/ttyS3) port is not available on Aria pinout so it can be used in RS485 mode
Signal | Description | MCU line | Aria line |
---|---|---|---|
TXD3 | TX line (out) | PC22 | E2 |
RXD3 | RX line (inp) | PC23 | E3 |
RTS3 | DE/RTS Driver enable | PC24 | E4 |
To use the /dev/ttyS3 you have to include in your dts this file:
#include "at91sam9x5_usart3.dtsi"
then use this definition:
usart3: serial@f8028000 {
pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts>;
linux,rs485-enabled-at-boot-time;
rs485-rts-delay = <0 20>;
status = "okay";
};