<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to CANprotocol</title><link>https://sourceforge.net/p/mergcbus/wiki/CANprotocol/</link><description>Recent changes to CANprotocol</description><atom:link href="https://sourceforge.net/p/mergcbus/wiki/CANprotocol/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 22 May 2014 09:52:35 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/mergcbus/wiki/CANprotocol/feed" rel="self" type="application/rss+xml"/><item><title>CANprotocol modified by Mike Johnson</title><link>https://sourceforge.net/p/mergcbus/wiki/CANprotocol/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="mergcbus-communication-protocol"&gt;MERGCBUS Communication Protocol&lt;/h1&gt;
&lt;h2 id="opcodes"&gt;Opcodes&lt;/h2&gt;
&lt;p&gt;Opcode - the first data byte is the opcode which includes the length of the message in the upper 3 bits. This is followed by up to 7 more data bytes. &lt;/p&gt;
&lt;p&gt;&lt;span&gt;[NumericIndex]&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[General]&lt;/span&gt;&lt;br /&gt;
&lt;a class="" href="../NodeNumber"&gt;Node Number Protocol&lt;/a&gt;&lt;br /&gt;
&lt;a class="" href="../Accessory"&gt;Accessory Protocol&lt;/a&gt;&lt;br /&gt;
&lt;a class="" href="../NodeVariables"&gt;Node Variable Protocol&lt;/a&gt;&lt;br /&gt;
&lt;a class="" href="../Events"&gt;Event Teaching Protocol&lt;/a&gt;&lt;br /&gt;
&lt;a class="" href="../Loader"&gt;Loader Protocol&lt;/a&gt;&lt;br /&gt;
&lt;a class="" href="../Track"&gt;Track and Command Station Control&lt;/a&gt;&lt;br /&gt;
&lt;a class="" href="../Train"&gt;Train Control&lt;/a&gt;&lt;br /&gt;
&lt;a class="" href="../DCC"&gt;Direct DCC&lt;/a&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;h2 id="can-header"&gt;CAN Header&lt;/h2&gt;
&lt;p&gt;General CAN message format: 11 bit CAN header, up to 8 data bytes. &lt;/p&gt;
&lt;p&gt;11 bit CAN header, 4 bits priority, 7 bits CANID. &lt;/p&gt;
&lt;p&gt;bits 9 - 10 of the CAN header. Major or Dynamic Priority, elevated by the node to gain access based on a transmit fail count.&lt;br /&gt;
bits 7 - 8 of the CAN header. Minor or Static priority based on message and node type.&lt;br /&gt;
bits 0 - 6 of the CAN header, CANID is a CAN segment-unique ID, assigned via enumeration. &lt;/p&gt;
&lt;p&gt;Priority values:&lt;br /&gt;
0000 0 - High access, Emergency priority&lt;br /&gt;
0001 1 - Above Normal access, Emergency priority&lt;br /&gt;
0010 2 - Normal access, Emergency priority&lt;br /&gt;
0011 3 - Low access, Emergency priority&lt;br /&gt;
0100 4 - High access, High priority&lt;br /&gt;
0101 5 - Above Normal access, High priority&lt;br /&gt;
0110 6 - Normal access, High priority&lt;br /&gt;
0111 7 - Low access, High priority&lt;br /&gt;
1000 8 - High access, Normal priority&lt;br /&gt;
1001 9 - Above Normal access, Normal priority&lt;br /&gt;
1010 A - Normal access, Normal priority&lt;br /&gt;
1011 B - Low access, Normal priority&lt;br /&gt;
1100 C - spare&lt;br /&gt;
1101 D - spare&lt;br /&gt;
1110 E - spare&lt;br /&gt;
1111 F - Can't be used (First 7 bits cannot be 1's)&lt;br /&gt;
&lt;/p&gt;
&lt;h2 id="flim"&gt;FLiM&lt;/h2&gt;
&lt;p&gt;FLiM nodes have a "setup mode", which is entered by pressing the pushbutton on the node. This can't be done over the CAN link because two identical nodes would both go into setup mode, the only way it could be done would be to have a worldwide unique node serial number. &lt;/p&gt;
&lt;h2 id="serial-protocol"&gt;Serial Protocol&lt;/h2&gt;
&lt;p&gt;This is used by CANRS and CANUSB modules and is based on the Gridconnect scheme. &lt;/p&gt;
&lt;p&gt;The ASCII string start with :S to indicate a standard frame. The next character is the priority. The next 2 characters are the CANID. The next character is zero. The next character is N or R for Normal or RTR frame. This is followed by the data bytes in hex and a ; &lt;/p&gt;
&lt;p&gt;Example. &lt;/p&gt;
&lt;p&gt;:SB200N9000200007; This is a normal priority control packet from CANID 32(20 hex). The opc is ACON=90, the next 4 characters give the node number NN and the last 4 the event number. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mike Johnson</dc:creator><pubDate>Thu, 22 May 2014 09:52:35 -0000</pubDate><guid>https://sourceforge.net79f86e6a605b10ee5fbdecc894c899feb8c4e7d4</guid></item></channel></rss>