How to use Pi-2485

  • Titan_ted
  • 04/25/2022
  • Comments Off on How to use Pi-2485
  • Uncategorized

Introduction

This is a dual-channel isolated RS485 extension board specially designed for Raspberry Pi, which adopts SC16IS752+SP485 solution, embed with protection circuits. It is easy to control the 2-channel RS485 for auto transceiving via SPI interface.

Features

  • Based on Raspberry Pi 40pin GPIO interface, suitable for Raspberry Pi series motherboards
  • Using SC16IS752 and SP485 solution, can realize SPI to RS485, the communication rate is up to 921.6kbps
  • RS485 supports manual or automatic sending and receiving of data, which can be set by DIP switch
  • RS485 onboard resettable fuse and protection diode can ensure stable output of current and voltage, prevent overcurrent and overvoltage, and improve shock resistance
  • Onboard power supply and serial port transceiver indicators, easy to check the module power supply and communication status
  • Lead out the SPI control interface for easy access to main control boards such as Arduino

Hardware Connection

485 PINRaspberry Pi(BCM)
VCC5V
GNDGND
SCKP21 (SPI1 SCLK)
MOSIP20 (SPI1 MOSI)
MISOP19 (SPI1 MISO)
CSP18 (SPI1 CS)
IRQP24
EN1P27
EN2P22

Software setup

Open the terminal and modify config.txt file by commands:
sudo nano /boot/config.txt
Add the line below to the file, the int_pin should be set according to the actual welding:
dtoverlay=sc16is752-spi1,int_pin=24
Then restart Raspberry Pi
sudo reboot
After rebooting, the driver of SC16IS752 will be loaded into the system kernel. You can run command ls /dev to check the following devices: