Started to work with a BeagleBone Black and the CAN bus it contains. Just make it easy to get up and running I made a very simple script to do just that.
Get the BBB-CAN script from github.Original instruction are from this Embedded Things blog post.
Showing posts with label CAN. Show all posts
Showing posts with label CAN. Show all posts
Thursday, October 30, 2014
Monday, May 19, 2014
CAN bus, chips and usb adapter
I got my CAN bus chip, a couple of MCP2515 controllers and and MCP2551 transceivers and also the required boilerplate components or whatever you call them in the hardware world :)
Also I'm waiting for a USB2CAN dongle by 8devices (ordered from EXP Tech), it should arrive today if DHL does its thing on time.
The MCP2515 and MCP2551 seem to be the most common chips used by DYI/Arduino/etc users, not that surprising as there aren't that many breadboard friendly CAN chips available. For example the is a new controller available by Microchip, the MCP25625 with integrated CAN bus tranceiver, but it is not trough hole friendly as it is only available in SSOP-28L and 6x6 QFN-28L. But I wouldn't be surprised if someone will offer breakoutboards soon.
But one new chip is quite nice for users of 3.3V systems, for example the Arduino Due that has 2 CAN busses included in the Atmel SAM3X8E ARM Cortex-M3 CPU but no transceiver. The MCP2562 transceiver, it has separate voltages for the IO and CAN bus part, so you can plug it directly into any low-voltage device without the need of any level converters. I need to get myself some of those for my Due as I would prefer as little extra components as possible.
![]() |
| MCP2515 and MCP2551 |
The MCP2515 and MCP2551 seem to be the most common chips used by DYI/Arduino/etc users, not that surprising as there aren't that many breadboard friendly CAN chips available. For example the is a new controller available by Microchip, the MCP25625 with integrated CAN bus tranceiver, but it is not trough hole friendly as it is only available in SSOP-28L and 6x6 QFN-28L. But I wouldn't be surprised if someone will offer breakoutboards soon.
But one new chip is quite nice for users of 3.3V systems, for example the Arduino Due that has 2 CAN busses included in the Atmel SAM3X8E ARM Cortex-M3 CPU but no transceiver. The MCP2562 transceiver, it has separate voltages for the IO and CAN bus part, so you can plug it directly into any low-voltage device without the need of any level converters. I need to get myself some of those for my Due as I would prefer as little extra components as possible.
Friday, April 25, 2014
Getting on the CAN bus
I co-worker from waaay back (199?) contacted me a while ago about helping out with some issues he had with a linux system that talks with a CAN bus. A very interesting system. But I won't go into specifics here on that point.
Anyway, CAN bus. Most will probably think OBD-II, cars and ELM327, understandable as that is what it was designed for. And that was just about all I did know about it myself too. Researching into it some more was very enlightening and I got some cool ideas on how to use CAN for one of my own little forever projects.
Now, CAN bus is quite simple, two wires, differential. All you need is a transceiver, a controller and something to tie that into your computer, USB, RS232, PCI, etc. Some Linux friendly and cheap boards even have CAN bus integrated in their SoC. And there are some easy to interface SPI controllers that you can use with your favourite microcontroller.
What makes it really interesting is that most of the low-level stuff is handled on-chip. Software does not need to care about timings, arbitration, bit-stuffing, CRC and all that. It is all on the chip. And you have a wide choice of bandwidth/length options. Need to connect that sensor a 100 meters away ? No problem. And thanks to being designed for hostile environments it should work over just about any two wires, or so I've heard.
There are some limits of course. Maximum data packet size is a whooping 8 bytes. And messages have only have a message ID, no sender or receiver ID. So the network is a 1:N broadcast network. But still, that is quite OK for a sensor network.
I ordered a couple of MCP2515 and MCP2551 chips and I hope I have some time do play with them soon.
Anyway, CAN bus. Most will probably think OBD-II, cars and ELM327, understandable as that is what it was designed for. And that was just about all I did know about it myself too. Researching into it some more was very enlightening and I got some cool ideas on how to use CAN for one of my own little forever projects.
Now, CAN bus is quite simple, two wires, differential. All you need is a transceiver, a controller and something to tie that into your computer, USB, RS232, PCI, etc. Some Linux friendly and cheap boards even have CAN bus integrated in their SoC. And there are some easy to interface SPI controllers that you can use with your favourite microcontroller.
What makes it really interesting is that most of the low-level stuff is handled on-chip. Software does not need to care about timings, arbitration, bit-stuffing, CRC and all that. It is all on the chip. And you have a wide choice of bandwidth/length options. Need to connect that sensor a 100 meters away ? No problem. And thanks to being designed for hostile environments it should work over just about any two wires, or so I've heard.
There are some limits of course. Maximum data packet size is a whooping 8 bytes. And messages have only have a message ID, no sender or receiver ID. So the network is a 1:N broadcast network. But still, that is quite OK for a sensor network.
I ordered a couple of MCP2515 and MCP2551 chips and I hope I have some time do play with them soon.
Subscribe to:
Posts (Atom)
