Electrical – Interfacing an LPC2148 with a CAN module

arm7canmicrocontroller

I need to implement the CAN protocol to communicate between two LPC2148s. Now I am planning to use SPI for communication between a microcontroller and a CAN controller and then the CAN protocol for communication between two nodes.

Why do we need CAN transceivers? What does a CAN controller and a CAN transceiver do individually? Or in short, how does data from one node to another node flow?

I know this may be long answer, but I am not finding any resource on the Internet which can tell me all about communication from one node to another through SPI-CAN.

Best Answer

The CAN controller handles the actual CAN traffic, including bus arbitration, synchronization, CRC calculation etc etc. It is the brain of the communication, so to speak.

The CAN transceiver only handles the physical signal levels: voltage levels and the translation to/from differential signals. It also contains a lot of protection circuits against transients, ESD, brown-outs, short-circuits etc. These are very rugged circuits that can take quite a beating.

As a simplification, we can think of the CAN transceiver as layer 1 of the OSI model and the controller as layer 2.


That being said, using external CAN controllers is mostly a thing of the past, unless you have very specific requirements. For the past 20 years or so, the CAN controller is most often integrated in the MCU. The benefits of this are many: less error-prone, easier to work with, faster real-time access, cheaper, less board space needed.

So do yourself a big favour and forget about your LPC2148, but instead pick a MCU with CAN controller on-chip. NXP for example, have plenty of those to pick from, like LPC11C or Kinetis. As a bonus, you get an upgrade from legacy ARM7 to Cortex M.