GPToys 993 Nano quadcopter

More
17 Sep 2015 14:07 - 17 Sep 2015 14:11 #37826 by ppisljar
GPToys 993 Nano quadcopter was created by ppisljar
I got this one yesterday and it flies really nice. Of course i had to open TX and check inside. its using xn297 chip. I recorded the SPI communication and it looks like its using V2o2 protocol.
However when i tried running the deviationTX code (i dont own devo yet ... i am running the code on arduino (just the protocol code with some changes like the setup() and loop() functions) it does not bind.

My guess was, that the code is written for nrf24l01 and becouse this one is running on xn297 i need to change few things ?

anyway, i tried to decode the rest of the protocol and it looks it has 3 phases (just like V2o2):
- initialization ... this one looks really weird, missing a lot of stuff + setting additional registers of xn297, but not to the values from datasheet ...
- BIND: reciever starts sending the packet with bind flag set (this looks exactly as V2o2 ... except the channels are different (or i dont correctly understand the channel table in V2o2 code))
- when you move stick up/down TX_ADDR is changed (this does not happen for V2o2 ?)
- then the packet without the bind flag starts to be transmitted

packet is sent every 4ms

i tried searching the forum here and on rcgroups to find more info on xn297 but i am not sure i understand everything correctly ... the emulation layer of deviationTX ... it actually encodes the packet somehow ? well in my situation the packet looks exactly the same as for V2o2 (with no xn297 emulation?) so i am not sure i should be encoding anything ?
my assumption was i can just skip the special registers ... but its not working correctly.

i am wondering if anyone would have some time to help me out with this one ?

in the attachment you can find recording of the spi communication: powerup of TX (quad is already on), stick moved up/down so it binds. (you will need USBee AX Suite to open it)
Attachments:
Last edit: 17 Sep 2015 14:11 by ppisljar.

Please Log in or Create an account to join the conversation.

More
17 Sep 2015 14:07 - 17 Sep 2015 14:09 #37827 by ppisljar
Replied by ppisljar on topic GPToys 993 Nano quadcopter
xn297 transciever IC
Initialization
SDO: E1 00 27 70 3F D1 3F 7F 9C 20 3E DA 9A B0 79 BB AB 9C 39 0B DF C4 A7 03 30 68 94 A6 D5 C3 21 00 22 01 23 03 24 00 31 10 26 03 3C 00 3D 00 20 0E 
SDI: 0E 00 0E 00 0E 00 00 00 00 00 0E 00 00 00 00 00 00 00 0E 00 00 00 00 00 0E 00 00 00 00 00 0E 00 0E 00 0E 00 0E 00 0E 00 0E 00 0E 00 0E 00 0E 00 

E1 00 // flush TX
27 70 // clear status register
3F D1 3F 7F 9C 20 // xn297 BB_CAL (in datasheet it is 0x20 0x9C 0x67 0x84 0x7F)
3E DA 9A B0 79 BB AB 9C // xn297 RF_CAL (in datasheet it is 0x95 0x2B 0x83 0x61 0xB0 0x9A 0xCA)
39 0B DF C4 A7 03 // xn297 DEMOD_CAL (in datasheet it is 03 A7 00 DF 0B)
30 68 94 A6 D5 C3 // TX_ADDR (default 0xE7E7E7E7E7 ... datasheet says RX_ADDR_P0 should be set to the same)
21 00 // disable auto ACK
22 01 // NRF24_REG_02_EN_RXADDR
23 03 // 5 byte data length
24 00 // retransmit rate
31 10 // NRF24_REG_11_RX_PW_P0
26 03 // NRF24_REG_06_RF_SETUP 
3C 00 // NRF24_REG_1C_DYNPD
3D 00 // NRF24_REG_1D_FEATURE
20 0E // NRF24_REG_00_CONFIG

wait 30ms

before bind
07 // read status
FF // nop
27 2E // write status
E1 00 // flush TX
25 47 // set channel
A0 00 00 00 00 40 40 40 7B 4E C1 4C 00 00 00 C0 56 // write command
one packet every 3.9ms
bind
30 2B A5 37 C5 4A // set TX address
26 07 // NRF24_REG_06_RF_SETUP

run
07 // read status
FF // nop
27 2E // clear status
E1 00 // flush TX
25 11 // set channel
A0 00 00 00 00 40 40 40 7B 4E C1 4C 00 00 00 00 96 // write command


channels (before bind): 0x07, 0x24, 0x3e, 0x2b, 0x47, 0x0e, 0x39, 0x1c
channels (after bind) : 0x0f, 0x2a, 0x4b, 0x21, 0x2d, 0x36, 0x11, 0x35
channel is switched every second packet
Last edit: 17 Sep 2015 14:09 by ppisljar.

Please Log in or Create an account to join the conversation.

More
18 Sep 2015 07:18 #37841 by ppisljar
Replied by ppisljar on topic GPToys 993 Nano quadcopter
i figured it out. I just replaced some calls with XN297_ emulation layer calls (setTxAdress, setRxAddress, writePayload) and now it works.

this should probably be added as an option to V2o2 protocol ?

Please Log in or Create an account to join the conversation.

More
21 Sep 2015 16:43 #37930 by SeByDocKy
Replied by SeByDocKy on topic GPToys 993 Nano quadcopter

ppisljar wrote: i figured it out. I just replaced some calls with XN297_ emulation layer calls (setTxAdress, setRxAddress, writePayload) and now it works.

this should probably be added as an option to V2o2 protocol ?



Well the V2x2 protocol is really nRF24L01 based .... maybe more a new option for any CX-10, Hantai, etc... XN297 protocol based ?

Please Log in or Create an account to join the conversation.

More
21 Sep 2015 19:48 #37936 by ppisljar
Replied by ppisljar on topic GPToys 993 Nano quadcopter
well this looks exactly V2o2 protocol, just that the chip in the transmitter/quad is XN297. the protocol does not resemble the CX-10 protocol. thats why i tought adding an option to V2o2 would be good idea (as maybe in the future more clones use x297 chip with this same protocol). It can also be added to cx10 protocol file but will need some more lines of code i guess.

Please Log in or Create an account to join the conversation.

More
28 Sep 2015 01:26 #38130 by hexfet
Replied by hexfet on topic GPToys 993 Nano quadcopter
Nice. Does seem best to add an option to the V202 protocol if none of the protocol logic is different.

Please Log in or Create an account to join the conversation.

More
02 Oct 2015 07:03 #38344 by ppisljar
Replied by ppisljar on topic GPToys 993 Nano quadcopter
I got more copters with ALMOUST identical protocol: MJX RC X800 and MJX RC X900 .

however i am looking for some feedback from people who put together the V202 protocol code, as some things are not completeley clear to me :

- TX and RX address .... are they something that was read out of copters ? or is it something random ?
u8 rx_tx_addr[] = {0x66, 0x88, 0x68, 0x68, 0x68};
u8 rx_p1_addr[] = {0x88, 0x66, 0x86, 0x86, 0x86};

for X800, x900 and GP993 this addresses are different. the RX_p1 doesnt really matter (i can change it to anything and it still works ? ) however the rx_tx address i must set to the one i read out of the original transmitter. else it doesnt work. i am not entirely sure how this works ? could somebody clarify ? like what does this actually mean ? shouldnt this be unique for every transmitter or sth like this ?


- the tx_id that is sent in a packet is 4 bytes (as oposed to 3 in the original V202)
- the channels are different. in V202 channels are based on tx_id ... however here i always use same channels (even if i randomize tx_id)
could someone explain how the channel table was put together for V202 ?
other things seem to be the same.

Please Log in or Create an account to join the conversation.

Time to create page: 0.041 seconds
Powered by Kunena Forum