6 years, 5 months ago.

CAN communication between two controllers

Can anyone tell me how to send "Hello world" from one controller(mbed lpc1768) to another controller (mbed lpc1768) through CAN communication using MCP2551?

2 Answers

6 years, 5 months ago.

Hello Meena,

As first step I'd recommend you to read David's wonderful notebook page CAN - Getting Started. Then have a look at the Handbook CAN example. Although this demo is utilizing NUCLEO boards, it may help you get started. Just substitute pins PA_2, PA_3 with USBTX, USBRX in the code and PA_11, PA_12 with p30, p29 in the schematic and code as well. Then compile for LPC1768.

NOTE: Since in CAN world the maximum length of payload data is eight bytes and "Hello world" exceeds this limitation, it's impossible to send such text in one message. Nevertheless, there exist several CAN based high level communication protocols (for example CANopen) which overcome such barrier.

Accepted Answer
6 years, 5 months ago.

With a quick search, I found this, and I'm sure there are others.

https://docs.mbed.com/docs/mbed-os-api-reference/en/5.3/APIs/interfaces/digital/CAN/