CAN bus possible
CAN bus possible
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?
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?
Re: CAN bus possible
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).
I think you'd need to hook up a SPI-CAN bus (perhaps using something like the MCP2515).
Re: CAN bus possible
Hello,
I need some help with CAN bus to be connect to ESP-12F. any approach or schematic example.
Thank you
I need some help with CAN bus to be connect to ESP-12F. any approach or schematic example.
Thank you
Re: CAN bus possible
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.
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.
Re: CAN bus possible
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
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
Travis Travelstead
Re: CAN bus possible
Is there any sample code for Micropython + MCP2515 CAN communication?
Any libraries available?
Thanks
Any libraries available?
Thanks
Re: CAN bus possible
Which board are you using?
Any of the STM32 boards (e.g. Pyboard or STM32 Nucleo or Discovery) with CAN support will have the library built-in, see http://docs.micropython.org/en/latest/l ... b.CAN.html
Then you can use just a transceiver (e.g. MCP2551) rather than an external controller like the MCP2515.
Re: CAN bus possible
jimmo,
Thank you for the reply. I am using ESP32 which also does have internal CAN controller hardware but it looks like there is not enough resources available to use it yet, or at least I couldn't find any. That's why I have to use an external SPI CAN controller chip.
Thank you for the reply. I am using ESP32 which also does have internal CAN controller hardware but it looks like there is not enough resources available to use it yet, or at least I couldn't find any. That's why I have to use an external SPI CAN controller chip.
Re: CAN bus possible
Yeah, "CAN" is an unfortunately difficult term to search for. It's come up a lot in this forum and on the github issues.
It's not a question of resources, it's just that nobody has written a Python wrapper for it for ESP32 yet. It's well supported by ESP-IDF, and a Python wrapper wouldn't be too complicated. See https://docs.espressif.com/projects/esp ... s/can.html
This might be easier than writing a driver for an external controller chip. (Unless you need FDCAN support, which the ESP32 can't do)
It's not a question of resources, it's just that nobody has written a Python wrapper for it for ESP32 yet. It's well supported by ESP-IDF, and a Python wrapper wouldn't be too complicated. See https://docs.espressif.com/projects/esp ... s/can.html
This might be easier than writing a driver for an external controller chip. (Unless you need FDCAN support, which the ESP32 can't do)
Re: CAN bus possible
Perhaps an added incentive viewtopic.php?f=15&t=6984