This documentation is out of date.

The new version of the documentation is here: https://cannylogic.com/docs

Difference between revisions of "CANNY 5.2 duo, CAN Driver"

From CANNY Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Created page with "== General Description == Контроллеры CANNY 5.2 duo имеют два независимых интерфейса CAN. Two dedicated external outputs of CANNY 5.2...")
 
 
Line 1: Line 1:
 
== General Description ==
 
== General Description ==
  
Контроллеры CANNY 5.2 duo имеют два независимых интерфейса CAN. Two dedicated external outputs of CANNY 5.2 duo controller, located on the 4-pin connector X1, provided for connection to Interface CAN0 (CAN0-H and CAN0-L), and dedicated external outputs, located on the 2-pin connector X3, provided for connection to Interface CAN1 (CAN1-H and CAN1-L), used for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.
+
Controllers CANNY 5.2 duo have two independent CAN interfaces. Two special external contact Canny controller 5.2 duo, located on the 4-pin connector X1 (CAN0-H and CAN0-L of CAN0 interface) and the contacts on the 2-pin connector X3 (CAN1-H and CAN1-L of CAN1 interface), provided for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-buses]'''.
  
Особенностью драйвера CAN контроллера CANNY 5.2 duo является то, что количество фильтров принимаемых сообщений интерфейса CAN0, как и у [[CANNY 5.2]], равно 8 (против 16 у [[CANNY 7]]), а у интерфейса CAN1 их всего 4.
+
A feature of the driver CAN controller CANNY 5.2 duo is that the number of filters CAN0 interface is equal to 8 (compared to 16 in [[CANNY 7]]). CAN1 interface have only 4 filters.
  
***Интерфейсы CAN0 и CAN1 имеют индивидуальные настройки и могут работать на разных скоростях обмена данными, что позволяет подключать контроллер CANNY 5.2 duo одновременно к двум разным шинам CAN.
+
Interfaces CAN0 and CAN1 have individual settings and can operate at different speeds of data exchange that allows you to connect CANNY 5.2 duo controller simultaneously to two different CAN buses.
  
 
== Driver's registers ==
 
== Driver's registers ==
  
Below is a description of valid values for registers controlling CAN-bus driver operation.
+
Below is a description of valid values for registers controlling CAN-bus driver operation, where x is a CAN interface number (0 or 1).
  
CAN driver configuration registers allows to set the parameters of the controller as a CAN bus node:
+
CAN driver configuration registers allows to set the parameters of the controller as a CAN bus node for the used CAN interface:
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
 
|- align="center" valign="top"
 
|- align="center" valign="top"
Line 20: Line 20:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"| CAN Mode Setup Register
+
|style="padding-left:0.5em;"| CANx Mode Setup Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 27: Line 27:
 
|width="70px" style="padding-left:0.5em;"|1...N
 
|width="70px" style="padding-left:0.5em;"|1...N
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|driver activation and CAN-messages transmit/receive speed setting (defined by a special constant of constants directory);
+
|style="padding-left:0.5em;"|driver activation and CAN-messages transmit/receive speed setting for the used CAN interface (defined by a special constant of constants directory);
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
Line 37: Line 37:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDL 0
+
|style="padding-left:0.5em;"|CANx Acceptance Filter Identifier Register IDL 0
 
|- valign="top"
 
|- valign="top"
 
|style="padding-left:0.5em;"|...
 
|style="padding-left:0.5em;"|...
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDL 15
+
|style="padding-left:0.5em;"|CANx Acceptance Filter Identifier Register IDL 7
 
|}
 
|}
 
|
 
|
Line 54: Line 54:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDH 0
+
|style="padding-left:0.5em;"|CANx Acceptance Filter Identifier Register IDH 0
 
|- valign="top"
 
|- valign="top"
 
|style="padding-left:0.5em;"|...
 
|style="padding-left:0.5em;"|...
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDH 15
+
|style="padding-left:0.5em;"|CANx Acceptance Filter Identifier Register IDH 7
 
|}
 
|}
 
|
 
|
Line 71: Line 71:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Listen Only Mode Enable Register
+
|style="padding-left:0.5em;"|CANx Listen Only Mode Enable Register
 
|}
 
|}
 
|
 
|
Line 78: Line 78:
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN messages passive reception mode enabled (listen only);
+
|style="padding-left:0.5em;"|CAN messages passive reception mode for the used CAN interface enabled (listen only);
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN messages reception and transmission mode enabled (normal);
+
|style="padding-left:0.5em;"|CAN messages reception and transmission mode for the used CAN interface enabled (normal);
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 88: Line 88:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Acceptance Filter Enable Register
+
|style="padding-left:0.5em;"|CANx Acceptance Filter Enable Register
 
|}
 
|}
 
|
 
|
Line 95: Line 95:
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN received messages filtering mode enabled;
+
|style="padding-left:0.5em;"|CAN received messages filtering mode for the used CAN interface enabled;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN received messages filtering mode disabled;
+
|style="padding-left:0.5em;"|CAN received messages filtering mode for the used CAN interface disabled;
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 105: Line 105:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Transmitting Cancel On Error Register
+
|style="padding-left:0.5em;"|CANx Transmitting Cancel On Error Register
 
|}
 
|}
 
|
 
|
Line 112: Line 112:
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN transmitting cancel on error is enabled;
+
|style="padding-left:0.5em;"|CAN transmitting cancel on error for CAN0 interface is enabled, for CAN1 interface is always enabled;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN transmitting cancel on error is disabled.
+
|style="padding-left:0.5em;"|CAN transmitting cancel on error for CAN0 interface is disabled.
 
|}
 
|}
 
|}
 
|}
Line 130: Line 130:
 
|}
 
|}
  
CAN driver configuration is defined by a constant predetermined data transmission/reception speed.
+
CANx driver configuration is defined by a constant predetermined data transmission/reception speed.
  
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
Line 141: Line 141:
 
|}
 
|}
  
Named constants that represent CAN configuration parameters combination, available to the user in the "CAN Modes" CannyLab constants directory, which can be accessed via function block entry context menu having "constant" type.
+
Named constants that represent CAN configuration parameters combination, available to the user in the "CANx Modes" CannyLab constants directory, which can be accessed via function block entry context menu having "constant" type.
  
 
CAN driver diagnostics registers allows the user to determine the status of the driver in one or another moment of a diagram execution.
 
CAN driver diagnostics registers allows the user to determine the status of the driver in one or another moment of a diagram execution.
Line 152: Line 152:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Idle Register
+
|style="padding-left:0.5em;"|CANx Idle Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 159: Line 159:
 
|width="70px" style="padding-left:0.5em;"|1
 
|width="70px" style="padding-left:0.5em;"|1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN driver activity is absent, the bus is idle, the data reception is not performed;
+
|style="padding-left:0.5em;"|CAN driver activity of the used interface is absent, the bus is idle, the data reception is not performed;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN activity registered.
+
|style="padding-left:0.5em;"|CAN activity of the used interface registered.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 169: Line 169:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Overflow Register
+
|style="padding-left:0.5em;"|CANx Overflow Register
 
|}
 
|}
 
|
 
|
Line 176: Line 176:
 
|width="70px" style="padding-left:0.5em;"|1
 
|width="70px" style="padding-left:0.5em;"|1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|error, CAN buffer is full;
+
|style="padding-left:0.5em;"|error, CAN buffer of the used interface is full;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|no overflow of the receive buffer.
+
|style="padding-left:0.5em;"|no overflow of the used interface receive buffer.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 186: Line 186:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Error Register
+
|style="padding-left:0.5em;"|CANx Error Register
 
|}
 
|}
 
|
 
|
Line 193: Line 193:
 
|width="70px" style="padding-left:0.5em;"|1
 
|width="70px" style="padding-left:0.5em;"|1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN reception error rate exceeds a threshold;
+
|style="padding-left:0.5em;"|CAN reception error rate of the used interface exceeds a threshold;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN reception error rate below an acceptable threshold.
+
|style="padding-left:0.5em;"|CAN reception error rate of the used interface below an acceptable threshold.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 203: Line 203:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Ready To Send Register
+
|style="padding-left:0.5em;"|CANx Ready To Send Register
 
|}
 
|}
 
|
 
|
Line 210: Line 210:
 
|width="70px" style="padding-left:0.5em;"|1
 
|width="70px" style="padding-left:0.5em;"|1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN driver data transmit buffer is empty and ready to send new messages;
+
|style="padding-left:0.5em;"|CAN driver data transmit buffer of the used interface is empty and ready to send new messages;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN driver data transmit buffer is not ready.
+
|style="padding-left:0.5em;"|CAN driver data transmit buffer of the used interface is not ready.
 
|}
 
|}
 
|}
 
|}
Line 227: Line 227:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Data Set Ready Register
+
|style="padding-left:0.5em;"|CANx Data Set Ready Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 234: Line 234:
 
|width="70px" style="padding-left:0.5em;"|1
 
|width="70px" style="padding-left:0.5em;"|1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|CAN driver receive buffer has received message, this value appears in the register for one cycle of diagram execution, stating the relevance of data stored in the receive buffer;
+
|style="padding-left:0.5em;"|CAN driver receive buffer of the used interface has received message, this value appears in the register for one cycle of diagram execution, stating the relevance of data stored in the receive buffer;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|there is no data in the CAN driver receive buffer.
+
|style="padding-left:0.5em;"|there is no data in the CAN driver receive buffer of the used interface.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 244: Line 244:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Received Data Register IDL
+
|style="padding-left:0.5em;"|CANx Received Data Register IDL
 
|}
 
|}
 
|
 
|
Line 251: Line 251:
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|the value of the lower part of the identifier received CAN-message.
+
|style="padding-left:0.5em;"|the value of the lower part of the identifier received CAN-message of the used interface.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 257: Line 257:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Received Data Register IDH
+
|style="padding-left:0.5em;"|CANx Received Data Register IDH
 
|}
 
|}
 
|
 
|
Line 264: Line 264:
 
|width="70px" style="padding-left:0.5em;"|0...0x1FFF
 
|width="70px" style="padding-left:0.5em;"|0...0x1FFF
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|the value of the higher part of the identifier received CAN-message.
+
|style="padding-left:0.5em;"|the value of the higher part of the identifier received CAN-message of the used interface.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 270: Line 270:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Received Data Register ERL
+
|style="padding-left:0.5em;"|CANx Received Data Register ERL
 
|}
 
|}
 
|
 
|
Line 277: Line 277:
 
|width="70px" style="padding-left:0.5em;"|0...0xC000
 
|width="70px" style="padding-left:0.5em;"|0...0xC000
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|a value equal to the number of bytes of data in the received message, signs EXT and RTR (See note).
+
|style="padding-left:0.5em;"|a value equal to the number of bytes of data in the received message of the used interface, signs EXT and RTR (See note).
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 283: Line 283:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Received Data Register D1:D0
+
|style="padding-left:0.5em;"|CANx Received Data Register D1:D0
 
|- valign="top"
 
|- valign="top"
 
|style="padding-left:0.5em;"|...
 
|style="padding-left:0.5em;"|...
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Received Data Register D7:D6
+
|style="padding-left:0.5em;"|CANx Received Data Register D7:D6
 
|}
 
|}
 
|
 
|
Line 294: Line 294:
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|values of the corresponding data bytes received in CAN message, two bytes per register.
+
|style="padding-left:0.5em;"|values of the corresponding data bytes received in CAN message of the used interface, two bytes per register.
 
|}
 
|}
 
|}
 
|}
Line 312: Line 312:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Request To Send Register
+
|style="padding-left:0.5em;"|CANx Request To Send Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 319: Line 319:
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|load data from the transfer registers in to CAN driver send buffer;
+
|style="padding-left:0.5em;"|load data from the transfer registers in to CAN driver send buffer of the used interface;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|0
 
|width="70px" style="padding-left:0.5em;"|0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|do not load data to CAN driver transmission buffer.
+
|style="padding-left:0.5em;"|do not load data to CAN driver transmission buffer of the used interface.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 329: Line 329:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Transmit Data Register IDL
+
|style="padding-left:0.5em;"|CANx Transmit Data Register IDL
 
|}
 
|}
 
|
 
|
Line 336: Line 336:
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|the value of the lower part of the identifier transmitting CAN-message.
+
|style="padding-left:0.5em;"|the value of the lower part of the identifier transmitting CAN-message of the used interface.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 342: Line 342:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Transmit Data Register IDH
+
|style="padding-left:0.5em;"|CANx Transmit Data Register IDH
 
|}
 
|}
 
|
 
|
Line 349: Line 349:
 
|width="70px" style="padding-left:0.5em;"|0...0x1FFF
 
|width="70px" style="padding-left:0.5em;"|0...0x1FFF
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|the value of the higher part of the identifier transmitting CAN-message.
+
|style="padding-left:0.5em;"|the value of the higher part of the identifier transmitting CAN-message of the used interface.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 355: Line 355:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Transmit Data Register ERL
+
|style="padding-left:0.5em;"|CANx Transmit Data Register ERL
 
|}
 
|}
 
|
 
|
Line 362: Line 362:
 
|width="70px" style="padding-left:0.5em;"|0...0xC000
 
|width="70px" style="padding-left:0.5em;"|0...0xC000
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|the value equal to the number of bytes of data in the transmitted message signs EXT и RTR (see note).
+
|style="padding-left:0.5em;"|the value equal to the number of bytes of data in the transmitted message of the used interface, signs EXT и RTR (see note).
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 368: Line 368:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Transmit Data Register D1:D0
+
|style="padding-left:0.5em;"|CANx Transmit Data Register D1:D0
 
|- valign="top"
 
|- valign="top"
 
|style="padding-left:0.5em;"|...
 
|style="padding-left:0.5em;"|...
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|CAN Transmit Data Register D7:D6
+
|style="padding-left:0.5em;"|CANx Transmit Data Register D7:D6
 
|}
 
|}
 
|
 
|
Line 379: Line 379:
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|style="padding-left:0.5em;"|
 
|style="padding-left:0.5em;"|
|style="padding-left:0.5em;"|values of the corresponding data byte of transmitting CAN message, two bytes per register.
+
|style="padding-left:0.5em;"|values of the corresponding data byte of transmitting CAN message of the used interface, two bytes per register.
 
|}
 
|}
 
|}
 
|}
Line 390: Line 390:
 
== Examples ==
 
== Examples ==
  
An example of a functional diagram of the data sent to the CAN bus. Performing diagram the controller once every 100 ms, transmits to the bus at a speed of 125 kbps, the data about the state of its three inputs, using a standard format message with the identifier 0x123, contains a single byte of data.
+
An example of a functional diagram of the data sent to the CAN bus via interface CAN0. Performing diagram the controller once every 100 ms, transmits to the bus at a speed of 125 kbps, the data about the state of its three inputs, using a standard format message with the identifier 0x123, contains a single byte of data.
  
[[File:6_9_2_1.png]]
+
[[File:14_7_2_1.png]]
  
An example of a functional diagram of the data receive from the CAN bus. Performing the diagram controller, receiving message from the bus in standard format with ID 0x0123, containing one byte of data, sets on three of its outputs, states in accordance with received value.
+
An example of a functional diagram of the data receive from the CAN bus via interface CAN0. Performing the diagram controller, receiving message from the bus in standard format with ID 0x0123, containing one byte of data, sets on three of its outputs, states in accordance with received value.
  
[[File:6_9_2_2.png]]
+
[[File:14_7_2_2.png]]
 
+
An example of a functional diagram of the data receive from the CAN bus. Performing the diagram controller, receiving message on the bus in standard format with an ID 0x01F3, analyzes contained in one of the  message bytes a value and sets on its outputs and built-in LED corresponding states.
+
 
+
[[File:6_9_2_3.png]]
+
  
 
== See also ==
 
== See also ==
[[CANNY 7]]
+
[[CANNY 5.2 duo]]
 
+
[[CANNY 7, LIN Driver]]
+

Latest revision as of 15:33, 14 December 2016

General Description

Controllers CANNY 5.2 duo have two independent CAN interfaces. Two special external contact Canny controller 5.2 duo, located on the 4-pin connector X1 (CAN0-H and CAN0-L of CAN0 interface) and the contacts on the 2-pin connector X3 (CAN1-H and CAN1-L of CAN1 interface), provided for connection to digital information CAN-buses.

A feature of the driver CAN controller CANNY 5.2 duo is that the number of filters CAN0 interface is equal to 8 (compared to 16 in CANNY 7). CAN1 interface have only 4 filters.

Interfaces CAN0 and CAN1 have individual settings and can operate at different speeds of data exchange that allows you to connect CANNY 5.2 duo controller simultaneously to two different CAN buses.

Driver's registers

Below is a description of valid values for registers controlling CAN-bus driver operation, where x is a CAN interface number (0 or 1).

CAN driver configuration registers allows to set the parameters of the controller as a CAN bus node for the used CAN interface:

Address Expected values
CANx Mode Setup Register
1...N = driver activation and CAN-messages transmit/receive speed setting for the used CAN interface (defined by a special constant of constants directory);
0 = driver disabled.
CANx Acceptance Filter Identifier Register IDL 0
...
CANx Acceptance Filter Identifier Register IDL 7
0...0xFFFF = set filter value for lower part of CAN-message identifier(bits 0...10 identifier standard format or bits 0...15 expanded identifier format);
CANx Acceptance Filter Identifier Register IDH 0
...
CANx Acceptance Filter Identifier Register IDH 7
0...0x1FFF = set filter value for higher part of CAN-message identifier (bits 16...28 expanded identifier format);
CANx Listen Only Mode Enable Register
≥ 1 = CAN messages passive reception mode for the used CAN interface enabled (listen only);
0 = CAN messages reception and transmission mode for the used CAN interface enabled (normal);
CANx Acceptance Filter Enable Register
≥ 1 = CAN received messages filtering mode for the used CAN interface enabled;
0 = CAN received messages filtering mode for the used CAN interface disabled;
CANx Transmitting Cancel On Error Register
≥ 1 = CAN transmitting cancel on error for CAN0 interface is enabled, for CAN1 interface is always enabled;
0 = CAN transmitting cancel on error for CAN0 interface is disabled.
Note: In passive receiving CAN messages mode (listen only), unlike normal CAN mode, the driver operates to receive data from CAN-bus, but does not send a confirmation of reception and does not puts network in an error state when it detects such. Thus, the controller remains invisible to the other devices on the bus, does not prove itself. For normal network operation, there must be present at least two devices operating in the normal mode.
Note: When filter mode enabled the CAN driver will accept only those messages whose identifiers match values in CAN message receive filter installation registers, ignoring all others.

CANx driver configuration is defined by a constant predetermined data transmission/reception speed.

Parameter A list of acceptable values
Data transmission/reception speed, Kbit/s 10; 33; 50; 83; 95.2; 100; 125; 250; 500; 1000

Named constants that represent CAN configuration parameters combination, available to the user in the "CANx Modes" CannyLab constants directory, which can be accessed via function block entry context menu having "constant" type.

CAN driver diagnostics registers allows the user to determine the status of the driver in one or another moment of a diagram execution.

Address Returning Values
CANx Idle Register
1 = CAN driver activity of the used interface is absent, the bus is idle, the data reception is not performed;
0 = CAN activity of the used interface registered.
CANx Overflow Register
1 = error, CAN buffer of the used interface is full;
0 = no overflow of the used interface receive buffer.
CANx Error Register
1 = CAN reception error rate of the used interface exceeds a threshold;
0 = CAN reception error rate of the used interface below an acceptable threshold.
CANx Ready To Send Register
1 = CAN driver data transmit buffer of the used interface is empty and ready to send new messages;
0 = CAN driver data transmit buffer of the used interface is not ready.

CAN driver receiving registers allows access to the values obtained on the bus.

Address Return values
CANx Data Set Ready Register
1 = CAN driver receive buffer of the used interface has received message, this value appears in the register for one cycle of diagram execution, stating the relevance of data stored in the receive buffer;
0 = there is no data in the CAN driver receive buffer of the used interface.
CANx Received Data Register IDL
0...0xFFFF = the value of the lower part of the identifier received CAN-message of the used interface.
CANx Received Data Register IDH
0...0x1FFF = the value of the higher part of the identifier received CAN-message of the used interface.
CANx Received Data Register ERL
0...0xC000 = a value equal to the number of bytes of data in the received message of the used interface, signs EXT and RTR (See note).
CANx Received Data Register D1:D0
...
CANx Received Data Register D7:D6
0...0xFFFF = values of the corresponding data bytes received in CAN message of the used interface, two bytes per register.
Note: CAN Received Data Register ERL, in addition to the number of bytes in the received message 0 ... 8 least significant bits, contains in its most significant bits information about special message attributes: bit 15 - EXT sign & bit 14 - RTR sign. Where EXT = 1, when receive a message in the extended format, EXT = 0 for a standard message format; RTR = 1 when receiving remote data request, EXT = 0 when receiving normal message.

CAN transmit registers are used to accommodate data in the transmission buffer to be sent.

Address Expected values
CANx Request To Send Register
≥ 1 = load data from the transfer registers in to CAN driver send buffer of the used interface;
0 = do not load data to CAN driver transmission buffer of the used interface.
CANx Transmit Data Register IDL
0...0xFFFF = the value of the lower part of the identifier transmitting CAN-message of the used interface.
CANx Transmit Data Register IDH
0...0x1FFF = the value of the higher part of the identifier transmitting CAN-message of the used interface.
CANx Transmit Data Register ERL
0...0xC000 = the value equal to the number of bytes of data in the transmitted message of the used interface, signs EXT и RTR (see note).
CANx Transmit Data Register D1:D0
...
CANx Transmit Data Register D7:D6
0...0xFFFF values of the corresponding data byte of transmitting CAN message of the used interface, two bytes per register.
Note: CAN Transmit Data Register ERL, in addition to the number of bytes in the transmitting message 0 ... 8 least significant bits, contains in its most significant bits information about special message attributes: bit 15 - EXT sign & bit 14 - RTR sign. Where EXT = 1, when transmitting a message in the extended format, EXT = 0 for a standard message format; RTR = 1 when transmitting remote data request, EXT = 0 when receiving normal message.

Examples

An example of a functional diagram of the data sent to the CAN bus via interface CAN0. Performing diagram the controller once every 100 ms, transmits to the bus at a speed of 125 kbps, the data about the state of its three inputs, using a standard format message with the identifier 0x123, contains a single byte of data.

14 7 2 1.png

An example of a functional diagram of the data receive from the CAN bus via interface CAN0. Performing the diagram controller, receiving message from the bus in standard format with ID 0x0123, containing one byte of data, sets on three of its outputs, states in accordance with received value.

14 7 2 2.png

See also

CANNY 5.2 duo