Compare commits

..

4 Commits

Author SHA1 Message Date
pascallanger
2e3520acad DSM2SFC timing update 2024-03-19 20:52:50 +01:00
pascallanger
91af921d98 Update Protocols_Details.md 2024-03-19 15:47:56 +01:00
pascallanger
ab45ec6d1c Update Validate.h 2024-03-19 15:44:29 +01:00
pascallanger
26b0b6bd20 Update DSM_cyrf6936.ino 2024-03-19 15:44:21 +01:00
4 changed files with 17 additions and 25 deletions

View File

@ -20,9 +20,9 @@
//#define DSM_DEBUG_FWD_PGM //#define DSM_DEBUG_FWD_PGM
//#define DEBUG_BIND 1 //#define DEBUG_BIND 1
#define CLONE_BIT_MASK 0x20 #define CLONE_BIT_MASK 0x20
#define DSM_BIND_CHANNEL 0x0D //13 This can be any odd channel
#define DSM_BIND_CHANNEL 0x0d //13 This can be any odd channel #define DSM2_SFC_PERIOD 16500
//During binding we will send BIND_COUNT packets //During binding we will send BIND_COUNT packets
//One packet each 10msec //One packet each 10msec
@ -31,8 +31,8 @@
// Lemon-RX G2s seems to have a timeout waiting for the channel to get quiet after the // Lemon-RX G2s seems to have a timeout waiting for the channel to get quiet after the
// first good BIND packet.. If using 3s (300), Lemon-RX will not transmit the BIND-Response packet. // first good BIND packet.. If using 3s (300), Lemon-RX will not transmit the BIND-Response packet.
#define DSM_BIND_COUNT 180 // About 1.8s #define DSM_BIND_COUNT 180 // About 1.8s
#define DSM_BIND_COUNT_READ 600 // About 4.2s of waiting for Response #define DSM_BIND_COUNT_READ 600 // About 4.2s of waiting for Response
enum { enum {
DSM_BIND_WRITE=0, DSM_BIND_WRITE=0,
@ -294,7 +294,7 @@ uint16_t DSM_callback()
uint8_t len; uint8_t len;
#endif #endif
uint8_t start; uint8_t start;
//debugln("P=%d",phase);
switch(phase) switch(phase)
{ {
case DSM_BIND_WRITE: case DSM_BIND_WRITE:
@ -387,7 +387,7 @@ uint16_t DSM_callback()
if(sub_protocol!=DSM2_SFC) if(sub_protocol!=DSM2_SFC)
telemetry_set_input_sync(11000); // Always request 11ms spacing even if we don't use half of it in 22ms mode telemetry_set_input_sync(11000); // Always request 11ms spacing even if we don't use half of it in 22ms mode
else else
telemetry_set_input_sync(6500); telemetry_set_input_sync(DSM2_SFC_PERIOD);
#endif #endif
#ifndef MULTI_AIR #ifndef MULTI_AIR
if(sub_protocol == DSMR) if(sub_protocol == DSMR)
@ -400,6 +400,7 @@ uint16_t DSM_callback()
case DSM_CH2_WRITE_A: case DSM_CH2_WRITE_A:
case DSM_CH2_WRITE_B: case DSM_CH2_WRITE_B:
CYRF_ReadRegister(CYRF_04_TX_IRQ_STATUS); // clear IRQ flags CYRF_ReadRegister(CYRF_04_TX_IRQ_STATUS); // clear IRQ flags
//debugln_time("");
CYRF_WriteDataPacket(packet); CYRF_WriteDataPacket(packet);
#if 0 #if 0
for(uint8_t i=0;i<16;i++) for(uint8_t i=0;i<16;i++)
@ -438,13 +439,13 @@ uint16_t DSM_callback()
CYRF_SetTxRxMode(RX_EN); //Receive mode CYRF_SetTxRxMode(RX_EN); //Receive mode
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //0x80??? //Prepare to receive CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //0x80??? //Prepare to receive
#ifndef MULTI_AIR #ifndef MULTI_AIR
if(sub_protocol==DSMR) if(sub_protocol==DSMR || sub_protocol == DSM2_SFC)
{ {
phase = DSM_CH2_READ_B; phase = DSM_CH2_READ_B;
if(sub_protocol == DSM2_SFC)
return DSM2_SFC_PERIOD - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY;
return 11000 - DSM_WRITE_DELAY - DSM_READ_DELAY; return 11000 - DSM_WRITE_DELAY - DSM_READ_DELAY;
} }
if(sub_protocol==DSM2_SFC)
return 6500 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY;
#endif #endif
return 11000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY; return 11000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY;
case DSM_CH2_READ_A: case DSM_CH2_READ_A:
@ -473,16 +474,12 @@ uint16_t DSM_callback()
telemetry_link=1; telemetry_link=1;
} }
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x20); // Abort RX operation CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x20); // Abort RX operation
if (phase == DSM_CH2_READ_A && (sub_protocol==DSM2_1F || sub_protocol==DSMX_1F || sub_protocol==DSM2_SFC) && num_ch < 8) // 22ms mode if (phase == DSM_CH2_READ_A && (sub_protocol==DSM2_1F || sub_protocol==DSMX_1F) && num_ch < 8) // 22ms mode
{ {
CYRF_SetTxRxMode(RX_EN); // Force end state read CYRF_SetTxRxMode(RX_EN); // Force end state read
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x00); // Clear abort RX operation CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x00); // Clear abort RX operation
CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //0x80??? //Prepare to receive CYRF_WriteRegister(CYRF_05_RX_CTRL, 0x87); //0x80??? //Prepare to receive
phase = DSM_CH2_READ_B; phase = DSM_CH2_READ_B;
#ifndef MULTI_AIR
if(sub_protocol==DSM2_SFC)
return 6500;
#endif
return 11000; return 11000;
} }
if (phase == DSM_CH2_READ_A) if (phase == DSM_CH2_READ_A)
@ -505,17 +502,13 @@ uint16_t DSM_callback()
phase = DSM_CH1_WRITE_A; // change from CH2_CHECK_A to CH1_WRITE_A (ie no upper) phase = DSM_CH1_WRITE_A; // change from CH2_CHECK_A to CH1_WRITE_A (ie no upper)
#ifndef MULTI_AIR #ifndef MULTI_AIR
if(sub_protocol==DSM2_SFC) if(sub_protocol==DSM2_SFC)
return 6500 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY ; return DSM2_SFC_PERIOD - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY ;
#endif #endif
return 22000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY ; return 22000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY ;
} }
} }
else else
phase = DSM_CH1_WRITE_A; // change from CH2_CHECK_B to CH1_WRITE_A (upper already transmitted so transmit lower) phase = DSM_CH1_WRITE_A; // change from CH2_CHECK_B to CH1_WRITE_A (upper already transmitted so transmit lower)
#ifndef MULTI_AIR
if(sub_protocol==DSM2_SFC)
return 6500 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY ;
#endif
return 11000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY; return 11000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY;
#endif #endif
} }

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 4 #define VERSION_REVISION 4
#define VERSION_PATCH_LEVEL 1 #define VERSION_PATCH_LEVEL 2
#define MODE_SERIAL 0 #define MODE_SERIAL 0

View File

@ -432,7 +432,6 @@
#undef OMP_CCNRF_INO #undef OMP_CCNRF_INO
#undef Q303_CCNRF_INO #undef Q303_CCNRF_INO
#undef Q90C_CCNRF_INO #undef Q90C_CCNRF_INO
#undef SLT_CCNRF_INO
#undef V911S_CCNRF_INO #undef V911S_CCNRF_INO
#endif #endif

View File

@ -540,16 +540,16 @@ Surface DSMR receivers
**Only 22 IDs available**, use RX num to cycle through them. **Only 22 IDs available**, use RX num to cycle through them.
Telemetry enabled, extended limits available. Do not use DSM/AUTO to bind but DSM/R_1F instead. Telemetry enabled, extended limits available and no channel mapping. Do not use DSM/AUTO to bind but DSM/R_1F instead.
CH1|CH2|CH3|CH4|CH5|CH6|CH7 CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|--- ---|---|---|---|---|---|---
STR|THR|AUX1|AUX2|AUX3|AUX4|AUX5 STR|THR|AUX1|AUX2|AUX3|AUX4|AUX5
### Sub_protocol DSM2SFC - *6* ### Sub_protocol DSM2SFC - *6*
Surface DSM2 receivers Surface DSM2 receivers, tested with a SR3100
Extended limits available. Do not use DSM/AUTO to bind but DSM/2SFC instead. Extended limits available and no channel mapping. Do not use DSM/AUTO to bind but DSM/2SFC instead.
CH1|CH2|CH3 CH1|CH2|CH3
---|---|--- ---|---|---