Joral Technologies | Software Supplier Company

Subscribe: RSS Feed Entries Feed (RSS) or RSS Feed Comments Feed (RSS).

October 8, 2009

CAN Primer: Creating your own Network #2

Summer 2009 Version 1.01
by Robert Boys, bob.boys@arm.com San Jose, California for the NXP LPC2300 series

Introduction:

CAN is extensively used in automobiles and trucks but has found applications everywhere. There are many “application” layers available for CAN such as ISO 15765 (cars), J1939 (trucks) and CANopen (factory automation) but it is very easy to develop your own protocol that will fit and simplify your needs. Modern CAN transceivers provide a stable and reliable CAN physical environment without the need for expensive coaxial cables. Most of the mystery of CAN has dissipated over the years. There is plenty of example CAN software available to help you quickly develop your own network.


A CAN controller is a sophisticated device. Nearly all the features of the CAN protocol described below are automatically handled by the controller with almost no intervention by the host processor. All you need to do is configure the controller by writing to its registers, write data to the controller and the controller then does all the housekeeping work to get your message on the bus. The controller will also read any frames it sees on the bus and hold them in a small FIFO memory. It will notify the host processor that this data is available which you then read from the controller. The controller also contains a hardware filter mechanism called an Acceptance Filter that can be programmed to ignore those CAN frames you do not want passed to the processor. See app note AN10674 for more information: www.nxp.com/microcontrollers.

Main Features of CAN:

For the purposes of this article; we will assume a CAN network consists of the physical layer (the voltages and the wires) and a frame consisting of an ID and a varying number of data bytes. CAN has the following general attributes:

  1. 11 or 29 bit ID and from zero to 8 data bytes. TIP: The number of data bytes can be changed “on the fly”.
  2. Peer to Peer network. Every node can see all messages from all other nodes. A node can’t read its own messages.
  3. Nodes are really easy to add. Just attach one to the network with two wires plus a ground.
  4. Higher priority messages are sent first depending on the value of the ID. A lower ID has the higher priority.
  5. Automatic retransmission of defective frames. A node will “buss-off” if it causes too many errors.
  6. Speeds from approximately 10 Kbps to 1 Mbps. TIP: All nodes must operate at the same frequency.
  7. The twisted differential pair provides excellent noise immunity and some decent bus fault protection.
  8. The CAN system will work with the ground connection at different DC levels. TIP: Or no ground at all.

Click to view the document

No Comments »

No comments yet.

Leave a comment

Subscribe: RSS Feed Entries Feed (RSS) or RSS Feed Comments Feed (RSS).