Unterschiede zwischen den Revisionen 1 und 24 (über 23 Versionen hinweg)
Revision 1 vom 19.11.2008 22:55
Größe: 287
Autor: ligi
Kommentar: initial
Revision 24 vom 23.11.2008 15:23
Größe: 2170
Autor: ligi
Kommentar: using cplusplus parser instead table
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 1: Zeile 1:
[[TableOfContents]]

= Protocol =
 . The protocol is based on individual serial data frames that are organized as shown in the following table.

 ||<tablewidth="690px" tableheight="43px" tablestyle="text-align: center;"bgcolor="#cccccc">Start-Byte||<bgcolor="#cccccc">Address-Byte||<bgcolor="#cccccc">ID-Byte||<bgcolor="#cccccc">n Data-Bytes coded||<bgcolor="#cccccc">CRC-Byte1||<bgcolor="#cccccc">CRC-Byte2||<bgcolor="#cccccc">Stop-Byte||
 ||<style="text-align: center;">'#' ||<style="text-align: center;">variable ||<style="text-align: center;">'V','D' etc ||<style="text-align: center;">"modified-base64" ||<style="text-align: center;">variable ||<style="text-align: center;">variable ||<style="text-align: center;">'\r' ||
Zeile 2: Zeile 9:
 The Commands are listed in SerialCommands.  . The Commands based on the dataframes above are listed [:en/SerialCommands:here]
= Slave Adresses =
 . Since Navi 0.12h FC 0.71f Mag 0.19 there are constant !SlaveAdresses:
 ||<tablewidth="" tablestyle="text-align: center;"bgcolor="#cccccc">Slave-Address||<bgcolor="#cccccc">Part||
 ||<style="text-align: center;"> 1 ||<style="text-align: center;"> FC ||
 ||<style="text-align: center;"> 2 ||<style="text-align: center;"> NC ||
 ||<style="text-align: center;"> 3 ||<style="text-align: center;"> MK3MAG ||
= Data Format =
 Have a look into the Functions Decode64 and !SendOutData in uart.c of the FC Firmware to see how the Data is encoded and decoded.
 . /!\ ToDo: describe data-format
= Checksum =
 {{{#!cplusplus
unsigned int tmpCRC = 0;
for(int i = 0; i < DataBufferLength;i++)
 {
  tmpCRC += DataBuffer[i];
 }
tmpCRC %= 4096;
CRC1 = '=' + tmpCRC / 64;
CRC2 = '=' + tmpCRC % 64; }}}
Zeile 4: Zeile 30:
= Slave Adresses =  . /!\ ToDo: describe checksum calculation verbaly
= Implementations =
 Sometimes its a lot more easy to look at code rather than reather than to look at Specifications/Documentation:
 * uart.c in the Flight-Ctrl Firmware ( C )
 * MKCommunicator.java from ["DUBwise"] ( Java / J2ME )
 * mktool.cpp @ ["QMKGroundStation"] ( C++ )
 * !GroundStation ( !LabView )
Zeile 6: Zeile 38:
 Since Navi 0.12h FC 0.71f Mag 0.19 there are constant SlaveAdresses: = Links =
 * http://mikrokopter.de/forum/topic-1735-1.html ( german )
Zeile 8: Zeile 41:
 || ''Slave-Address'' || ''Part'' ||
 || 1 || FC ||
 || 2 || ||
 || 3 || ||


----
 CategoryCoding KategorieEnglish
----
 . CategoryCoding KategorieEnglish KategorieFirmware

TableOfContents

Protocol

  • The protocol is based on individual serial data frames that are organized as shown in the following table.

    Start-Byte

    Address-Byte

    ID-Byte

    n Data-Bytes coded

    CRC-Byte1

    CRC-Byte2

    Stop-Byte

    '#'

    variable

    'V','D' etc

    "modified-base64"

    variable

    variable

    '\r'

Commands

  • The Commands based on the dataframes above are listed [:en/SerialCommands:here]

Slave Adresses

  • Since Navi 0.12h FC 0.71f Mag 0.19 there are constant SlaveAdresses:

    Slave-Address

    Part

    1

    FC

    2

    NC

    3

    MK3MAG

Data Format

  • Have a look into the Functions Decode64 and SendOutData in uart.c of the FC Firmware to see how the Data is encoded and decoded.

  • /!\ ToDo: describe data-format

Checksum

  •    1 unsigned int tmpCRC = 0; 
       2 for(int i = 0; i <  DataBufferLength;i++)
       3  { 
       4   tmpCRC += DataBuffer[i]; 
       5  }   
       6 tmpCRC %= 4096; 
       7 CRC1 = '=' + tmpCRC / 64; 
       8 CRC2 = '=' + tmpCRC % 64; 
    
  • /!\ ToDo: describe checksum calculation verbaly

Implementations

  • Sometimes its a lot more easy to look at code rather than reather than to look at Specifications/Documentation:
  • uart.c in the Flight-Ctrl Firmware ( C )
  • MKCommunicator.java from ["DUBwise"] ( Java / J2ME )
  • mktool.cpp @ ["QMKGroundStation"] ( C++ )
  • GroundStation ( LabView )

Links