- Posts: 3333
DSMX channels list for Frequency Shift Hopping
- vlad_vy
- Topic Author
- Offline
#include <stdio.h>
/*
DSMX channels list for Frequency Shift Hopping
math by Alexandr Alexandrov
code by Sergey Gimaev
some function (like RadioSetFrequency) from Cypress old assember lib for CYRF transivers
they used in OrangeRX DSM2 6 channel and AR6110 clone receiver
*/
int main(void){
unsigned int manufacturerID = 0x92C65809;//inverted 0x6D39A7F6;
// manufacturerID - this is that we see in the first 4 bytes of BIND packet
unsigned int calc;
unsigned int channel;
int c = 0, k, part1 = 8, part2 = 7, part3 = 8, flag = 0;
unsigned char channel_list[23];
for(k = 0; k < 23; k++){
channel_list[k] = 0xFF; //init channel list
}
calc = manufacturerID; //init randomize function
do{
calc *= 0x0019660D; //randomize function
calc += 0x3C6EF35F; //from wiki, liniux, gcc, etc
channel = calc >> 8;
channel = channel % 0x49;
/* 1. If the 4-th byte of ManufacturerID - is even ("0" in the low-bit), then the channel
should be even (or odd channel for odd 4-th byte of ManufacturerID).
If it's not - continue (generate at calc the next number.) */
//i need to compare last bit in manufacturerID and last bit in channel for both even/odd
if((unsigned char)(channel & 1) == (unsigned char)(manufacturerID & 1)){
/* 2. If the channel matches with any of the already obtained channel numbers
in the array, then continue */
for(k = 0; k < 23; k++){
if(channel_list[k] == (channel + 3)){flag = 1; k = 0xFF;}
else flag = 0;
}
if(flag == 0){
flag = 1;
/* 3. Check to which subband the channel is related (0 .. 24, 25 .. 48 or 49 .. 72).
At the beginning of the work - set 3 counters (for each sub-band) and set them to 8, 7 and 8
(7 - at the counter for subband 25 .. 48). In which sub-band is channel - check to see
if counter is not equal 0. If it's equal 0 - continue */
if(channel < 25){
if(part1){
part1--;
flag = 0;
}
}else{
if(channel < 49){
if(part2){
part2--;
flag = 0;
}
}else {
if(part3){
part3--;
flag = 0;
}
}
}
if(flag == 0){
/* Procedure returns, then add to that the 4 (as opposed to 2 for DSM2),
and with it will call RadioSetFrequency, which will subtract another 1, and will write it to the transceiver. */
//i don`t use Cypress lib, write my self to CYRF. therefore i need +3
channel_list[c] = channel + 3; //therefore +3
printf ("0x%.2x ", channel + 3);
c++;
}
}
}
}while(c < 23);
return 7;
}
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
it's all that related DSMX from RW9UAO and russian forum. All other messages related to telemetry.
"There is a point at dsmx unlike dsm2.
Packet is transmitted, after 4ms the second packet, the third packet after 7ms. I.e. at any case, within 11ms transmitted 8 channels. For another 11ms transmitted duplicate (dsmx 22ms), or new value. With 11-bit resolution."
"If the connection is lost, timing is similar, for except that there is no reception, and after timeout the channel is changing. But if in the receive mode the channel is taken from the list (in order), when the connection is lost: starts some cross-sampling. For simplicity I see two options - to stand on the same channel and wait, it will take roughly 23 * 7 = 160ms. Or to move in the opposite direction through the channel list. According to estimations, in the worst cases we get lost connection (with failsafe) on a half a second. This is too much."
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I've tested with my AR6210 on 7ch and 6ch modes. 8ch modes don't work with this Rx though, so I can't verify those.
I'd certainly appreciate additional input on how it works for others though.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
One funny thing - if I change mode to 4 channel and rebind (and reboot), as before work all 6 channel, 5 and 6 channels work with earlier programmed mixes.
With RD921 (DSM2), as expected, DSMX doesn't bind, doesn't work.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- Hexperience
- Offline
- Posts: 588
Cheers, and congrats! 2.1 is fantastic!
There are 10 types of people in this world. Those that understand binary and those that don't.
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.
- Hexperience
- Offline
- Posts: 588
There are 10 types of people in this world. Those that understand binary and those that don't.
Please Log in or Create an account to join the conversation.
- coaster
- Offline
- Posts: 50
and compare with DSX8.
thanks in advance !
cheers
Graziano
Please Log in or Create an account to join the conversation.
- FDR
- Offline
coaster wrote: can someone provide a bulid with DSMX, so i can test
and compare with DSX8.
thanks in advance !
cheers
Graziano
Here you are:
www.deviationtx.com/forum/builds/1178-po...th-dsmx-support#4097
Please Log in or Create an account to join the conversation.
- coaster
- Offline
- Posts: 50
cheers
Graziano
Please Log in or Create an account to join the conversation.
- coaster
- Offline
- Posts: 50
had no issues, the flight feeling is like with the DX8 (with the same settings on both TX).
i guess the binding is faster then with the DSM2 protocol.
Great work !
cheers
Graziano
Please Log in or Create an account to join the conversation.
- Hexperience
- Offline
- Posts: 588
There are 10 types of people in this world. Those that understand binary and those that don't.
Please Log in or Create an account to join the conversation.
- coaster
- Offline
- Posts: 50
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.
- Joshua
- Offline
(devo8_21cd8c1)
1: mcx DSM2 ok, DSMX no, normal because only DSM2 is supported
2: msr DSM2 ok, DSMX no, normal because only DSM2 is supported
3: 120SR DSM2 ok, DSMX no, normal because only DSM2 is supported
4: msrx DSM2 ok, DSMX no, ?
5: MQX DSM2 ok, DSMX ok
6: mcpx1 DSM2 ok, DSMX no ?
7: mcpx2 DSM2 ok, DSMX no, ?
8: Nano CP X DSM2 ok, DSMX ok
9: Blade 130 X DSM2 ok, DSMX ok
ciao, Bernd
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
4: msrx DSM2 ok, DSMX no, ? possible DSM2?
6: mcpx1 DSM2 ok, DSMX no ? only mCPX v2 has DSMX support
7: mcpx2 DSM2 ok, DSMX no ? only mCPX v2 has DSMX support
Please Log in or Create an account to join the conversation.
- Joshua
- Offline
can only select Auto-DSMX mode.
ciao, Bernd
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- DSMX channels list for Frequency Shift Hopping