blob: 8f4289efc5c44965138d8184674f86421e07712a [file] [log] [blame]
Peter Popoveccec87e32008-11-11 14:46:14 -05001
2Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
3helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
4this transmitter as joystick
5
6Devel homepage and download:
7http://zub.fei.tuke.sk/walkera-wk0701/
8
9or use cogito:
10cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick
11
12
13Connecting to PC:
14
15At back side of transmitter S-video connector can be found. Modulation
16pulses from processor to HF part can be found at pin 2 of this connector,
17pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
18modulation pulses to PC, signal pulses must be amplified.
19
20Cable: (walkera TX to parport)
21
22Walkera WK-0701 TX S-VIDEO connector:
23 (back side of TX)
24 __ __ S-video: canon25
25 / |_| \ pin 2 (signal) NPN parport
26 / O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK
27 ( O 2 1 O ) | C
28 \ ___ / 2 ________________________|\|_____|/
29 | [___] | |/| B |\
30 ------- 3 __________________________________|________________ 25 GND
31 E
32
33
34I use green LED and BC109 NPN transistor.
35
36Software:
37
38Build kernel with walkera0701 module. Module walkera0701 need exclusive
39access to parport, modules like lp must be unloaded before loading
40walkera0701 module, check dmesg for error messages. Connect TX to PC by
41cable and run jstest /dev/input/js0 to see values from TX. If no value can
42be changed by TX "joystick", check output from /proc/interrupts. Value for
43(usually irq7) parport must increase if TX is on.
44
45
46
47Technical details:
48
49Driver use interrupt from parport ACK input bit to measure pulse length
50using hrtimers.
51
52Frame format:
53Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
54(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
55
56Signal pulses:
57 (ANALOG)
58 SYNC BIN OCT
59 +---------+ +------+
60 | | | |
61--+ +------+ +---
62
63Frame:
64 SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..
65
66pulse length:
67 Binary values: Analog octal values:
68
69 288 uS Binary 0 318 uS 000
70 438 uS Binary 1 398 uS 001
71 478 uS 010
72 558 uS 011
73 638 uS 100
74 1306 uS SYNC 718 uS 101
75 798 uS 110
76 878 uS 111
77
7824 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits
79
80(Warning, pulses on ACK ar inverted by transistor, irq is rised up on sync
81to bin change or octal value to bin change).
82
83Binary data representations:
84
85One binary and octal value can be grouped to nibble. 24 nibbles + one binary
86values can be sampled between sync pulses.
87
88Values for first four channels (analog joystick values) can be found in
89first 10 nibbles. Analog value is represented by one sign bit and 9 bit
90absolute binary value. (10 bits per channel). Next nibble is checksum for
91first ten nibbles.
92
93Next nibbles 12 .. 21 represents four channels (not all channels can be
94directly controlled from TX). Binary representations ar the same as in first
95four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
96checksum for nibbles 12..23.
97
98After last octal value for nibble 24 and next sync pulse one additional
99binary value can be sampled. This bit and magic number is not used in
100software driver. Some details about this magic numbers can be found in
101Walkera_Wk-0701_PCM.pdf.
102
103Checksum calculation:
104
105Summary of octal values in nibbles must be same as octal value in checksum
106nibble (only first 3 bits are used). Binary value for checksum nibble is
107calculated by sum of binary values in checked nibbles + sum of octal values
108in checked nibbles divided by 8. Only bit 0 of this sum is used.
109