View Single Post
  #7   Spotlight this post!  
Unread 24-11-2014, 17:19
s1900ahon s1900ahon is offline
Registered User
AKA: Scott McMahon
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 155
s1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant futures1900ahon has a brilliant future
Re: CAN - what, why, how in 2015

Quote:
Originally Posted by FrankJ View Post
CAN is a digital serial data bus. Somewhat like USB but also a lot different. Each device on the bus has a node number between 1 & 63. 1 is generally reserved since a lot of devices come out the box addressed as one. If you car has an OBD-II port on it, it uses canbus.
Having 64 devices on the CAN bus is an artifact of the way the CAN MessageID field was partitioned for Jaguar, it isn't really a CAN thing.

A packet on the CAN bus has a number of fields including the MessageID field. The MessageID field is either 11 or 29 bits long (29 bits in our case). CAN devices sync up on the bus.. if a node determines it wants to transmit a packet and one is being transmitted it must wait for the prior packet transmission to complete before all nodes with a packet may transmit their packet. The CAN bus signaling and the field ordering in the CAN packet handles arbitration, basically, the lowest-valued MessageID wins.

When defining Jaguar and how it would use CAN, the Luminary Micro team had to consider how the MessageID field would be partitioned. They created a number of subfields and field values to arbitrate important messages (safety related), provide a framework for motor-controller functions, provide a firmware update mechanism, and provide for future expansion (CAN being used by other vendors). The fields defined include a vendor value, device type, function class, function sub-class, source node, destination node, etc. The encoding of 0 for most fields indicated a system or safety function (e.g. MessageID = 0 was "halt" if I recall correctly).

As it turned out, the node fields ended up at 6 bits, each. Node 0 was reserved for broadcast (all nodes accept), node 1 was the factory value for a Jaguar (so it was recommended that 1 not be used), and so node values 2..63 were available for use.