Zum Inhalt springen

WSAL17221 – 2-CH RS485 HAT/en

Aus JW Tech Wiki
Version vom 6. September 2026, 00:41 Uhr von JWTechPublisher (Diskussion | Beiträge) (Freigegebene technische Dokumentation veröffentlicht; Text-only und noindex)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.

Summary

The 2-channel RS485 HAT adds two isolated RS485 ports to a Raspberry Pi. Control is via SPI using the SC16IS752 controller, while the SP3485 transceiver handles signal conversion. The board includes protection circuits (TVS, fuse, diodes) and supports manual or automatic transmit enable through a DIP switch.

Related products at JW Tech

Technical overview

  • Board size: 65 mm × 56.5 mm; mounting hole diameter 3.0 mm.
  • Operating voltage: 3.3 V or 5 V via the standard 40-pin GPIO header of the Raspberry Pi.
  • Communication: SPI interface; data rate 300 to 921600 baud in automatic mode.
  • Manual transmission mode can reach up to 2 Mbit/s in tests.
  • Two independent channels with separate enable pins EN1 and EN2: high = transmit, low = receive.
  • Built-in protection: TVS diodes against overvoltage, resettable fuse and protection diodes against overcurrent/overvoltage.
  • LEDs indicate power and transmitter/receiver status.
  • SPI control pins are broken out on the board so that other host boards (e.g., Arduino) can be connected.

Commands and examples – verify before use: 

sudo nano /boot/firmware/config.txt
dtoverlay=sc16is752-spi1,int_pin=24
sudo reboot
ls /dev
sudo apt-get install wiringpi
cd /tmp && wget https://project-downloads.drogon.net/wiringpi-latest.deb && sudo dpkg -i wiringpi-latest.deb
gpio -v
sudo apt-get update && sudo apt-get install python-pip && sudo pip install RPi.GPIO && sudo apt-get install python-serial
sudo apt-get update && sudo apt-get install python3-pip && sudo pip3 install RPi.GPIO && sudo apt-get install python3-serial
sudo apt-get install p7zip-full
wget https://files.waveshare.com/upload/4/44/2-CH_RS485_HAT_code.7z
7z x 2-CH_RS485_HAT_code.7z
sudo chmod 777 -R 2-CH_RS485_HAT
cd 2-CH_RS485_HAT/
cd c && make clean && make && sudo ./main
cd python/examples && sudo python main.py
sudo python3 test.py

Notes and version constraints

  • Exact pin mapping depends on actual soldering; int_pin must be adjusted accordingly.
  • In semi-automatic (manual) mode, the green RXD or TXD LED may stay on continuously — this is normal.
  • An additional USB-to-RS485 UART module is required for the test cases to observe the effect.
  • If no other RS485 device is available, Channel 1 and Channel 2 can be connected directly (A→A, B→B).
  • Line breaks must be sent, otherwise data will not be returned.
  • Demo directory paths vary by installation; adjust them to your local environment.
  • Simultaneous use with the 2-channel RS232 HAT is not supported according to the source.
  • The 120 Ω termination resistor is used for termination in RS485 networks to reduce reflections.

Source and revision record

  • 2-CH RS485 HAT - Waveshare Wiki
  • Source revision: 104982
  • Captured: 2026-08-31T04:08:43+00:00
  • SHA-256: 8c1e446646302e06908b29901bd13cc2ad3263a1d9d813730328adf4494f8790