Lantronix DSTni-EX manual CANBUS Background, Data Exchanges and Communication

Models: DSTni-EX

1 95
Download 95 pages 56.41 Kb
Page 64
Image 64

CANBUS Background

CAN is a fast and highly reliable, multicast/multimaster, prioritized serial communications protocol that is designed to provide reliable and cost-effective links. CAN uses a twisted-pair cable to communicate at speeds of up to 1 MB/s with up to 127 nodes. It was originally developed to simplify wiring in automobiles. Today, it is often used in automotive and industrial- control applications.

Data Exchanges and Communication

A CAN message contains an identifier field, a data field and error, acknowledgement, and cyclic Redundancy check (CRC) fields.

The identifier field consists of 11 bits for CAN 2.0A or 29 bits for CAN 2.0B. The size of the data field is variable, from zero to 8 bytes.

When data transmits over a CAN network, no individual nodes are addressed. Instead, the message is assigned an identifier that uniquely identifies its data content.

The identifier defines not only the message content, but also the message priority. Any node can access the bus. After successful arbitration by one node, all other nodes on the bus become receivers. After receiving the message correctly, these nodes perform an acceptance test to determine if the data is relevant to that particular node. Therefore, it is not only possible to perform communication on a peer-to-peer basis, where a single node accepts the message; it is also possible to perform broadcast and synchronized communications, whereby multiple nodes can accept the same message that is sent in a single transmission.

Arbitration and Error Checking

CAN employs the Carrier Sense Multiple Access with Collision Detection (CSMA/CD) mechanism to arbitrate access to the bus. Unlike other bus systems, CAN does not use acknowledgement messages, which cost bandwidth on the bus. All nodes check each frame for errors. Any node in the system that detects an error immediately signals this to the transmitter. By having all nodes check for errors in transmitted frames, CAN provides high network data security.

CANBUS error checking includes:

CRC errors Acknowledgement errors Frame errors

Bit errors

Bit stuffing errors

The concept of bit stuffing involves inserting a bit of opposite polarity when more than five consecutive bits have the same polarity. If an error is detected by any of the other nodes, regardless of whether the message was meant for it or not, the current transmission aborts by transmission of an active error frame. An active error frame consists of six consecutive dominant bits and prevents other nodes from accepting the erroneous message. The active error frame violates bit stuffing and can also corrupt the fixed form of the frame, causing other nodes to transmit their own active error frames. After an active error frame, the transmitting node retransmits the frame automatically within a fixed period of time.

56

Page 64
Image 64
Lantronix DSTni-EX manual CANBUS Background, Data Exchanges and Communication, Arbitration and Error Checking