Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to generate a CAN frame?

Status
Not open for further replies.
You can use the MCP2515 to generate a CAN frame. Here is the data sheet for the MCP2515 Datasheet

You will need to send the data to the MCP2515 by SPI, so you need an Arduino or something to generate the SPI signals.

Recently I helped with a project to generate CAN signals and we used this and this. All that was needed for the hardware was to plug one into the other. The driver library came from here. The board that you found will do much the same as the Arduino CAN shield, but it doesn't plug into the Arduino so easily, and it doesn't have a 12 - 5 V converter built in. We didn't want to take time on the hardware so we used the more expensive option.

If you just want to generate CAN frames using a computer, something like this will work fine and will take less setting up than an Arduino.

If you want minimal hardware, chose a mircocontroller with a CAN engine in it. That will need a CAN transceiver to get the voltage levels correct, and a board to fit it on, and something to program the microcontroller.
 
You can connect that to a PIC, with suitable software - the software libraries to make them work together are available on the Microchip site.

Or, a Raspberry Pi; various distros include or have available an MCP2515 driver that makes the CAN interface available as a standard device.

For the PIC, go to this page and select CAN in the function pulldown.

Also see the documents here, details of a development kit that uses the MCP2515.
There are schematics and source code examples etc. in the files.
 
I fairly recently built a device to control a vehicle dash cluster via can, I used the same module.
I used a library for arduino, and I found it fairly easy to do.
Dont forget termination resistors, the module has a pluggable link to engage 120ohm terminations.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top