Back to home page

OSCL-LXR

 
 

    


0001 ===========================
0002 Walkera WK-0701 transmitter
0003 ===========================
0004 
0005 Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
0006 helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
0007 this transmitter as joystick
0008 
0009 Devel homepage and download:
0010 http://zub.fei.tuke.sk/walkera-wk0701/
0011 
0012 or use cogito:
0013 cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick
0014 
0015 
0016 Connecting to PC
0017 ================
0018 
0019 At back side of transmitter S-video connector can be found. Modulation
0020 pulses from processor to HF part can be found at pin 2 of this connector,
0021 pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
0022 modulation pulses to PC, signal pulses must be amplified.
0023 
0024 Cable: (walkera TX to parport)
0025 
0026 Walkera WK-0701 TX S-VIDEO connector::
0027 
0028  (back side of TX)
0029      __   __              S-video:                                  canon25
0030     /  |_|  \             pin 2 (signal)              NPN           parport
0031    / O 4 3 O \            pin 3 (GND)        LED        ________________  10 ACK
0032   ( O 2   1 O )                                         | C
0033    \   ___   /      2 ________________________|\|_____|/
0034     | [___] |                                 |/|   B |\
0035      -------        3 __________________________________|________________ 25 GND
0036                                                           E
0037 
0038 I use green LED and BC109 NPN transistor.
0039 
0040 Software
0041 ========
0042 
0043 Build kernel with walkera0701 module. Module walkera0701 need exclusive
0044 access to parport, modules like lp must be unloaded before loading
0045 walkera0701 module, check dmesg for error messages. Connect TX to PC by
0046 cable and run jstest /dev/input/js0 to see values from TX. If no value can
0047 be changed by TX "joystick", check output from /proc/interrupts. Value for
0048 (usually irq7) parport must increase if TX is on.
0049 
0050 
0051 
0052 Technical details
0053 =================
0054 
0055 Driver use interrupt from parport ACK input bit to measure pulse length
0056 using hrtimers.
0057 
0058 Frame format:
0059 Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
0060 (downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
0061 
0062 Signal pulses
0063 -------------
0064 
0065 ::
0066 
0067                      (ANALOG)
0068       SYNC      BIN   OCT
0069     +---------+      +------+
0070     |         |      |      |
0071   --+         +------+      +---
0072 
0073 Frame
0074 -----
0075 
0076 ::
0077 
0078  SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..
0079 
0080 pulse length
0081 ------------
0082 
0083 ::
0084 
0085    Binary values:               Analog octal values:
0086 
0087    288 uS Binary 0              318 uS       000
0088    438 uS Binary 1              398 uS       001
0089                                 478 uS       010
0090                                 558 uS       011
0091                                 638 uS       100
0092   1306 uS SYNC                  718 uS       101
0093                                 798 uS       110
0094                                 878 uS       111
0095 
0096 24 bin+oct values + 1 bin value = 24*4+1 bits  = 97 bits
0097 
0098 (Warning, pulses on ACK are inverted by transistor, irq is raised up on sync
0099 to bin change or octal value to bin change).
0100 
0101 Binary data representations
0102 ---------------------------
0103 
0104 One binary and octal value can be grouped to nibble. 24 nibbles + one binary
0105 values can be sampled between sync pulses.
0106 
0107 Values for first four channels (analog joystick values) can be found in
0108 first 10 nibbles. Analog value is represented by one sign bit and 9 bit
0109 absolute binary value. (10 bits per channel). Next nibble is checksum for
0110 first ten nibbles.
0111 
0112 Next nibbles 12 .. 21 represents four channels (not all channels can be
0113 directly controlled from TX). Binary representations are the same as in first
0114 four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
0115 checksum for nibbles 12..23.
0116 
0117 After last octal value for nibble 24 and next sync pulse one additional
0118 binary value can be sampled. This bit and magic number is not used in
0119 software driver. Some details about this magic numbers can be found in
0120 Walkera_Wk-0701_PCM.pdf.
0121 
0122 Checksum calculation
0123 --------------------
0124 
0125 Summary of octal values in nibbles must be same as octal value in checksum
0126 nibble (only first 3 bits are used). Binary value for checksum nibble is
0127 calculated by sum of binary values in checked nibbles + sum of octal values
0128 in checked nibbles divided by 8. Only bit 0 of this sum is used.