Page 1 of 1
ESP32 and MCP2515 CAN BUS
Posted: Thu Jul 04, 2019 8:06 pm
by z3dulik
Hello,
I am trying to connect mcp2515 to esp32 wroom32 to read data from a car.
Pins I use - mcp to esp:
CS to 5
SO to 19
SCK to 18
SI to 23
INT to 2(here if I use 5v from esp when upload the code, returns connection error) not sure whats wrong
Right now I am using 12V and a step down to 5V to power the Canbus.
Did anyone used this before, any good libraries or sample codes to sniff?
thanks.
Re: ESP32 and MCP2515 CAN BUS
Posted: Fri Jul 05, 2019 8:52 am
by z3dulik
with this config sometimes works, sometime stops here
Code: Select all
rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:9232
load:0x40080400,len:6400
entry 0x400806a8
Entering Configuration Mode Successful!
Setting Baudrate Successful!
MCP2515 Initialized Successfully!
MCP2515 Library Receive Example...
any ideea what I am doing wrong?
I am using coryjfowler's
https://github.com/coryjfowler/MCP_CAN_lib with CAN_receive example.
Re: ESP32 and MCP2515 CAN BUS
Posted: Sun Jul 03, 2022 3:03 am
by julius
Hi,
Is it possible to connect 2 or more MCP2515 CAN controllers with 1 ESP32 SPI and just control thru different SC pins?
Anybody has suggestion which library to use?
Thanks,
Julius
Re: ESP32 and MCP2515 CAN BUS
Posted: Tue Feb 28, 2023 8:36 pm
by davidcyr2000
Did you ever get this working? If so, could you please post the circuit diagram you used. I am wondering if the connections between the ESP32 and the MCP2515 CAN chip have to be voltage-level adjusted since they operate at 3.3V and 5V respectively? E.g. See "Bidirectional Logic Level Shifter Circuit" in
https://maker.pro/custom/tutorial/how-t ... t-voltages. Or would a resistor voltage divider be sufficient for voltages going to the EPS32 and direct connect for the signals going in the other direction?
Thanks,
David Cyr
Re: ESP32 and MCP2515 CAN BUS
Posted: Tue Feb 28, 2023 8:40 pm
by davidcyr2000
The Cory Fowler library has an example of accessing two CAN networks. Did that not help?
Re: ESP32 and MCP2515 CAN BUS
Posted: Mon Mar 27, 2023 6:46 pm
by TobiasFP
For anybody coming here, the issue is the tranceiver needs 5v not just 3.3 that the esp supplies from is pin operating voltage.