18c2ecf20Sopenharmony_ci===========================
28c2ecf20Sopenharmony_ciWalkera WK-0701 transmitter
38c2ecf20Sopenharmony_ci===========================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciWalkera WK-0701 transmitter is supplied with a ready to fly Walkera
68c2ecf20Sopenharmony_cihelicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
78c2ecf20Sopenharmony_cithis transmitter as joystick
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciDevel homepage and download:
108c2ecf20Sopenharmony_cihttp://zub.fei.tuke.sk/walkera-wk0701/
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cior use cogito:
138c2ecf20Sopenharmony_cicg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciConnecting to PC
178c2ecf20Sopenharmony_ci================
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciAt back side of transmitter S-video connector can be found. Modulation
208c2ecf20Sopenharmony_cipulses from processor to HF part can be found at pin 2 of this connector,
218c2ecf20Sopenharmony_cipin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
228c2ecf20Sopenharmony_cimodulation pulses to PC, signal pulses must be amplified.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciCable: (walkera TX to parport)
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciWalkera WK-0701 TX S-VIDEO connector::
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci (back side of TX)
298c2ecf20Sopenharmony_ci     __   __              S-video:                                  canon25
308c2ecf20Sopenharmony_ci    /  |_|  \             pin 2 (signal)              NPN           parport
318c2ecf20Sopenharmony_ci   / O 4 3 O \            pin 3 (GND)        LED        ________________  10 ACK
328c2ecf20Sopenharmony_ci  ( O 2   1 O )                                         | C
338c2ecf20Sopenharmony_ci   \   ___   /      2 ________________________|\|_____|/
348c2ecf20Sopenharmony_ci    | [___] |                                 |/|   B |\
358c2ecf20Sopenharmony_ci     -------        3 __________________________________|________________ 25 GND
368c2ecf20Sopenharmony_ci                                                          E
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciI use green LED and BC109 NPN transistor.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciSoftware
418c2ecf20Sopenharmony_ci========
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciBuild kernel with walkera0701 module. Module walkera0701 need exclusive
448c2ecf20Sopenharmony_ciaccess to parport, modules like lp must be unloaded before loading
458c2ecf20Sopenharmony_ciwalkera0701 module, check dmesg for error messages. Connect TX to PC by
468c2ecf20Sopenharmony_cicable and run jstest /dev/input/js0 to see values from TX. If no value can
478c2ecf20Sopenharmony_cibe changed by TX "joystick", check output from /proc/interrupts. Value for
488c2ecf20Sopenharmony_ci(usually irq7) parport must increase if TX is on.
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciTechnical details
538c2ecf20Sopenharmony_ci=================
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciDriver use interrupt from parport ACK input bit to measure pulse length
568c2ecf20Sopenharmony_ciusing hrtimers.
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciFrame format:
598c2ecf20Sopenharmony_ciBased on walkera WK-0701 PCM Format description by Shaul Eizikovich.
608c2ecf20Sopenharmony_ci(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ciSignal pulses
638c2ecf20Sopenharmony_ci-------------
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci::
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci                     (ANALOG)
688c2ecf20Sopenharmony_ci      SYNC      BIN   OCT
698c2ecf20Sopenharmony_ci    +---------+      +------+
708c2ecf20Sopenharmony_ci    |         |      |      |
718c2ecf20Sopenharmony_ci  --+         +------+      +---
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ciFrame
748c2ecf20Sopenharmony_ci-----
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci::
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_cipulse length
818c2ecf20Sopenharmony_ci------------
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci::
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci   Binary values:		Analog octal values:
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci   288 uS Binary 0		318 uS       000
888c2ecf20Sopenharmony_ci   438 uS Binary 1		398 uS       001
898c2ecf20Sopenharmony_ci				478 uS       010
908c2ecf20Sopenharmony_ci				558 uS       011
918c2ecf20Sopenharmony_ci				638 uS       100
928c2ecf20Sopenharmony_ci  1306 uS SYNC			718 uS       101
938c2ecf20Sopenharmony_ci				798 uS       110
948c2ecf20Sopenharmony_ci				878 uS       111
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci24 bin+oct values + 1 bin value = 24*4+1 bits  = 97 bits
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci(Warning, pulses on ACK are inverted by transistor, irq is raised up on sync
998c2ecf20Sopenharmony_cito bin change or octal value to bin change).
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ciBinary data representations
1028c2ecf20Sopenharmony_ci---------------------------
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ciOne binary and octal value can be grouped to nibble. 24 nibbles + one binary
1058c2ecf20Sopenharmony_civalues can be sampled between sync pulses.
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ciValues for first four channels (analog joystick values) can be found in
1088c2ecf20Sopenharmony_cifirst 10 nibbles. Analog value is represented by one sign bit and 9 bit
1098c2ecf20Sopenharmony_ciabsolute binary value. (10 bits per channel). Next nibble is checksum for
1108c2ecf20Sopenharmony_cifirst ten nibbles.
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ciNext nibbles 12 .. 21 represents four channels (not all channels can be
1138c2ecf20Sopenharmony_cidirectly controlled from TX). Binary representations are the same as in first
1148c2ecf20Sopenharmony_cifour channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
1158c2ecf20Sopenharmony_cichecksum for nibbles 12..23.
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ciAfter last octal value for nibble 24 and next sync pulse one additional
1188c2ecf20Sopenharmony_cibinary value can be sampled. This bit and magic number is not used in
1198c2ecf20Sopenharmony_cisoftware driver. Some details about this magic numbers can be found in
1208c2ecf20Sopenharmony_ciWalkera_Wk-0701_PCM.pdf.
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciChecksum calculation
1238c2ecf20Sopenharmony_ci--------------------
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ciSummary of octal values in nibbles must be same as octal value in checksum
1268c2ecf20Sopenharmony_cinibble (only first 3 bits are used). Binary value for checksum nibble is
1278c2ecf20Sopenharmony_cicalculated by sum of binary values in checked nibbles + sum of octal values
1288c2ecf20Sopenharmony_ciin checked nibbles divided by 8. Only bit 0 of this sum is used.
129