ESP32 and MCP2515 CAN BUS

z3dulik
Posts: 2
Joined: Thu Jul 04, 2019 3:56 pm

ESP32 and MCP2515 CAN BUS

Postby z3dulik » Thu Jul 04, 2019 8:06 pm

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.

z3dulik
Posts: 2
Joined: Thu Jul 04, 2019 3:56 pm

Re: ESP32 and MCP2515 CAN BUS

Postby z3dulik » Fri Jul 05, 2019 8:52 am

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.

julius
Posts: 1
Joined: Sun Jul 03, 2022 2:53 am

Re: ESP32 and MCP2515 CAN BUS

Postby julius » Sun Jul 03, 2022 3:03 am

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

davidcyr2000
Posts: 2
Joined: Tue Feb 28, 2023 8:14 pm

Re: ESP32 and MCP2515 CAN BUS

Postby davidcyr2000 » Tue Feb 28, 2023 8:36 pm

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

davidcyr2000
Posts: 2
Joined: Tue Feb 28, 2023 8:14 pm

Re: ESP32 and MCP2515 CAN BUS

Postby davidcyr2000 » Tue Feb 28, 2023 8:40 pm

The Cory Fowler library has an example of accessing two CAN networks. Did that not help?

TobiasFP
Posts: 1
Joined: Mon Mar 27, 2023 6:44 pm

Re: ESP32 and MCP2515 CAN BUS

Postby TobiasFP » Mon Mar 27, 2023 6:46 pm

For anybody coming here, the issue is the tranceiver needs 5v not just 3.3 that the esp supplies from is pin operating voltage.

Who is online

Users browsing this forum: Google [Bot], ignisuti and 115 guests