Thread: Discussion FlySky/Turnigy 9X Protocol
View Single Post
Old Feb 08, 2013, 08:00 AM
ThierryRC is offline
Find More Posts by ThierryRC
Registered User
France, Alsace, Strasbourg
Joined Dec 2012
78 Posts
Originally Posted by dave1993 View Post
you maybe mean to say "not implemented all 16 hopping sequences, only the first one". or "only the first row". a sequence (row) contains 16 bytes (columns). there are 16 repeating sequences. so instead of:

andlw 0xF0 ;row=tableOffset <- (id0 & 0x0F)*1

your code should be:

andlw 0x0F ;row=tableOffset <- (id0 & 0x0F)*1
then shift left 4 ???


shift rt 4 then
andlw 0xF0 ;row=tableOffset <- (id0 & 0x0F)*1

i dont see why the issue was confused with all that modulus baloney. we are just talking digits here because "mod 16" is same as "and 0xf".

btw how are you checking your algorithm?
i do:
swapf id0 then andlw 0xF0 = swap low/high nibble of id0 so bit0..3 became bit4..7 and vice-versa and then only keep bit4..7 = (id0 & 0x0F)*16
That works with the first 16 sequences.

I check with oscilloscope (gio pin) that receiver gets all tx packets (looks like a square wave, period =1.46ms or 685Hz) and it is just fine.

Dave when you say that you have tested home made RX with different TX, you mean you have tested the RX I have done ? (I remember you said that you ordered some pics and a pckit3 prog/debuger).
If the answer is yes then there may be two reasons to have troubles:
1 - I just implemented the first 16 hopping sequences so if tx id0 > 16, it does not bind.
2 - I have allready done and tested 3 RX (1x 6ch old version, and 2x 7ch version) and the last one was sometimes missing packets ! the trouble was that 1.5ms time-out (see pic code) between 2 successive packets is two close to 1.46ms ! I think cheap TX or/and pic internal oscillator is/are not so accurate. So I changed time-out to 2ms and now it works fine...
I could send you a rx if you are ready to do tests. Would be cheaper for me than buying hundreds of tx

btw I ended TX code and tested it connected to the module connector (ppm out) of an optic6 tx. To do so you need a resistor in series and a 3v zener diode in parallel to ch1 in order to limit ppm voltage input (I fried my 6ch prototype because I thought that with just a 10k resistor in series pic could't not latch-up but it does! so don't forget zener diode) So yesterday I played with quadcopter after midnight (I was happy but my wife was not so happy...) It was more pleasant than with original TX... I have to do range tests...

Let me clean pic code and I'll do updates soon
ThierryRC is offline Find More Posts by ThierryRC
Last edited by ThierryRC; Feb 08, 2013 at 08:05 AM.
Reply With Quote