walkera0701.txt 3.8 KB

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