Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 1 month ago.
Is CAN communication set up on the mbed?
What all do I need to do to communicate to another micro via CAN interface? The other micro already has CAN set up and I want to be able to send and receive CAN message id(s) to/from the other micro. I have the CAN transceiver with needed components and circuitry complete. I am wired to mbed dip pins 29 & 30 (CAN2). Do I need to set up the clock speed and registers? I am planning on using HS CAN (500Kb/s bit rate). I want to use 11-bit can id(s). Any and all help is greatly appreciated. Please help.
1 Answer
11 years ago.
Hi Chad, You might have found the answer already. Between the mbed and the actual CAN network, you need a transceiver chip. This is [often] an 8-pin part. There are several schematics scattered about the site, on this page you'll find one about half-way down.
For the software to make it go, here's the sample from the Handbook. I don't recall the default bit-rate by the mbed library, but a simple call like "can1.frequency(500000);" should work.
The CAN driver supports both 11 and 29-bit identifiers. Follow the samples and dig into the APIs in the Handbook and you'll see.
So, my recommendation would be to first experiment with the mbed and 2 channels of CAN (if you have the LPC17868). Wire them thru the transceivers to each other. Then you can experiment in a more controlled environment than with the other device you mention. Once you learn to send and receive basic messages, then you can figure out the 11 vs. 29-bit format. After that you're probably ready to tap in to the other network.