1

I'm using PI4 OS Buster.

I want to connect 2 canbus interfaces so I will be able to read both of them at the same time.

this is the connections I have made

    GPIO                CAN
HEADR   SIGNAL     MODULE
PIN      NAME  --- SIGNAL
#02       5V --- VCC
#06        GND --- GND
#38       MOSI --- SI
#35       MISO --- SO
#40       SCLK --- SCK/CLK
#26   SPI0.CE1 --- CS
#36     GPIO16 --- INT


GPIO                CAN
HEADR   SIGNAL     MODULE
PIN      NAME  --- SIGNAL
#02       5V --- VCC
#06        GND --- GND
#19       MOSI --- SI
#21       MISO --- SO
#23       SCLK --- SCK/CLK
#24   SPI0.CE0 --- CS
#32     GPIO12 --- INT

and this the setting in the /boot/config.txt

dtparam=spi=on
dtoverlay=spi1-2cs
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=12
dtoverlay=mcp2515-can1,oscillator=8000000,interrupt=16
dtoverlay=spi-bcm2835-overlay

in this setting this I can only see and work with can0

 pi@raspberrypi:~ $ ls /sys/bus/spi/devices/spi*
/sys/bus/spi/devices/spi0.0:
driver  modalias  net  of_node  power  statistics  subsystem  uevent
/sys/bus/spi/devices/spi0.1:
modalias  of_node  power  statistics  subsystem  uevent
/sys/bus/spi/devices/spi1.0:
driver  modalias  of_node  power  spidev  statistics  subsystem  uevent
/sys/bus/spi/devices/spi1.1:
driver  modalias  of_node  power  spidev  statistics  subsystem  uevent

ip link set 
can0   eth0   lo     wlan0 

I can see the device connected to spi0 and it's working I have also look here

https://copperhilltech.com/content/PICAN2DUOUGB.pdf

and it's seem they didn't do any special setting

Someone know what is wrong? and what am I missing ?

Thanks ,

  • 1
    Do you use the PiCan2 HAT whose user guide you link to? If yes, why didn't you follow the user guide? If no, what HW are you using? – oh.dae.su Nov 21 '19 at 21:05
  • Comments are not for extended discussion; this conversation has been moved to chat. – goldilocks Dec 3 '19 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.