ISO-485-DUO Configuration
Configuration
The following lines needs to be added to /boot/config.txt to enable the hardware UART0 (ttyAMA0) to appear on the correct pins for the adapter card, these are dependant on carrier board type used used :
# Integrator Board XT enable_uart=1 # Enables UART1 (ttyS0) on GPIO14/15 dtoverlay=disable-bt # Moves UART0 (ttyAMA0) to being on GPIO14/15 dtoverlay=uart2 # Enable UART2 (ttyAMA1) on GPIO0/1 gpio=0-1=a4 # Stop HAT card probe on GPIO0+1 during start-up # Integrator Board NT dtoverlay=uart0,txd0_pin=32,rxd0_pin=33,pin_func=7 # Enables UART0 onto GPIO32/33 dtoverlay=uart1,txd1_pin=14,rxd1_pin=15 # Enables UART1 onto GPIO14/15 enable_uart=1 # Fixes internal clock to fix baud rate issues. dtoverlay=uart_swap # Correct UART assignment so 32/33 has ttyAMA0 & 14/15 has ttyS0
Also make sure the serial console has been disabled on NT/XT carrier boards to avoid clashing with serial ports.
With the above setup on Linux kernel version raspberrypi 5.10.92-v7l+ XT Carrier Board
Channel 0 | ttyAMA1 |
Channel 1 | ttyAMA0 |
NT Carrier Board
Channel 0 | ttyS0 |
Channel 1 | ttyAMA0 |
Operation Notes
The ISO-485 adapter board uses a MAX13487 RS485 line driver, this has transparent automatic hardware flow control and so does not require any additional code to supervise flow control.
Note that for correct RS485 operation it is vital that the pull up/down bias resistors be fitted.
LK1 & LK2 links can be used to enable the on board 680R resistors
The ISO-485 card also features and on board 120R termination resistor LK3 & LK4 which can be used if running long lines or high speed,
A single 5-40V opto isolated digital input is also provided on this card and connected to GPIO40 (NT) or GPIO5 (XT)
When connecting a RS485 network we strongly recommend using appropriate cabling e.g. Belden 9481 120 Ohm impedance twisted pair wire (or equivalent)
IO Card Connector Pinout
This card has the following pin out on the front Green Industrial 8pin Connector Connector pin numbered left to right from front of card
1 | Dig In A |
2 | Dig In B |
3 | RS485-1 A |
4 | RS485-1 B |
5 | ISO-GND |
6 | RS485-0 A |
7 | RS485-0 B |
8 | ISO-GND |
Reference Links
Belden 9481 RS485/CAN-BUS Data Cable Datasheet