- Posts: 3333
DSM2/X protocol errors
- vlad_vy
- Topic Author
- Offline
Note: Values are LSB 1st
0 1 2 3 4
0 03BC6E8AEFBDFEF8 83F7A82D7A4464D3 405632D90FD95D97 C0908FBB7C8E2B8E E1D631265FBD4093
1 8817133B2DBF06D6 3F2C4EAA71487AC9 8E4AD0A9A7FF20CA 8069268008F849E7 DC68089997AEAF8C
2 F1943021A11C88A9 17FF9E213690C782 4C979DBFB83DB5BE 7D2D4954D08040C1 C30E01160E3206BA
3 D0D28EBC822FE3B4 BC5D9A5BEE7F42EB 0C5D24309FCA6DBD B6F2E61B805A36B4 E08301FAAB3E8FAC
4 8CFA479B83A566D0 24F5DDF87A7774E7 501433DEF17895AD 42AE9C1CDA6705F6 5CD59CB8469C7D84
5 07BD9F26C8310FB8 3D707C94DC84AD95 0C3CFAF9F0F210C9 9B75F7E0148DB580 F1C6FE5C9DA54FB7
6 EF039589B471619D 1E6AF037527B11D4 F4DA06DBBF4E6FB3 BF5498B9B7305A88 58B5B3DD0E28F1B0
7 40BA97D5864FCCD1 62F52BAAFC33BFAF 9E08D1AE595EE8F0 35D1FC9723D4C988 5F303B569645F4A1
8 D7A154B15E89AE86 405632D90FD95D97 C0908FBB7C8E2B8E 88E1D631265FBD40 03BC6E8AEFBDFEF8
Bold value is incorrect, it has to be E1D631265FBD4093
I found next:
DX7
Channel [channel=1, sop=83f7a82d7a4464d3, pn=62f52baafc33bfaf405632d90fd95d97, crc_lsb=11, crx_msb=b4]
Channel [channel=1, sop=83f7a82d7a4464d3, pn=62f52baafc33bfaf405632d90fd95d97, crc_lsb=ee, crx_msb=4b]
Channel [channel=2, sop=405632d90fd95d97, pn=9e08d1ae595ee8f0c0908fbb7c8e2b8e, crc_lsb=11, crx_msb=b4]
Channel [channel=2, sop=405632d90fd95d97, pn=9e08d1ae595ee8f0c0908fbb7c8e2b8e, crc_lsb=ee, crx_msb=4b]
Channel [channel=3, sop=c0908fbb7c8e2b8e, pn=35d1fc9723d4c988e1d631265fbd4093, crc_lsb=11, crx_msb=b4]
Channel [channel=3, sop=c0908fbb7c8e2b8e, pn=35d1fc9723d4c988e1d631265fbd4093, crc_lsb=ee, crx_msb=4b]
Channel [channel=4, sop=e1d631265fbd4093, pn=5f303b569645f4a103bc6e8aefbdfef8, crc_lsb=ee, crx_msb=4b]
Channel [channel=4, sop=e1d631265fbd4093, pn=5f303b569645f4a103bc6e8aefbdfef8, crc_lsb=11, crx_msb=b4]
Channel [channel=5, sop=03bc6e8aefbdfef8, pn=40ba97d5864fccd1d7a154b15e89ae86, crc_lsb=ee, crx_msb=4b]
Channel [channel=5, sop=03bc6e8aefbdfef8, pn=40ba97d5864fccd1d7a154b15e89ae86, crc_lsb=11, crx_msb=b4]
Row 3 Col 8 in pncodes[5][9][8] table exactly has to be e1d631265fbd4093. Most likely it is very old copy paste error.
By the way, Orange receivers have the same error.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
static void set_sop_data_crc()
{
u8 pn_row = get_pn_row(channels[chidx]);
u8 data_code[16];
//printf("Ch: %d Row: %d SOP: %d Data: %d\n", ch[chidx], pn_row, sop_col, data_col);
CYRF_ConfigRFChannel(channels[chidx]);
CYRF_ConfigCRCSeed(crcidx ? ~crc : crc);
CYRF_ConfigSOPCode(pncodes[pn_row][sop_col]);
memcpy(data_code, pncodes[pn_row][data_col], 8);
if((pn_row == 3) && (data_col == 7) && (Model.proto_opts[PROTOOPTS_ORANGERX] == 1)){
memcpy(data_code + 8, (void *)"\x88\xE1\xD6\x31\x26\x5F\xBD\x40", 8);
} else {
memcpy(data_code + 8, pncodes[pn_row][data_col + 1], 8);
}
CYRF_ConfigDataCode(data_code, 16);
/* setup for next iteration */
if(Model.protocol == PROTOCOL_DSMX)
chidx = (chidx + 1) % 23;
else
chidx = (chidx + 1) % 2;
crcidx = !crcidx;
}
Please Log in or Create an account to join the conversation.
- petsmith
- Offline
- Posts: 63
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
At any case it can appears rarely, it depends from your Tx ID and Fixed ID.
Please Log in or Create an account to join the conversation.
- petsmith
- Offline
- Posts: 63
vlad_vy wrote: For current builds it's not the case for Orange Rx, but for others. Error isn't yet corrected. It can lead to incorrect Rx functioning, most likely dropped frames.
At any case it can appears rarely, it depends from your Tx ID and Fixed ID.
I see. So, my dropout issue is something else than. Thanks for the heads up.
Please Log in or Create an account to join the conversation.
- Thomas.Heiss
- Offline
- Posts: 698
vlad_vy wrote: For current builds it's not the case for Orange Rx, but for others. Error isn't yet corrected. It can lead to incorrect Rx functioning, most likely dropped frames.
At any case it can appears rarely, it depends from your Tx ID and Fixed ID.
Sorry I do not understand.
"others" means it affects all genuine Spektrum receivers??
Also TM1000 / TM1100 do RECEIVE frames on their own (listen before talk LBT) before sending back telemetry packets to TX! Lost packets would get you more often telemetry out-of-range errors if the TM1000 can not regularly send back.
Spektrum TX + receivers do it "right" (of course), so Spektrum receivers except the change while OrangeRX are coded wrong??
Did I understand you right?
How many frames would you except to be dropped max according to the old protocol DSM code Vlad?
My FlightLog shows me Fades A + Fades B or L < 100, FrameLosses 0 to max 10-20 (if ever), Holds 0. Same for release 5.0.0 as fcd0669. So I am very okay with that for DSMx.
I would care more if FlightLog Fades = 0xFF/255 (on all of two receivers/SAT) and FrameLosses >40-90 all the time or Holds >0.
Even genuine Spektrum DX8G1 +AR6210/AR600/AR8000 showed Fades + some FrameLosses (not always F=0)
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
File deleted, see below.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
High Speed 11ms work with number of channels 8-10, at channels 2, 3, 4, 6 (Aileron, Elevator, Rudder, Pitch/Flap/AUX01). Other channels have refresh rate 22ms.
Probably someone can add it to main repository.
File deleted, see below.
Please Log in or Create an account to join the conversation.
- Thomas.Heiss
- Offline
- Posts: 698
great findings / enhancements. Thanks!
Wasn't there in a thread a x-plus 16/18 channel protocol code some time ago too?
I don't understand about high speed 11ms on CH1, CH5 and CH7.
There are guys who setup 4-aileron-type gliders on THR + CH5/GEAR ports or
CH5 flap + CH7 if e-motor glider on THR port.
For Spektrum ailerons will always be AIL + AUX1.
Then there is the dual elevator stuff on ELEV+AUX7...
If CH 2,3,4,6 + 8-10 is fixed for 11ms I am fine with that too of course.
Best would be to write it into the GUI-window as a notice?
Or maybe an info in the (servo) channel configuration list itself (e.g as a info field if 11ms or 22ms if choosen HighSpeed)?
I somehow don't like that it is written on a forum but not in the firmware itself Is a text notice / channel info too big for Devo7E?
Thanks for your support Vlad!
Thomas
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
If CH 2,3,4,6 + 8-10 is fixed for 11ms I am fine with that too of course.
It's not my invention, it's Spektrum and DSM protocol physical limitation.
We need 2 packets (11ms + 11ms) = so we need >7 channels
We have 7 channels at each packet, total 14 = 10 + 4(repeated) = 14, so we limited by max 10 channels
Originally Posted by AndyKunz
If you set it to 11ms, you'll have 11ms on AILE, ELEV, and AUX1 ports. If you are using a DX10t, DX18, or DX18QQ you will also have 11ms on RUDD. Channels 11 & 12 will always be 2048/22ms in DSMX mode.
Andy
Please Log in or Create an account to join the conversation.
- mwm
- Offline
[/quote]vlad_vy wrote: Protocol module for Devo 7e kill all possible modifications for DSM2/X protocol. Now I can't add even single line of code, it doesn't fit to Devo7e. Now some strange things has place with code, if I exchange two adjacent lines of code, it doesn't fit to Devo7e since protocol module size increased or decreased by about 56 bytes. Why? I don't know.
Up until 5.0, this was the case with the flash code as well. It's why the 7E may not be supported in the next release. We're no longer holding features back for the 7E. Yeah, it sucks all the way around.
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Please Log in or Create an account to join the conversation.
- Thomas.Heiss
- Offline
- Posts: 698
vlad_vy wrote:
If CH 2,3,4,6 + 8-10 is fixed for 11ms I am fine with that too of course.
It's not my invention, it's Spektrum and DSM protocol physical limitation.
We need 2 packets (11ms + 11ms) = so we need >7 channels
We have 7 channels at each packet, total 14 = 10 + 4(repeated) = 14, so we limited by max 10 channels
Originally Posted by AndyKunz
If you set it to 11ms, you'll have 11ms on AILE, ELEV, and AUX1 ports. If you are using a DX10t, DX18, or DX18QQ you will also have 11ms on RUDD. Channels 11 & 12 will always be 2048/22ms in DSMX mode.
Andy
Oh I was not caring for channels 11-12.
Probably I would have to read a spec or read / understand the C sources but, but on a higher-level spoken:
How are channels
CH1/THR
CH5/GEAR and
CH7/AUX2
transmitted (lower-level) in those two packets that they are 22ms for those three channels and can not be 11ms as well as?
So 6 channel Spektrum receivers like AR600, AR610, AR6210 would not to be supported for 11ms? e.g Heli flybar receivers.
Or if they are, in what configuration? 8-channel Deviation configuration?
Do you mean ">7" channels or ">=7" channels for this 2x 7 channels transmit?
I am just asking because for e.g 4-wing aileron type gliders having 4x ail/flap + elev / rudder would be nice, where the flaps are used as real inner ailerons (up and down, additional movement to outer ailerons).
Having to exactly know as a pilot what channels (8-10 + 6/AUX1) can transmit in 11ms but e.g not 5+7 channels would have to be really good documented
I already see threads and threads about that popup on the forum - just like with the heli configurations
Thomas
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
static const u8 ch_map11[] = {3, 2, 1, 5, 0, 4, 6, 7, 8, 9, 10, 0xff, 0xff, 0xff};
static const u8 ch_map12[] = {3, 2, 1, 5, 0, 4, 6, 7, 8, 9, 10, 11, 0xff, 0xff};
So we can'r repeat 4 channels.
Channels mapping for High Speed 11ms:
// High Speed 11ms
static const u8 ch_map13[] = {1, 5, 2, 3, 4, 0xff, 0xff, 1, 5, 2, 3, 0, 7, 6}; //8ch - Guess
static const u8 ch_map14[] = {1, 5, 2, 3, 4, 8, 0xff, 1, 5, 2, 3, 0, 7, 6}; //9ch - Guess
static const u8 ch_map15[] = {1, 5, 2, 3, 4, 8, 9, 1, 5, 2, 3, 0, 7, 6}; //10ch - DX18
i.e. for 10ch Tx you can't change anything, for 9ch Tx you can add one more channel to 11ms but it is out of standard, for 8ch Tx you can add two more channel to 11ms but it is out of standard. I'm no doubt it will work, but it is out of standard. Any receiver <=7 channels can use one packet per frame only (7 channels and 22ms). Only 7ch "High Speed" receivers (for example, AR7610) can use two packets per frame, I think they are really 8ch, but without 8ch output. Any =>8ch DSMX receiver is "High Speed".
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
1) rssi[x] = CYRF_ReadRegister(CYRF_13_RSSI); ==> RSSI is 5 digits only, it has to be rssi[x] = CYRF_ReadRegister(CYRF_13_RSSI) & 0x1F;
2) CYRF_ConfigRFChannel(i); ===> slow channel require 270usec for synthesizer to settle, so we need delay after CYRF_ConfigRFChannel(i).
3) CYRF_StartReceive() "This bit must not be set again until after it self clears.", so we need check and reseat RX mode if needed.
It can be:
//NOTE: This routine will reset the CRC Seed
void CYRF_FindBestChannels(u8 *channels, u8 len, u8 minspace, u8 min, u8 max)
{
#define NUM_FREQ 80
#define FREQ_OFFSET 4
u8 rssi[NUM_FREQ];
if (min < FREQ_OFFSET)
min = FREQ_OFFSET;
if (max > NUM_FREQ)
max = NUM_FREQ;
int i;
int j;
memset(channels, 0, sizeof(u8) * len);
CYRF_ConfigCRCSeed(0x0000);
CYRF_SetTxRxMode(RX_EN);
//Wait for pre-amp to switch from send to receive
Delay(1000);
for(i = 0; i < NUM_FREQ; i++) {
CYRF_ConfigRFChannel(i); //slow channel require 270usec for synthesizer to settle
Delay(300); //??? what is the real delay???
if ( !(CYRF_ReadRegister(CYRF_05_RX_CTRL) & 0x80)) {
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x80); //Prepare to receive
Delay(10);
CYRF_ReadRegister(CYRF_13_RSSI); //dummy read
}
rssi[i] = CYRF_ReadRegister(CYRF_13_RSSI) & 0x1F;
}
for (i = 0; i < len; i++) {
channels[i] = min;
for (j = min; j < max; j++) {
if (rssi[j] < rssi[channels[i]]) {
channels[i] = j;
}
}
for (j = channels[i] - minspace; j < channels[i] + minspace; j++) {
//Ensure we don't reuse any channels within minspace of the selected channel again
if (j < 0 || j >= NUM_FREQ)
continue;
rssi[j] = 0xff;
}
}
CYRF_SetTxRxMode(TX_EN);
}
I have one question only: what is the real delay for Delay() fuction?
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
What's about changed DSM2/X protocol, up to now it tested with 5 receivers: AR6210, AR8000, Blade 200QX, and two micro quads with integrated DSM2 receiver. While I don't see any problems.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- MacGyverek
- Offline
- Posts: 68
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- DSM2/X protocol errors