User Tools

Site Tools


cangc1e-firmware-en
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


cangc1e-firmware-en [2018/11/12 08:56] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== CAN-GC1e Firmware ======
 +[[english|{{  rocrail-logo-35.png}}]]
 +[[english|Content]] -> [[english#hardware|Hardware]] -> [[english#merg_cbus|MERG CBUS]]
 +  * [[:cbus:overview-en|CAN-GC Overview]]
 +  * [[:can-gca1-en|CAN-GC1]] | **[[:can-gca1e-en|CAN-GC1e]]** | [[:can-gca2-en|CAN-GC2]] | [[:can-gc3-en|CAN-GC3]] | [[:can-gc4-en|CAN-GC4]] | [[:can-gca5-en|CAN-GC5]] | [[:can-gc6-en|CAN-GC6]] | [[:can-gc7-en|CAN-GC7]]
 +    * **[[:cangc1e-firmware-en|Firmware]]**
 +    * [[:cbus:can-protocol|CAN Protocol]]
 + \\
 +
 + \\
 +===== Copyrights =====
 +  * (c) [[http://www.rocrail.net|Rob Versluis, rocrail.net]]
 +  * (c) [[http://www.merg.org.uk/|MERG]]
 +  * (c) [[http://www.microchip.com/|Microchip Technology Inc.]] (TCP/IP Stack v3)
 +
 +
 + \\
 +
 +===== Protocol =====
 +The protocol used over Ethernet will be the same as used for the CANRS and CANUSB: Gridconnect ASCII Frames.\\
 +
 +====ASCII Frame====
 +<code>
 +:Sh1h2Nd0<d1><d2><d3><d4><d5><d6><d7>;
 +:     -> Start of frame
 +S     -> Frame type: S=Standard, X=Extended, Y=Ethernet
 +h1    -> SIDH <bit7,6,5,4=Prio> <bit3,2,1,0=high 4 part of CAN-ID> (2 byte HEXA)
 +h2    -> SIDL <bit7,6,5=low 3 part of CAN-ID> (2 byte HEXA)
 +N     -> N=normal R=RTR¹
 +d0    -> OPC  (2 byte HEXA)
 +d1-d7 -> Data (2 byte HEXA)
 +;     -> End of frame
 +</code>
 +¹) RTR = "Request-To-Transmit"; Not used for MergCBUS.
 +
 +
 +===Ethernet(Y)===
 +The Ethernet Frames are for communication between client and CAN-GC1e only.\\
 +^ OPC ^ Description ^ Data ^
 +|  0  | Ping; Resets the idle timer. | - |
 +|  1  | Status report event.\\ Triggered by the number of connections. | d1: error code\\ d2: number of connections\\ d3: max.¹ CAN queue\\ d4: max.¹ Ethernet queue |
 +|  2  | Command Ack with return code, OPC and ticker. | d1: error code\\ d2: the OPC acknowledged\\ d3: ticker (continuous running number from 0 to 255) |
 +¹) The highest queue index used so far.\\
 + \\
 +^ Error code ^ Description ^
 +|  0  | OK |
 +|  1  | RC_UNKNOWN_ASCII_FRAME |
 + \\
 +Trace snippet:
 +<code>
 +cbreader OCBUS    1205 Ethernet status: rc=0 con=1 maxcanQ=1 maxethQ=4
 +...
 +cbreader OCBUS    1215 Ethernet command Ack: rc=0 opc=0x71 cmdticker=28
 +</code>
 +
 +===Extended(X)===
 +Extended frames are used for Boot loading new firmware over the CBUS.\\
 +  * {{:cbus:cbus-bootloader.pdf}}
 +  * {{:cbus:an247.pdf}}
 +
 +
 + \\
 +===== Default settings =====
 +At initial startup, first time, the firmware expects EEPROM address 0 to have a value of 0xFF. This will trigger writing the default setup values into EEPROM like IP address, MAC and so on.\\
 +If the programmer did overwrite the EEPROM with other values it can be triggered by holding down the pushbutton at power up.\\
 +
 + \\
 +
 +===== IDs =====
 +| NMRA Manufacturer ID |  70 |
 +| Product ID |  11 |
 +| Default node number |  11 |
 +| Default CanID |  11 |\\
 +
 + \\
 +===== Node Variables =====
 +^ # ^ Description ^
 +|  1 | node configuration |
 +|  2 | CAN-ID¹ (Read only) |
 +|  3-6 | IP Address |
 +|  7-10 | NetMask |
 +|  11-16 | MAC Address |
 +|  17 | Idle time in 500ms |
 +¹) The CAN-ID is token from the frames coming from the PC.\\
 +
 +
 +
 + \\
 +
 +==== Node configuration byte ====
 +^ Bit ^  Function  ^ Remark ^
 +|  0 | Idle time watch dog | This will disconnect a client after reaching the idle timer. |
 +|  1 | Power off at idle | Only available in case of an active idle time watch dog. |
 +|  2 | Activate command ack. | Every incoming command on the ethernet will be acknowledged using an 'Y' frame. \\ The client may ignore it or use it as handshake for sending a next command. |
 +
 + \\
 +
 +===== Binaries =====
 +  * https://launchpad.net/rocrail-hardware/+download
 +
 +===== Sources =====
 +  * https://gitlab.com/rocrail/GCA/tree/master/cbus
 +
 + \\
 +
 +===== Development Tools =====
 +  * MPLAB X v1.00
 +  * C18 v3.40
 +  * PICKit 3
 +  * **[[:pic-adap-en|PICKit3 Adapter]]**
 +
 + \\
  
cangc1e-firmware-en.txt · Last modified: 2018/11/12 08:56 by 127.0.0.1