- Posts: 18
Questions about the FlySky protocol
- th9xer
- Topic Author
- Offline
Less
More
05 Feb 2013 18:31 - 05 Feb 2013 19:59 #6058
by th9xer
Questions about the FlySky protocol was created by th9xer
OK I come here from the land of Turnigy 9x in search of protocol information.
I have one of these little quads www.jperkinsdistribution.co.uk/detail.ph...6600036&activepage=1 similar to the V949 I hear. It uses the A7105 and more or less works with the FlySky module in that you can fly it but you can't switch the LEDs on or off, boo
So I go digging a little deeper and start sniffing the SPI bus to the A7105. I see you guys have already been doing just this. Your work has greatly speeded my learning up, a thousand thanks ! My goal is to make a PPM to A7105 SPI interface that I can control so it will switch my LEDs(, and eventually work with a few other models I have).
Having my sniffed packets in one hand, the A7105 datasheet in another, and your source code in my third hand, I now have a couple of questions hopefully you can help with.
Once the initialization is done I see packets like this:
My first question is the file deviation/doc/Flysky.txt suggests the data is sent in a 22 byte packet.
The source code file deviation/src/protocol/flysky_a7105.c and my observations suggest the data packets are 21 bytes
Which is right ? (both and I'm wrong ?)
Second question. Again in flysky_a7105.c the packet[] array elements 1,2,3,and 4 are 32 bit variable labelled id, but page 65 of the A7105 datasheet suggests the "ID code" is bytes 0,1,2, and 3 of the FIFO buffer ?
What am I missing ?
Thanks.
Cam.
I have one of these little quads www.jperkinsdistribution.co.uk/detail.ph...6600036&activepage=1 similar to the V949 I hear. It uses the A7105 and more or less works with the FlySky module in that you can fly it but you can't switch the LEDs on or off, boo
So I go digging a little deeper and start sniffing the SPI bus to the A7105. I see you guys have already been doing just this. Your work has greatly speeded my learning up, a thousand thanks ! My goal is to make a PPM to A7105 SPI interface that I can control so it will switch my LEDs(, and eventually work with a few other models I have).
Having my sniffed packets in one hand, the A7105 datasheet in another, and your source code in my third hand, I now have a couple of questions hopefully you can help with.
Once the initialization is done I see packets like this:
0xE Strobe
0x05 0xAA 0x51 0x01 0x00 0x30 0xFB 0xF9 0x8A 0x48 0x9D 0x9D 0x42 0x4F 0x3C 0xDA 0x00 0x00 0x51 0x05 0x16 0x36
0x0F 0x01
0xD Strobe
My first question is the file deviation/doc/Flysky.txt suggests the data is sent in a 22 byte packet.
The source code file deviation/src/protocol/flysky_a7105.c and my observations suggest the data packets are 21 bytes
line 167: A7105_WriteData(packet, 21, 1);
Which is right ? (both and I'm wrong ?)
Second question. Again in flysky_a7105.c the packet[] array elements 1,2,3,and 4 are 32 bit variable labelled id, but page 65 of the A7105 datasheet suggests the "ID code" is bytes 0,1,2, and 3 of the FIFO buffer ?
What am I missing ?
Thanks.
Cam.
Last edit: 05 Feb 2013 19:59 by th9xer.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
Less
More
- Posts: 4402
05 Feb 2013 20:11 #6061
by PhracturedBlue
Replied by PhracturedBlue on topic Questions about the FlySky protocol
it is 21 bytes. It is 22 bytes if you count the '05' which you shouldn't. So my docs need updating.
There are 2 different IDs:
the A7105 has its own ID which is part of the preamble sent. I believe this is what the A7105 docs are talking about
the Turnigy protocol has a 'transmitter id' which is stored in the Tx EEPROM which is what you see in the code.
I redefine the transmitter id to also be unique per-model so you don't accidently bind with a wrong configuration.
There are 2 different IDs:
the A7105 has its own ID which is part of the preamble sent. I believe this is what the A7105 docs are talking about
the Turnigy protocol has a 'transmitter id' which is stored in the Tx EEPROM which is what you see in the code.
I redefine the transmitter id to also be unique per-model so you don't accidently bind with a wrong configuration.
Please Log in or Create an account to join the conversation.
- th9xer
- Topic Author
- Offline
Less
More
- Posts: 18
05 Feb 2013 22:31 - 05 Feb 2013 22:54 #6065
by th9xer
Replied by th9xer on topic Questions about the FlySky protocol
OK, got the 21 bytes. I guessed the 05 might be getting included.
So how is the A7105 ID code set ? It's not part of the 21 byte data packet ?
EDIT: Blind from looking at the data sheet. It is in register 0x06 and pointer is reset every time you start an access. I wish I had found this earlier, been driving me nuts. What's worse I watched it get set in my captured data and thought that looks like an ID getting set ! And everything falls into place.
Is it just me or have I seen better written datasheets ?
So how is the A7105 ID code set ? It's not part of the 21 byte data packet ?
EDIT: Blind from looking at the data sheet. It is in register 0x06 and pointer is reset every time you start an access. I wish I had found this earlier, been driving me nuts. What's worse I watched it get set in my captured data and thought that looks like an ID getting set ! And everything falls into place.
Is it just me or have I seen better written datasheets ?
Last edit: 05 Feb 2013 22:54 by th9xer.
Please Log in or Create an account to join the conversation.
Time to create page: 0.035 seconds
- Home
- Forum
- Development
- Protocol Development
- Questions about the FlySky protocol