CAN bus possible

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
slush
Posts: 3
Joined: Mon Apr 11, 2016 3:44 pm

CAN bus possible

Post by slush » Fri Apr 15, 2016 11:33 pm

Hi,

there's CAN bus in Micropython for STM chips, but I didn't find any resources about CAN bus support on ESP8266. Is it just missing yet or not possible for any reason?

User avatar
dhylands
Posts: 3204
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: CAN bus possible

Post by dhylands » Sat Apr 16, 2016 3:43 am

I don't think that the ESP8266 has native CAN support.

I think you'd need to hook up a SPI-CAN bus (perhaps using something like the MCP2515).

Dino
Posts: 1
Joined: Thu May 25, 2017 8:38 pm

Re: CAN bus possible

Post by Dino » Thu May 25, 2017 8:42 pm

Hello,
I need some help with CAN bus to be connect to ESP-12F. any approach or schematic example.

Thank you

User avatar
dhylands
Posts: 3204
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: CAN bus possible

Post by dhylands » Fri May 26, 2017 5:24 pm

The ESP doesn't have CAN support biuiltin, so you'll need an external CAN Controller chip which you'd then communicate with over SPI (tyupically).

An example of a CAN controller chip is the MCP2515: http://www.microchip.com/wwwproducts/en/en010406 You'd then need to write a driver on the ESP which talks to the CAN controller.

Don't confuse the CAN Controller with a CAN transceiver (like the MCP2551).

In the case of the STM32F4 seriess (like the pyboard) the CAN controller is builtin to the microcontroller, and only a transceiver is needed. With the ESP, you need both a controller and a transceiver.

User avatar
TravisT
Posts: 54
Joined: Sun Feb 23, 2014 2:31 pm
Location: Portland, OR
Contact:

Re: CAN bus possible

Post by TravisT » Wed May 31, 2017 5:39 am

Hello Dino,

As Dave said, it is good to be aware of the 2 components to implementing CAN bus. I usually hear them called the CAN peripheral, which ideally is built into the microcontroller, and the transceiver, which is rarely part of the microcontroller. The peripheral is for dealing with the protocol and managing messages, while the transceiver is for the physical/electrical interface.

The Microchip MCP2515 and MCP2551 are great because they are some of the most heavily documented SPI based CAN interface chips. I would also recommend Microchips all in one solution (both peripheral and transceiver in a single chip) MCP25625. Mikroe has a dev board which can help you with the hardware side.
http://www.microchip.com/wwwproducts/en/MCP25625
https://shop.mikroe.com/click/interface/mcp25625

I hope that helps
_______________
Travis Travelstead

Post Reply