Instructions
239 C-Control Pro IDE
© 2013 Conrad Electronic
Less than 125 kbit/s
Up to 1000m
The line lengths are highly dependent on the used cables and the number of participants. It is pos-
sible to use a "twist-pair cables with a characteristic impedance 108-132 Ohm. A maximum of 32
MEGA128CAN units can operate on a bus. It is best to start at the theoretical maximum speed for
the used cable length, and to lower the transfer rate when there is no packet transfer at all or there
occur too many packet errors.
The MEGA128CAN supports the "Base frame format" CAN 2.0A (11 bit identifier) and the extended
frame format "CAN 2.0B (29 bit identifier).
To use the CAN bus in your own projects together with the C-Control Pro Mega128 CAN, it is essen-
tial to understand the CAN data format and the technical details of the CAN bus. Background inform-
ation can be found in books and in Wikipedia: http://en.wikipedia.org/wiki/Controller_Area_Network
Message Objects
The active CAN bus controller works with 15 (MEGA128CAN) or 16 (AVR32Bit) independent mes-
sage objects (MOb) with which one can send and receive messages with certain identifiers. For this
purpose the message objects are parametrized with CAN_SetMOb() for the related task.
Message Objects with a low MOb number have always precedence before a MOb with a higher
number. When two MOb's are capable to receive a certain message, the message will be received
from the MOb with the lower number.
CAN Protocol
The CAN bus controller can simultaneously process normal packets (CAN 2.0A) and extended
packets (CAN 2.0B). CAN bus identifier are passed as 32-bit dword (ULong). Depending on the type
of packets an identifier is 11-bit (V2.0 part A) or 29-bit long (V2.0 part B). The unused bits are ig-
nored. The maskID determines which packages are received for a specific identifier (ID). Only the
bits in the maskID that are "1" are to be reviewed at a bit comparison between the set identifier and
the ID of the incoming packet.
automatic reply
If a Message Object is set to automatic reply, the MOb inherits the Data Length Code (DLC) of the
incoming remote trigger package. I.e. the sender of the trigger packet determines with the DLC the
number of data bytes that are sent in the reply packet.
Message FIFO
During the initialization of the CAN library the user provides RAM for the message FIFO, in which all
incoming CAN packets are stored. The received messages can then be read asynchronously from
the FIFO.