shardul17
DIIDevHeads IoT Integration Server
•Created by shardul17 on 6/28/2024 in #middleware-and-os
HELP: Need to configure MCP2515 using Raspberry pi's SPI 0 bus.
Yess..!! Thanks a lot..!
15 replies
DIIDevHeads IoT Integration Server
•Created by shardul17 on 6/28/2024 in #middleware-and-os
HELP: Need to configure MCP2515 using Raspberry pi's SPI 0 bus.
Yes, i updated but that was not the issue. The issue was 2 capacitors connected to external oscillator of MCP2515.
Finally, it was hardware issue.
Thanks for the help though..!
15 replies
DIIDevHeads IoT Integration Server
•Created by shardul17 on 6/28/2024 in #middleware-and-os
HELP: Need to configure MCP2515 using Raspberry pi's SPI 0 bus.
Any other reasons you can think of??
15 replies
DIIDevHeads IoT Integration Server
•Created by shardul17 on 6/28/2024 in #middleware-and-os
HELP: Need to configure MCP2515 using Raspberry pi's SPI 0 bus.
Ok. Thank you
15 replies
DIIDevHeads IoT Integration Server
•Created by shardul17 on 6/28/2024 in #middleware-and-os
HELP: Need to configure MCP2515 using Raspberry pi's SPI 0 bus.
dts file:
/*
* Device tree overlay for mcp251x/can0 on spi0.0
/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 { target = <&spi0>; overlay { status = "okay"; }; }; / the interrupt pin of the can-controller / fragment@1 { target = <&gpio>; overlay { can0_pins: can0_pins { brcm,pins = <26>; / it is the default pin and it will be overriden / brcm,function = <0>; / input / }; }; }; / the clock/oscillator of the can-controller / fragment@2 { target-path = "/clocks"; overlay { / external oscillator of mcp2515 on SPI0.0 / can0_osc: can0_osc { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <8000000>; }; }; }; / the spi config of the can-controller itself binding everything together / fragment@3 { target = <&spi0>; overlay { / needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; can0: mcp2515@0 { reg = <0>; compatible = "microchip,mcp2515"; pinctrl-names = "default"; pinctrl-0 = <&can0_pins>; spi-max-frequency = <10000000>; interrupt-parent = <&gpio>; interrupts = <26 0x2>; clocks = <&can0_osc>; }; }; }; };
fragment@0 { target = <&spi0>; overlay { status = "okay"; }; }; / the interrupt pin of the can-controller / fragment@1 { target = <&gpio>; overlay { can0_pins: can0_pins { brcm,pins = <26>; / it is the default pin and it will be overriden / brcm,function = <0>; / input / }; }; }; / the clock/oscillator of the can-controller / fragment@2 { target-path = "/clocks"; overlay { / external oscillator of mcp2515 on SPI0.0 / can0_osc: can0_osc { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <8000000>; }; }; }; / the spi config of the can-controller itself binding everything together / fragment@3 { target = <&spi0>; overlay { / needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; can0: mcp2515@0 { reg = <0>; compatible = "microchip,mcp2515"; pinctrl-names = "default"; pinctrl-0 = <&can0_pins>; spi-max-frequency = <10000000>; interrupt-parent = <&gpio>; interrupts = <26 0x2>; clocks = <&can0_osc>; }; }; }; };
15 replies