What's RS485 CAN HAT For Raspberry Pi?

RS485 CAN HAT for Raspberry Pi - Complete Overview

RS485 CAN HAT is a multi-node communication module for long-range communication, designed specifically for Raspberry Pi with a 3.3 V operating voltage, CAN controller MCP2515 via SPI interface, and on board transceiver SN65HVD230 managed via UART. It is designed to allow for automatic TX/RX control without the need for programming. 

What's RS485 CAN HAT For Raspberry Pi?

Features: 

  • Raspberry Pi 40 PIN GPIO Extension Header, which is compatible with the Raspberry Pi series boards.
  • CAN work, MCP2515 on board CAN controller via SPI interface, SN65HVD230 on board transceiver.
  • Half-duplex communication, RS485 feature controlled via UART, supports automatic TX/RX control without programming, on board transceiver SP3485
  • The on board TVS (Transient Voltage Suppressor) effectively suppresses surge voltage and transient spike voltage in the RS485 transceiving circuit, making it lightning-proof and anti-electrostatic. 
  • Control pins are reserved, allowing you to interact with other control boards.
  • Includes development tools and a manual (examples of Pi/python wiring).
    RS485 CAN HAT for Raspberry Pi
    RS485 CAN HAT for Raspberry Pi

RS485 CAN HAT for Raspberry Pi Tutorial

On the CAN bus, the CAN module may process packets sent and received. Packets are transmitted by first storing them in the appropriate buffer and control register. To set the bits on the control register or allow the transmit pin for transmitting, use the SPI interface. For detecting communication states and errors, registers could be read. It will first search for any errors in packets detected on the CAN BUS RS485 HAT for Raspberry Pi, and then verify them using a filter specified by the user. If there are no errors, store the packet in one of the buffers. Since the Raspberry Pi does not support the SPI bus, this module uses the SPI interface and has a CAN receiver/transmitter on board. 

The MCP2515 from Microchip Technology is a standalone Controller Area Network (CAN) controller that implements the CAN 2.0B specification. It can send and receive both standard and extended data, as well as remote frames. The MCP2515 has two acceptance masks and six acceptance filters for filtering out unwanted messages and thereby lowering the host MCU's overhead. 

The MCP2515 communicates with microcontrollers (MCUs) using an industry standard Serial Peripheral Interface (SPI). This means that the Raspberry Pi can interact with the MCP2515 using the SPI interface without the need for an external driver. The kernel driver needs to be enabled on the devices tree.

RS485 CAN HAT transceiver SP3485 Transceiver Overview

The SP3485 is a low-power half-duplex transceiver that complies with RS485 serial protocol specifications. The Receiver output pin is RO, and the Driver input pin is DI. RE is the Active LOW Receiver Output Enable pin, and DE is the Active HIGH Driver Output Enable pin. A is the non-inverting Driver Output/Receiver input port, and B is the inverting Driver RS485 Will HAT 7 / 24 Output/Receiver input port.  When A-B >+0.2V, RO pin outputs logic 1; when A-B -0.2V, RO pin outputs logic 0. 100 resistor between A and B ports is recommended.

The RE and DE pins of the SP3845 are set to allow receive and send, according to the hardware definition. This module is configured to receive/send data in a hardware-driven manner; however, by adjusting the 0 resistors on the board, you can configure it to receive/send data in a software-driven manner.