I've been developing an RFM22B based Tx/Rx pair with 2 -way telemetry for use with my TGY 9X. I'd like the Tx to receive er9x command data using the serial based DSM2/DSMX. I've started work on the decoder, should be fairly straight forward.
Would it be straight forward to extend the DSM2/DSMX protocol to more than 6 channels of Tx data (to say 9?). A quick look at pulses.cpp seems to indicated it is presently hard coded at 6 channels. There is a warning in the code at line 424:
" // If more channels needed make sure the pulses union/array is large enough"
I assume this is the pulses2MHz array.
Code: Select all
#define PULSES_WORD_SIZE 72
#define PULSES_BYTE_SIZE (PULSES_WORD_SIZE * 2)
union p2mhz_t
{
uint16_t pword[PULSES_WORD_SIZE] ; //72
uint8_t pbyte[PULSES_BYTE_SIZE] ; //144
} pulses2MHz ;
Line 390 gives me a clue that there are at most 10 transitions per byte transmitted:
Code: Select all
#define BITLEN_DSM2 (8*2) //125000 Baud
static void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1
Code: Select all
OCR1A = *pulsePtr ;
pulsePtr += 1 ;
So still trying to figure out how the DSM data is packed into pulses2MHz and how to allocate storage for additional channels. Any pointers or pitfalls would be much appreciated.
Thanks in advance,
George