SK Pang Electronics PiCAN FD DUO User Manual

With rtc
Hide thumbs Also See for PiCAN FD DUO:

Advertisement

Quick Links

Product name
Model number
Manufacturer
PiCAN FD DUO Rev B 2.0
PiCAN FD DUO with RTC
USER GUIDE V2.0
PICAN FD CAN-Bus Board for Raspberry Pi 4
RSP-PICAN FD DUO
SK Pang Electronics Ltd
SK Pang Electronics Ltd Ó 2021
www.skpang.co.uk
1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PiCAN FD DUO and is the answer not in the manual?

Questions and answers

Summary of Contents for SK Pang Electronics PiCAN FD DUO

  • Page 1 PiCAN FD DUO Rev B 2.0 PiCAN FD DUO with RTC USER GUIDE V2.0 Product name PICAN FD CAN-Bus Board for Raspberry Pi 4 Model number RSP-PICAN FD DUO Manufacturer SK Pang Electronics Ltd SK Pang Electronics Ltd Ó 2021...
  • Page 2: Table Of Contents

    PiCAN FD DUO Rev B 2.0 Contents Table of Contents Introduction ......................1.1. Features ................................3 Hardware Installation ....................1.2. Screw Terminals ............................... 4 1.3. 120W Terminator ............................. 4 1.4. LED ..................................4 1.5. Not Fitted Items ..............................4 1.6. Switch Mode Power Supply (optional) ....................4 Software Installation ....................1.7. Installing CAN Utils ............................5 1.8. Bring Up the Interface ............................ 5 Real Time Clock (RTC) Software Installation .............
  • Page 3: Introduction

    PiCAN FD DUO Rev B 2.0 1. Introduction This PiCAN FD Duo board provides two channel CAN-Bus FD capability for the Raspberry Pi. It uses the Microchip MCP2517FD CAN controller with MCP2562FD CAN transceiver. Connection are made via 4 way screw terminal. A real time clock with battery back up (battery not included) is also on the board. The improved CAN FD extends the length of the data section to up to 64 bytes per frame and a data rate of up to 8 Mbps. Easy to install SocketCAN driver. Programming can be done in C or Python. 1.1. Features • Arbitration Bit Rate upto 1Mbps • Data Bit Rate up to 8Mbps • CAN FD Controller modes • Mixed CAN2.0B and CANFD mode • CAN2.0B mode • Conforms to ISO11898-1:2015 • High speed SPI Interface • CAN connection via 4way screw terminal • 120Ω terminator ready • Serial LCD ready • LED indicator • Four fixing holes, comply with Pi Hat standard •...
  • Page 4: Screw Terminals

    PiCAN FD DUO Rev B 2.0 1.2. Screw Terminals The CAN connections are made via the 4way screw terminals. Function Function CAN_L CAN_L CAN_H CAN_H GND GND n/c +12v Note : The +12v In is only used on the PiCAN2 FD Duo board with SMPS option fitted. 1.3. 120 W Terminator There is a 120W fitted to the board. To use the terminator solder a 2way header pin to JP1 and JP2 then insert a jumper. 1.4. LED There is a red LED fitted to each channel. This is connected to GPIO04 and GPIO26. 1.5. Not Fitted Items J2 can be use to power a serial LCD with data on TXD line from the Pi. There is also 5v supply on J5. 1.6. Switch Mode Power Supply (optional) This is an optional 5v module that can power the Pi. It has an input voltage range of 6v...
  • Page 5: Software Installation

    PiCAN FD DUO Rev B 2.0 3. Software Installation It is best to start with a brand new Raspbian image. Download the latest from: https://www.raspberrypi.org/downloads/raspbian/ After first time boot up, do an update and upgrade first. sudo apt-get update sudo apt-get upgrade sudo reboot Add the overlays by: sudo nano /boot/config.txt Add these lines to the end of file: dtparam=spi=on dtoverlay=i2c-rtc,pcf8523 dtoverlay=mcp251xfd,spi0-0,interrupt=25 dtoverlay=mcp251xfd,spi0-1,interrupt=05 Reboot Pi: sudo reboot 1.7. Installing CAN Utils Install the CAN utils by: sudo apt-get install can-utils 1.8.
  • Page 6: Real Time Clock (Rtc) Software Installation

    PiCAN FD DUO Rev B 2.0 To send a CAN FD message with no BRS use : cansend can0 7df##05555555555555555 Connect the PiCAN to a CAN-bus network and monitor traffic by using command: candump can0 You should see something like this: To use the other CAN channel replace can0 with can1. 4. Real Time Clock (RTC) Software Installation Insert a CR1220 battery (not supplied) into battery holder. Ensure the “+” is facing upward. Install the i2c-tools by: sudo apt-get install i2c-tools Then check the RTC: sudo i2cdetect -y 1 You should see 68 or UU on address 0x68: SK Pang Electronics Ltd Ó 2021...
  • Page 7 PiCAN FD DUO Rev B 2.0 Now you need to disable the "fake hwclock" which interferes with the 'real' hwclock sudo apt-get -y remove fake-hwclock sudo update-rc.d -f fake-hwclock remove Start the original hw clock script by: sudo nano /lib/udev/hwclock-set and comment out these three lines: #if [ -e /run/systemd/system ] ; then # exit 0 SK Pang Electronics Ltd Ó 2021 www.skpang.co.uk...
  • Page 8 PiCAN FD DUO Rev B 2.0 Reboot the Pi. Type the following to stop the fake clock services. sudo systemctl stop fake-hwclock.service sudo systemctl disable fake-hwclock.service Ensure the Ethernet cable or Wifi is on. This will get the time from the network. Set the clock by: sudo hwclock -w To read the clock: sudo hwclock -r SK Pang Electronics Ltd Ó 2021 www.skpang.co.uk...
  • Page 9: Python Installation And Use

    PiCAN FD DUO Rev B 2.0 5. Python Installation and Use Ensure the driver for PiCAN FD is installed and working correctly first. Clone the pythonCan repository by: git clone https://github.com/hardbyte/python-can cd python-can sudo python3 setup.py install Check there is no error been displayed. Bring up the can0 interface: sudo /sbin/ip link set can0 up type can bitrate 500000 dbitrate 2000000 fd on sample-point .8 dsample-point .8 Now start python3 and try the transmit with CAN FD and BRS set.
  • Page 10 PiCAN FD DUO Rev B 2.0 Documentation for python-can can be found at : https://python-can.readthedocs.io/en/stable/index.html More expamles in github: https://github.com/skpang/PiCAN-FD-Python-examples SK Pang Electronics Ltd Ó 2021 www.skpang.co.uk...

Table of Contents