Merge pull request #5 from pascallanger/master

sync with base
This commit is contained in:
midelic 2017-04-24 20:23:02 +01:00 committed by GitHub
commit 040354501c
104 changed files with 88251 additions and 1823 deletions

View File

@ -0,0 +1,99 @@
{
"packages": [
{
"name": "MULTI",
"maintainer": "Pascal",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"websiteURL": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"platforms": [
{
"name": "Multi 4in1 Atmega328p",
"architecture": "avr",
"version": "1.0.0",
"category": "Multi",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"archiveFileName": "multi_avr-1.0.0.zip",
"checksum": "SHA-256:ec3ff8a1dc96d3ba6f432b9b837a35fd4174a34b3d2927de1d51010e8b94f9f1",
"size": "15005",
"boards": [
{"name": "Multi 4in1 Atmega328p"},
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.8.1-arduino5"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.0.1-arduino5"
}
]
},
{
"name": "Multi 4in1 STM32",
"architecture": "stm32",
"version": "1.0.0",
"category": "Multi",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"archiveFileName": "multi_stm32-1.0.0.zip",
"checksum": "SHA-256:ec3ff8a1dc96d3ba6f432b9b837a35fd4174a34b3d2927de1d51010e8b94f9f1",
"size": "15005",
"boards": [
{"name": "Multi 4in1 STM32"},
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.8.1-arduino5"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.0.1-arduino5"
}
]
},
{
"name": "Multi 4in1 OrangeTX",
"architecture": "xmega",
"version": "1.0.0",
"category": "Multi",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"archiveFileName": "multi_xmega-1.0.0.zip",
"checksum": "SHA-256:ec3ff8a1dc96d3ba6f432b9b837a35fd4174a34b3d2927de1d51010e8b94f9f1",
"size": "15005",
"boards": [
{"name": "Multi 4in1 OrangeTX"},
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.8.1-arduino5"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.0.1-arduino5"
}
]
}
],
"tools":[]
}
]
}

View File

@ -0,0 +1,99 @@
{
"packages": [
{
"name": "MULTI",
"maintainer": "Pascal",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"websiteURL": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"platforms": [
{
"name": "Multi 4in1 Atmega328p",
"architecture": "avr",
"version": "1.0.0",
"category": "Multi",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"archiveFileName": "multi_avr-1.0.0.zip",
"checksum": "SHA-256:ec3ff8a1dc96d3ba6f432b9b837a35fd4174a34b3d2927de1d51010e8b94f9f1",
"size": "15005",
"boards": [
{"name": "Multi 4in1 Atmega328p"}
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.8.1-arduino5"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.0.1-arduino5"
}
]
},
{
"name": "Multi 4in1 STM32",
"architecture": "stm32",
"version": "1.0.0",
"category": "Multi",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"archiveFileName": "multi_stm32-1.0.0.zip",
"checksum": "SHA-256:ec3ff8a1dc96d3ba6f432b9b837a35fd4174a34b3d2927de1d51010e8b94f9f1",
"size": "15005",
"boards": [
{"name": "Multi 4in1 STM32"}
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.8.1-arduino5"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.0.1-arduino5"
}
]
},
{
"name": "Multi 4in1 OrangeTX",
"architecture": "xmega",
"version": "1.0.0",
"category": "Multi",
"help": {
"online": "https://www.rcgroups.com/forums/showthread.php?2165676-DIY-Multiprotocol-TX-Module/page555"
},
"url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module",
"archiveFileName": "multi_xmega-1.0.0.zip",
"checksum": "SHA-256:ec3ff8a1dc96d3ba6f432b9b837a35fd4174a34b3d2927de1d51010e8b94f9f1",
"size": "15005",
"boards": [
{"name": "Multi 4in1 OrangeTX"}
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.8.1-arduino5"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.0.1-arduino5"
}
]
}
],
"tools":[]
}
]
}

View File

@ -146,7 +146,11 @@ void A7105_SetPower()
{
uint8_t power=A7105_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?A7105_HIGH_POWER:A7105_LOW_POWER;
#ifdef A7105_ENABLE_LOW_POWER
power=IS_POWER_FLAG_on?A7105_HIGH_POWER:A7105_LOW_POWER;
#else
power=A7105_HIGH_POWER;
#endif
if(IS_RANGE_FLAG_on)
power=A7105_RANGE_POWER;
if(prev_power != power)

View File

@ -110,11 +110,11 @@ static void AFHDS2A_update_telemetry()
v_lipo1 = packet[index+2];
telemetry_link=1;
break;
/*case AFHDS2A_SENSOR_RX_ERR_RATE:
// packet[index+2];
break;*/
case AFHDS2A_SENSOR_RX_ERR_RATE:
RX_LQI=packet[index+2];
break;
case AFHDS2A_SENSOR_RX_RSSI:
RSSI_dBm = -packet[index+2];
RX_RSSI = -packet[index+2];
break;
case 0xff:
return;
@ -260,7 +260,8 @@ uint16_t ReadAFHDS2A()
while ((uint16_t)micros()-start < 700) // Wait max 700µs, using serial+telemetry exit in about 120µs
if(!(A7105_ReadReg(A7105_00_MODE) & 0x01))
break;
A7105_SetTxRxMode(RX_EN);
A7105_SetPower();
A7105_SetTxRxMode(TXRX_OFF); // Turn LNA off since we are in near range and we want to prevent swamping
A7105_Strobe(A7105_RX);
phase &= ~AFHDS2A_WAIT_WRITE;
phase++;
@ -325,6 +326,7 @@ uint16_t ReadAFHDS2A()
while ((uint16_t)micros()-start < 700) // Wait max 700µs, using serial+telemetry exit in about 120µs
if(!(A7105_ReadReg(A7105_00_MODE) & 0x01))
break;
A7105_SetPower();
A7105_SetTxRxMode(RX_EN);
A7105_Strobe(A7105_RX);
phase &= ~AFHDS2A_WAIT_WRITE;
@ -352,7 +354,7 @@ uint16_t initAFHDS2A()
}
hopping_frequency_no = 0;
#if defined(AFHDS2A_FW_TELEMETRY) || defined(AFHDS2A_HUB_TELEMETRY)
init_hub_telemetry();
init_frskyd_link_telemetry();
#endif
return 50000;
}

View File

@ -143,7 +143,7 @@ static void __attribute__((unused)) ASSAN_initialize_txid()
packet[20]=0x53; */
// Using packet[20..23] to store the ID1 and packet[24..27] to store the ID2
uint8_t freq=0,freq2;
for(uint8_t i=0;i<4;i++)
for(uint8_t i=0;i<ASSAN_ADDRESS_LENGTH;i++)
{
uint8_t temp=rx_tx_addr[i];
packet[i+20]=temp;

View File

@ -121,8 +121,7 @@ static void __attribute__((unused)) BAYANG_send_packet(uint8_t bind)
#ifdef BAYANG_HUB_TELEMETRY
if (option)
{ // switch radio to rx as soon as packet is sent
while (!(NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_TX_DS)));
while (!(NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_TX_DS)));
NRF24L01_WriteReg(NRF24L01_00_CONFIG, 0x03);
}
#endif
@ -131,7 +130,7 @@ static void __attribute__((unused)) BAYANG_send_packet(uint8_t bind)
}
#ifdef BAYANG_HUB_TELEMETRY
static void __attribute__((unused)) check_rx(void)
static void __attribute__((unused)) BAYANG_check_rx(void)
{
if (NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_RX_DR))
{ // data received from model
@ -150,7 +149,7 @@ static void __attribute__((unused)) check_rx(void)
// compensated battery volts*100/2
v_lipo2 = (packet[5]<<7) + (packet[6]>>2);
// reception in packets / sec
RSSI_dBm = packet[7];
RX_RSSI = packet[7];
//Flags
//uint8_t flags = packet[3] >> 3;
// battery low: flags & 1
@ -204,7 +203,7 @@ uint16_t BAYANG_callback()
}
if (packet_count > 1)
check_rx();
BAYANG_check_rx();
packet_count %= 5;
}
@ -252,7 +251,7 @@ uint16_t initBAYANG(void)
BAYANG_init();
packet_count=0;
#ifdef BAYANG_HUB_TELEMETRY
init_hub_telemetry();
init_frskyd_link_telemetry();
telemetry_lost=1; // do not send telemetry to TX right away until we have a TX_RSSI value to prevent warning message...
#endif
return BAYANG_INITIAL_WAIT+BAYANG_PACKET_PERIOD;

View File

@ -145,7 +145,11 @@ void CC2500_SetPower()
{
uint8_t power=CC2500_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?CC2500_HIGH_POWER:CC2500_LOW_POWER;
#ifdef CC2500_ENABLE_LOW_POWER
power=IS_POWER_FLAG_on?CC2500_HIGH_POWER:CC2500_LOW_POWER;
#else
power=CC2500_HIGH_POWER;
#endif
if(IS_RANGE_FLAG_on)
power=CC2500_RANGE_POWER;
if(prev_power != power)

View File

@ -78,6 +78,7 @@ uint8_t CYRF_Reset()
*/
void CYRF_GetMfgData(uint8_t data[])
{
#ifndef FORCE_CYRF_ID
/* Fuses power on */
CYRF_WriteRegister(CYRF_25_MFG_ID, 0xFF);
@ -85,6 +86,9 @@ void CYRF_GetMfgData(uint8_t data[])
/* Fuses power off */
CYRF_WriteRegister(CYRF_25_MFG_ID, 0x00);
#else
memcpy(data,FORCE_CYRF_ID,6);
#endif
}
/*
@ -133,7 +137,11 @@ void CYRF_SetPower(uint8_t val)
{
uint8_t power=CYRF_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?CYRF_HIGH_POWER:CYRF_LOW_POWER;
#ifdef CYRF6936_ENABLE_LOW_POWER
power=IS_POWER_FLAG_on?CYRF_HIGH_POWER:CYRF_LOW_POWER;
#else
power=CYRF_HIGH_POWER;
#endif
if(IS_RANGE_FLAG_on)
power=CYRF_RANGE_POWER;
power|=val;

View File

@ -55,6 +55,18 @@ void convert_channel_HK310(uint8_t num, uint8_t *low, uint8_t *high)
*high=(uint8_t)(temp>>8);
}
// Channel value is converted to 16bit values
uint16_t convert_channel_16b(uint8_t num, int16_t out_min, int16_t out_max)
{
return (uint16_t) (map(limit_channel_100(num),servo_min_100,servo_max_100,out_min,out_max));
}
// Channel value is converted to 16bit values with no limit
uint16_t convert_channel_16b_nolim(uint8_t num, int16_t out_min, int16_t out_max)
{
return (uint16_t) (map(Servo_data[num],servo_min_100,servo_max_100,out_min,out_max));
}
// Channel value is limited to PPM_100
uint16_t limit_channel_100(uint8_t ch)
{
@ -70,6 +82,16 @@ uint16_t limit_channel_100(uint8_t ch)
/** FrSky D and X routines **/
/******************************/
#if defined(FRSKYD_CC2500_INO) || defined(FRSKYX_CC2500_INO)
enum {
FRSKY_BIND = 0,
FRSKY_BIND_DONE = 1000,
FRSKY_DATA1,
FRSKY_DATA2,
FRSKY_DATA3,
FRSKY_DATA4,
FRSKY_DATA5
};
void Frsky_init_hop(void)
{
uint8_t val;
@ -87,7 +109,163 @@ void Frsky_init_hop(void)
val=channel;
if((val==0x00) || (val==0x5A) || (val==0xDC))
val++;
hopping_frequency[i]=i>47?0:val;
hopping_frequency[i]=i>46?0:val;
}
}
#endif
/******************************/
/** FrSky V, D and X routines **/
/******************************/
#if defined(FRSKYV_CC2500_INO) || defined(FRSKYD_CC2500_INO) || defined(FRSKYX_CC2500_INO)
const PROGMEM uint8_t FRSKY_common_startreg_cc2500_conf[]= {
CC2500_02_IOCFG0 ,
CC2500_00_IOCFG2 ,
CC2500_17_MCSM1 ,
CC2500_18_MCSM0 ,
CC2500_06_PKTLEN ,
CC2500_07_PKTCTRL1 ,
CC2500_08_PKTCTRL0 ,
CC2500_3E_PATABLE ,
CC2500_0B_FSCTRL1 ,
CC2500_0C_FSCTRL0 , // replaced by option value
CC2500_0D_FREQ2 ,
CC2500_0E_FREQ1 ,
CC2500_0F_FREQ0 ,
CC2500_10_MDMCFG4 ,
CC2500_11_MDMCFG3 ,
CC2500_12_MDMCFG2 ,
CC2500_13_MDMCFG1 ,
CC2500_14_MDMCFG0 ,
CC2500_15_DEVIATN };
#if defined(FRSKYV_CC2500_INO)
const PROGMEM uint8_t FRSKYV_cc2500_conf[]= {
/*02_IOCFG0*/ 0x06 ,
/*00_IOCFG2*/ 0x06 ,
/*17_MCSM1*/ 0x0c ,
/*18_MCSM0*/ 0x18 ,
/*06_PKTLEN*/ 0xff ,
/*07_PKTCTRL1*/ 0x04 ,
/*08_PKTCTRL0*/ 0x05 ,
/*3E_PATABLE*/ 0xfe ,
/*0B_FSCTRL1*/ 0x08 ,
/*0C_FSCTRL0*/ 0x00 ,
/*0D_FREQ2*/ 0x5c ,
/*0E_FREQ1*/ 0x58 ,
/*0F_FREQ0*/ 0x9d ,
/*10_MDMCFG4*/ 0xAA ,
/*11_MDMCFG3*/ 0x10 ,
/*12_MDMCFG2*/ 0x93 ,
/*13_MDMCFG1*/ 0x23 ,
/*14_MDMCFG0*/ 0x7a ,
/*15_DEVIATN*/ 0x41 };
#endif
#if defined(FRSKYD_CC2500_INO)
const PROGMEM uint8_t FRSKYD_cc2500_conf[]= {
/*02_IOCFG0*/ 0x06 ,
/*00_IOCFG2*/ 0x06 ,
/*17_MCSM1*/ 0x0c ,
/*18_MCSM0*/ 0x18 ,
/*06_PKTLEN*/ 0x19 ,
/*07_PKTCTRL1*/ 0x04 ,
/*08_PKTCTRL0*/ 0x05 ,
/*3E_PATABLE*/ 0xff ,
/*0B_FSCTRL1*/ 0x08 ,
/*0C_FSCTRL0*/ 0x00 ,
/*0D_FREQ2*/ 0x5c ,
/*0E_FREQ1*/ 0x76 ,
/*0F_FREQ0*/ 0x27 ,
/*10_MDMCFG4*/ 0xAA ,
/*11_MDMCFG3*/ 0x39 ,
/*12_MDMCFG2*/ 0x11 ,
/*13_MDMCFG1*/ 0x23 ,
/*14_MDMCFG0*/ 0x7a ,
/*15_DEVIATN*/ 0x42 };
#endif
#if defined(FRSKYX_CC2500_INO)
const PROGMEM uint8_t FRSKYX_cc2500_conf[]= {
//FRSKYX
/*02_IOCFG0*/ 0x06 ,
/*00_IOCFG2*/ 0x06 ,
/*17_MCSM1*/ 0x0c ,
/*18_MCSM0*/ 0x18 ,
/*06_PKTLEN*/ 0x1E ,
/*07_PKTCTRL1*/ 0x04 ,
/*08_PKTCTRL0*/ 0x01 ,
/*3E_PATABLE*/ 0xff ,
/*0B_FSCTRL1*/ 0x0A ,
/*0C_FSCTRL0*/ 0x00 ,
/*0D_FREQ2*/ 0x5c ,
/*0E_FREQ1*/ 0x76 ,
/*0F_FREQ0*/ 0x27 ,
/*10_MDMCFG4*/ 0x7B ,
/*11_MDMCFG3*/ 0x61 ,
/*12_MDMCFG2*/ 0x13 ,
/*13_MDMCFG1*/ 0x23 ,
/*14_MDMCFG0*/ 0x7a ,
/*15_DEVIATN*/ 0x51 };
const PROGMEM uint8_t FRSKYXEU_cc2500_conf[]= {
/*02_IOCFG0*/ 0x06 ,
/*00_IOCFG2*/ 0x06 ,
/*17_MCSM1*/ 0x0E ,
/*18_MCSM0*/ 0x18 ,
/*06_PKTLEN*/ 0x23 ,
/*07_PKTCTRL1*/ 0x04 ,
/*08_PKTCTRL0*/ 0x01 ,
/*3E_PATABLE*/ 0xff ,
/*0B_FSCTRL1*/ 0x08 ,
/*0C_FSCTRL0*/ 0x00 ,
/*0D_FREQ2*/ 0x5c ,
/*0E_FREQ1*/ 0x80 ,
/*0F_FREQ0*/ 0x00 ,
/*10_MDMCFG4*/ 0x7B ,
/*11_MDMCFG3*/ 0xF8 ,
/*12_MDMCFG2*/ 0x03 ,
/*13_MDMCFG1*/ 0x23 ,
/*14_MDMCFG0*/ 0x7a ,
/*15_DEVIATN*/ 0x53 };
#endif
const PROGMEM uint8_t FRSKY_common_end_cc2500_conf[][2]= {
{ CC2500_19_FOCCFG, 0x16 },
{ CC2500_1A_BSCFG, 0x6c },
{ CC2500_1B_AGCCTRL2, 0x43 },
{ CC2500_1C_AGCCTRL1, 0x40 },
{ CC2500_1D_AGCCTRL0, 0x91 },
{ CC2500_21_FREND1, 0x56 },
{ CC2500_22_FREND0, 0x10 },
{ CC2500_23_FSCAL3, 0xa9 },
{ CC2500_24_FSCAL2, 0x0A },
{ CC2500_25_FSCAL1, 0x00 },
{ CC2500_26_FSCAL0, 0x11 },
{ CC2500_29_FSTEST, 0x59 },
{ CC2500_2C_TEST2, 0x88 },
{ CC2500_2D_TEST1, 0x31 },
{ CC2500_2E_TEST0, 0x0B },
{ CC2500_03_FIFOTHR, 0x07 },
{ CC2500_09_ADDR, 0x00 } };
void FRSKY_init_cc2500(const uint8_t *ptr)
{
for(uint8_t i=0;i<19;i++)
{
uint8_t reg=pgm_read_byte_near(&FRSKY_common_startreg_cc2500_conf[i]);
uint8_t val=pgm_read_byte_near(&ptr[i]);
if(reg==CC2500_0C_FSCTRL0)
val=option;
CC2500_WriteReg(reg,val);
}
prev_option = option ; // Save option to monitor FSCTRL0 change
for(uint8_t i=0;i<17;i++)
{
uint8_t reg=pgm_read_byte_near(&FRSKY_common_end_cc2500_conf[i][0]);
uint8_t val=pgm_read_byte_near(&FRSKY_common_end_cc2500_conf[i][1]);
CC2500_WriteReg(reg,val);
}
CC2500_SetTxRxMode(TX_EN);
CC2500_SetPower();
CC2500_Strobe(CC2500_SIDLE); // Go to idle...
}
#endif

View File

@ -0,0 +1,157 @@
/*
This project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Multiprotocol is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
*/
// compatible with DM002
#if defined(DM002_NRF24L01_INO)
#include "iface_nrf24l01.h"
#define DM002_PACKET_PERIOD 6100 // Timeout for callback in uSec
#define DM002_INITIAL_WAIT 500
#define DM002_PACKET_SIZE 12 // packets have 12-byte payload
#define DM002_RF_BIND_CHANNEL 0x27
#define DM002_BIND_COUNT 655 // 4 seconds
enum DM002_FLAGS {
// flags going to packet[9]
DM002_FLAG_FLIP = 0x01,
DM002_FLAG_LED = 0x02,
DM002_FLAG_MEDIUM = 0x04,
DM002_FLAG_HIGH = 0x08,
DM002_FLAG_RTH = 0x10,
DM002_FLAG_HEADLESS = 0x20,
DM002_FLAG_CAMERA1 = 0x40,
DM002_FLAG_CAMERA2 = 0x80,
};
static void __attribute__((unused)) DM002_send_packet(uint8_t bind)
{
memcpy(packet+5,(uint8_t *)"\x00\x7F\x7F\x7F\x00\x00\x00",7);
if(bind)
{
packet[0] = 0xAA;
packet[1] = rx_tx_addr[0];
packet[2] = rx_tx_addr[1];
packet[3] = rx_tx_addr[2];
packet[4] = rx_tx_addr[3];
}
else
{
packet[0]=0x55;
// Throttle : 0 .. 200
packet[1]=convert_channel_8b_scale(THROTTLE,0,200);
// Other channels min 0x57, mid 0x7F, max 0xA7
packet[2] = convert_channel_8b_scale(RUDDER,0x57,0xA7);
packet[3] = convert_channel_8b_scale(AILERON, 0x57,0xA7);
packet[4] = convert_channel_8b_scale(ELEVATOR, 0xA7, 0x57);
// Features
packet[9] = GET_FLAG(Servo_AUX1,DM002_FLAG_FLIP)
| GET_FLAG(!Servo_AUX2,DM002_FLAG_LED)
| GET_FLAG(Servo_AUX3,DM002_FLAG_CAMERA1)
| GET_FLAG(Servo_AUX4,DM002_FLAG_CAMERA2)
| GET_FLAG(Servo_AUX5,DM002_FLAG_HEADLESS)
| GET_FLAG(Servo_AUX6,DM002_FLAG_RTH)
| GET_FLAG(!Servo_AUX7,DM002_FLAG_HIGH);
// Packet counter
if(packet_count&0x03)
{
packet_count++;
hopping_frequency_no++;
hopping_frequency_no&=4;
}
packet_count&=0x0F;
packet[10] = packet_count;
packet_count++;
}
//CRC
for(uint8_t i=0;i<DM002_PACKET_SIZE-1;i++)
packet[11]+=packet[i];
// Power on, TX mode, 2byte CRC
// Why CRC0? xn297 does not interpret it - either 16-bit CRC or nothing
XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | _BV(NRF24L01_00_PWR_UP));
if (bind)
NRF24L01_WriteReg(NRF24L01_05_RF_CH, DM002_RF_BIND_CHANNEL);
else
NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency[hopping_frequency_no]);
// clear packet status bits and TX FIFO
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70);
NRF24L01_FlushTx();
XN297_WritePayload(packet, DM002_PACKET_SIZE);
NRF24L01_SetPower(); // Set tx_power
}
static void __attribute__((unused)) DM002_init()
{
NRF24L01_Initialize();
NRF24L01_SetTxRxMode(TX_EN);
XN297_SetTXAddr((uint8_t *)"\x26\xA8\x67\x35\xCC", 5);
NRF24L01_FlushTx();
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); // Clear data ready, data sent, and retransmit
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No Auto Acknowldgement on all data pipes
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, 0x01); // Enable data pipe 0 only
NRF24L01_SetBitrate(NRF24L01_BR_1M); // 1Mbps
NRF24L01_SetPower();
}
uint16_t DM002_callback()
{
if(IS_BIND_DONE_on)
DM002_send_packet(0);
else
{
if (bind_counter == 0)
{
BIND_DONE;
XN297_SetTXAddr(rx_tx_addr, 5);
}
else
{
DM002_send_packet(1);
bind_counter--;
}
}
return DM002_PACKET_PERIOD;
}
static void __attribute__((unused)) DM002_initialize_txid()
{
// Only 2 IDs/RFs are available, RX_NUM is used to switch between them
if(rx_tx_addr[3]&1)
{
memcpy(hopping_frequency,(uint8_t *)"\x34\x39\x43\x48",4);
memcpy(rx_tx_addr,(uint8_t *)"\x47\x93\x00\x00\xD5",5);
}
else
{
memcpy(hopping_frequency,(uint8_t *)"\x35\x39\x3B\x3D",4);
memcpy(rx_tx_addr,(uint8_t *)"\xAC\xA1\x00\x00\xD5",5);
}
}
uint16_t initDM002(void)
{
BIND_IN_PROGRESS; // autobind protocol
bind_counter = DM002_BIND_COUNT;
DM002_initialize_txid();
DM002_init();
return DM002_INITIAL_WAIT;
}
#endif

View File

@ -273,14 +273,10 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
uint16_t value = 0xffff;;
if (idx != 0xff)
{
if (!IS_BIND_DONE_on)
{ // Failsafe position during binding
value=max/2; //all channels to middle
if(idx==0)
value=1; //except throttle
}
else
value=map(Servo_data[CH_TAER[idx]],servo_min_125,servo_max_125,0,max);
/* Spektrum own remotes transmit normal values during bind and actually
* use this (e.g. Nano CP X) to select the transmitter mode (e.g. computer vs
* non-computer radio, so always end normal output */
value=map(Servo_data[CH_TAER[idx]],servo_min_125,servo_max_125,0,max);
value |= (upper && i==0 ? 0x8000 : 0) | (idx << bits);
}
packet[i*2+2] = (value >> 8) & 0xff;
@ -582,4 +578,4 @@ uint16_t initDsm()
return 10000;
}
#endif
#endif

View File

@ -134,7 +134,7 @@ static void __attribute__((unused)) DEVO_build_data_pkt()
uint8_t sign = 0x0b;
for (uint8_t i = 0; i < 4; i++)
{
int16_t value=map(Servo_data[CH_EATR[ch_idx * 4 + i]],servo_min_125,servo_max_125,-1600,1600);//range -1600..+1600
int16_t value=map(Servo_data[CH_EATR[ch_idx * 4 + i]],servo_min_100,servo_max_100,-1600,1600);//range -1600..+1600
if(value < 0)
{
value = -value;

View File

@ -60,9 +60,9 @@ static void __attribute__((unused)) ssv_pack_dpl(uint8_t addr[], uint8_t pid, ui
crc.val=0x3c18;
for (i = 0; i < 7; ++i)
crc.val=crc16_update(crc.val,header[i]);
crc.val=crc16_update(crc.val,header[i],8);
for (i = 0; i < *len; ++i)
crc.val=crc16_update(crc.val,payload[i]);
crc.val=crc16_update(crc.val,payload[i],8);
// encode payload and crc
// xor with this:

View File

@ -19,26 +19,7 @@
static void __attribute__((unused)) frsky2way_init(uint8_t bind)
{
// Configure cc2500 for tx mode
//
for(uint8_t i=0;i<36;i++)
{
uint8_t reg=pgm_read_byte_near(&cc2500_conf[i][0]);
uint8_t val=pgm_read_byte_near(&cc2500_conf[i][1]);
if(reg==CC2500_0C_FSCTRL0)
val=option;
else
if(reg==CC2500_1B_AGCCTRL2)
val=bind ? 0x43 : 0x03;
CC2500_WriteReg(reg,val);
}
prev_option = option ;
CC2500_SetTxRxMode(TX_EN);
CC2500_SetPower();
CC2500_Strobe(CC2500_SIDLE);
FRSKY_init_cc2500(FRSKYD_cc2500_conf);
CC2500_WriteReg(CC2500_09_ADDR, bind ? 0x03 : rx_tx_addr[3]);
CC2500_WriteReg(CC2500_07_PKTCTRL1, 0x05);
@ -115,6 +96,10 @@ static void __attribute__((unused)) frsky2way_data_frame()
uint16_t initFrSky_2way()
{
Frsky_init_hop();
packet_count=0;
#if defined TELEMETRY
init_frskyd_link_telemetry();
#endif
if(IS_AUTOBIND_FLAG_on)
{
frsky2way_init(1);
@ -122,8 +107,7 @@ uint16_t initFrSky_2way()
}
else
{
frsky2way_init(0);
state = FRSKY_DATA2;
state = FRSKY_BIND_DONE;
}
return 10000;
}
@ -138,7 +122,10 @@ uint16_t ReadFrSky_2way()
CC2500_WriteReg(CC2500_23_FSCAL3, 0x89);
CC2500_Strobe(CC2500_SFRX);//0x3A
CC2500_WriteData(packet, packet[0]+1);
state++;
if(IS_BIND_DONE_on)
state = FRSKY_BIND_DONE;
else
state++;
return 9000;
}
if (state == FRSKY_BIND_DONE)
@ -170,14 +157,30 @@ uint16_t ReadFrSky_2way()
if (state == FRSKY_DATA1)
{
len = CC2500_ReadReg(CC2500_3B_RXBYTES | CC2500_READ_BURST) & 0x7F;
if (len && len<=MAX_PKT)//27 bytes
{
CC2500_ReadData(pkt, len); //received telemetry packets
if (len && len<=(0x11+3))// 20bytes
{
CC2500_ReadData(pkt, len); //received telemetry packets
#if defined(TELEMETRY)
//parse telemetry packet here
frsky_check_telemetry(pkt,len); //check if valid telemetry packets and buffer them.
#endif
}
if(pkt[len-1] & 0x80)
{//with valid crc
packet_count=0;
frsky_check_telemetry(pkt,len); //check if valid telemetry packets and buffer them.
}
#endif
}
else
{
packet_count++;
// restart sequence on missed packet - might need count or timeout instead of one missed
if(packet_count>100)
{//~1sec
packet_count=0;
#if defined TELEMETRY
telemetry_link=0;//no link frames
pkt[6]=0;//no user frames.
#endif
}
}
CC2500_SetTxRxMode(TX_EN);
CC2500_SetPower(); // Set tx_power
}

View File

@ -27,50 +27,6 @@ enum {
#include "iface_cc2500.h"
const PROGMEM uint8_t FRSKYV_cc2500_conf[][2]={
{ CC2500_17_MCSM1, 0x0c },
{ CC2500_18_MCSM0, 0x18 },
{ CC2500_06_PKTLEN, 0xff },
{ CC2500_07_PKTCTRL1, 0x04 },
{ CC2500_08_PKTCTRL0, 0x05 },
{ CC2500_3E_PATABLE, 0xfe },
{ CC2500_0B_FSCTRL1, 0x08 },
{ CC2500_0C_FSCTRL0, 0x00 },
{ CC2500_0D_FREQ2, 0x5c },
{ CC2500_0E_FREQ1, 0x58 },
{ CC2500_0F_FREQ0, 0x9d },
{ CC2500_10_MDMCFG4, 0xaa },
{ CC2500_11_MDMCFG3, 0x10 },
{ CC2500_12_MDMCFG2, 0x93 },
{ CC2500_13_MDMCFG1, 0x23 },
{ CC2500_14_MDMCFG0, 0x7a },
{ CC2500_15_DEVIATN, 0x41 }
};
static void __attribute__((unused)) FRSKYV_init()
{
for(uint8_t i=0;i<17;i++)
{
uint8_t reg=pgm_read_byte_near(&FRSKYV_cc2500_conf[i][0]);
uint8_t val=pgm_read_byte_near(&FRSKYV_cc2500_conf[i][1]);
if(reg==CC2500_0C_FSCTRL0)
val=option;
CC2500_WriteReg(reg,val);
}
prev_option = option ;
for(uint8_t i=19;i<36;i++)
{
uint8_t reg=pgm_read_byte_near(&cc2500_conf[i][0]);
uint8_t val=pgm_read_byte_near(&cc2500_conf[i][1]);
CC2500_WriteReg(reg,val);
}
CC2500_SetTxRxMode(TX_EN);
CC2500_SetPower();
CC2500_Strobe(CC2500_SIDLE); // Go to idle...
}
static uint8_t __attribute__((unused)) FRSKYV_crc8(uint8_t result, uint8_t *data, uint8_t len)
{
for(uint8_t i = 0; i < len; i++)
@ -199,7 +155,7 @@ uint16_t initFRSKYV()
rx_tx_addr[2]&=0x7F;
crc8 = FRSKYV_crc8_le(rx_tx_addr+2, 2);
FRSKYV_init();
FRSKY_init_cc2500(FRSKYV_cc2500_conf);
seed = 1;
binding_idx=0;
phase = FRSKYV_DATA1;

View File

@ -21,8 +21,6 @@
#include "iface_cc2500.h"
uint8_t chanskip;
uint8_t counter_rst;
uint8_t ctr;
uint8_t seq_last_sent;
uint8_t seq_last_rcvd;
@ -35,39 +33,7 @@ static void __attribute__((unused)) set_start(uint8_t ch )
static void __attribute__((unused)) frskyX_init()
{
for(uint8_t i=0;i<36;i++)
{
uint8_t reg=pgm_read_byte_near(&cc2500_conf[i][0]);
uint8_t val=pgm_read_byte_near(&cc2500_conf[i][1]);
if(reg==CC2500_06_PKTLEN)
val=0x1E;
else
if(reg==CC2500_08_PKTCTRL0)
val=0x01;
else
if(reg==CC2500_0B_FSCTRL1)
val=0x0A;
else
if(reg==CC2500_10_MDMCFG4)
val=0x7B;
else
if(reg==CC2500_11_MDMCFG3)
val=0x61;
else
if(reg==CC2500_12_MDMCFG2)
val=0x13;
else
if(reg==CC2500_15_DEVIATN)
val=0x51;
CC2500_WriteReg(reg,val);
}
CC2500_WriteReg(CC2500_07_PKTCTRL1, 0x04);
prev_option = option ;
CC2500_WriteReg(CC2500_0C_FSCTRL0, option);
CC2500_Strobe(CC2500_SIDLE);
FRSKY_init_cc2500((sub_protocol&2)?FRSKYXEU_cc2500_conf:FRSKYX_cc2500_conf); // LBT or FCC
//
for(uint8_t c=0;c < 48;c++)
{//calibrate hop channels
@ -117,14 +83,14 @@ static uint16_t __attribute__((unused)) scaleForPXX( uint8_t i )
static void __attribute__((unused)) frskyX_build_bind_packet()
{
packet[0] = 0x1D;
packet[1] = 0x03;
packet[2] = 0x01;
//
packet[0] = (sub_protocol & 2 ) ? 0x20 : 0x1D ; // LBT or FCC
packet[1] = 0x03;
packet[2] = 0x01;
//
packet[3] = rx_tx_addr[3];
packet[4] = rx_tx_addr[2];
int idx = ((state -FRSKY_BIND) % 10) * 5;
packet[5] = idx;
packet[5] = idx;
packet[6] = hopping_frequency[idx++];
packet[7] = hopping_frequency[idx++];
packet[8] = hopping_frequency[idx++];
@ -133,11 +99,12 @@ static void __attribute__((unused)) frskyX_build_bind_packet()
packet[11] = 0x02;
packet[12] = RX_num;
//
memset(&packet[13], 0, 15);
uint16_t lcrc = crc_x(&packet[3], 25);
uint8_t limit = (sub_protocol & 2 ) ? 31 : 28 ;
memset(&packet[13], 0, limit - 13);
uint16_t lcrc = crc_x(&packet[3], limit-3);
//
packet[28] = lcrc >> 8;
packet[29] = lcrc;
packet[limit++] = lcrc >> 8;
packet[limit] = lcrc;
//
}
@ -150,13 +117,13 @@ static void __attribute__((unused)) frskyX_data_frame()
uint16_t chan_1 ;
uint8_t startChan = 0;
//
packet[0] = 0x1D;
packet[0] = (sub_protocol & 2 ) ? 0x20 : 0x1D ; // LBT or FCC
packet[1] = rx_tx_addr[3];
packet[2] = rx_tx_addr[2];
packet[3] = 0x02;
//
packet[4] = (ctr<<6)+hopping_frequency_no;
packet[5] = counter_rst;
packet[4] = (chanskip<<6)|hopping_frequency_no;
packet[5] = chanskip>>2;
packet[6] = RX_num;
//packet[7] = FLAGS 00 - standard packet
//10, 12, 14, 16, 18, 1A, 1C, 1E - failsafe packet
@ -190,17 +157,18 @@ static void __attribute__((unused)) frskyX_data_frame()
else if (seq_last_rcvd == 0x00)
seq_last_sent = 1;
if(sub_protocol== CH_8 )// in X8 mode send only 8ch every 9ms
if(sub_protocol & 1 )// in X8 mode send only 8ch every 9ms
lpass = 0 ;
else
lpass += 1 ;
for (uint8_t i=22;i<28;i++)
uint8_t limit = (sub_protocol & 2 ) ? 31 : 28 ;
for (uint8_t i=22;i<limit;i++)
packet[i]=0;
uint16_t lcrc = crc_x(&packet[3], 25);
uint16_t lcrc = crc_x(&packet[3], limit-3);
packet[28]=lcrc>>8;//high byte
packet[29]=lcrc;//low byte
packet[limit++]=lcrc>>8;//high byte
packet[limit]=lcrc;//low byte
}
uint16_t ReadFrSkyX()
@ -215,7 +183,10 @@ uint16_t ReadFrSkyX()
frskyX_build_bind_packet();
CC2500_Strobe(CC2500_SIDLE);
CC2500_WriteData(packet, packet[0]+1);
state++;
if(IS_BIND_DONE_on)
state = FRSKY_BIND_DONE;
else
state++;
return 9000;
case FRSKY_BIND_DONE:
initialize_data(0);
@ -253,7 +224,7 @@ uint16_t ReadFrSkyX()
len = CC2500_ReadReg(CC2500_3B_RXBYTES | CC2500_READ_BURST) & 0x7F;
if (len && (len<=(0x0E + 3))) //Telemetry frame is 17
{
counter=0;
packet_count=0;
CC2500_ReadData(pkt, len);
#if defined TELEMETRY
frsky_check_telemetry(pkt,len); //check if valid telemetry packets
@ -263,13 +234,13 @@ uint16_t ReadFrSkyX()
}
else
{
counter++;
packet_count++;
// restart sequence on missed packet - might need count or timeout instead of one missed
if(counter>100)
if(packet_count>100)
{//~1sec
seq_last_sent = 0;
seq_last_rcvd = 8;
counter=0;
packet_count=0;
#if defined TELEMETRY
telemetry_lost=1;
#endif
@ -286,19 +257,15 @@ uint16_t initFrSkyX()
{
set_rx_tx_addr(MProtocol_id_master);
Frsky_init_hop();
packet_count=0;
while(!chanskip)
chanskip=random(0xfefefefe)%47;
while((chanskip-ctr)%4)
ctr=(ctr+1)%4;
counter_rst=(chanskip-ctr)>>2;
//for test***************
//rx_tx_addr[3]=0xB3;
//rx_tx_addr[2]=0xFD;
//************************
hopping_frequency[47]=0;
frskyX_init();
CC2500_SetTxRxMode(TX_EN);
//
if(IS_AUTOBIND_FLAG_on)
{

View File

@ -0,0 +1,158 @@
/*
This project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Multiprotocol is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
*/
// Compatible with Global Drone GW008 protocol.
// There are 3 versions of this small quad, this protocol is for the one with a XNS104 IC in the stock Tx and PAN159CY IC in the quad (SOCs with built-in xn297 compatible RF).
// The xn297 version is compatible with the CX10 protocol (green pcb).
// The LT8910 version is not supported yet.
#if defined(GW008_NRF24L01_INO)
#include "iface_nrf24l01.h"
#define GW008_INITIAL_WAIT 500
#define GW008_PACKET_PERIOD 2400
#define GW008_RF_BIND_CHANNEL 2
#define GW008_PAYLOAD_SIZE 15
enum {
GW008_BIND1,
GW008_BIND2,
GW008_DATA
};
static void __attribute__((unused)) send_packet(uint8_t bind)
{
packet[0] = rx_tx_addr[0];
if(bind)
{
packet[1] = 0x55;
packet[2] = hopping_frequency[0];
packet[3] = hopping_frequency[1];
packet[4] = hopping_frequency[2];
packet[5] = hopping_frequency[3];
memset(&packet[6], 0, 7);
packet[13] = 0xaa;
}
else
{
packet[1] = 0x01 | GET_FLAG(AUX1, 0x40); // flip
packet[2] = convert_channel_8b_scale(AILERON , 200, 0); // aileron
packet[3] = convert_channel_8b_scale(ELEVATOR, 0, 200); // elevator
packet[4] = convert_channel_8b_scale(RUDDER , 200, 0); // rudder
packet[5] = convert_channel_8b_scale(THROTTLE, 0, 200); // throttle
packet[6] = 0xaa;
packet[7] = 0x02; // max rate
packet[8] = 0x00;
packet[9] = 0x00;
packet[10]= 0x00;
packet[11]= 0x00;
packet[12]= 0x00;
packet[13]= rx_tx_addr[2];
}
packet[14] = rx_tx_addr[1];
// Power on, TX mode, CRC enabled
XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | _BV(NRF24L01_00_PWR_UP));
NRF24L01_WriteReg(NRF24L01_05_RF_CH, bind ? GW008_RF_BIND_CHANNEL : hopping_frequency[(hopping_frequency_no++)/2]);
hopping_frequency_no %= 8;
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70);
NRF24L01_FlushTx();
XN297_WriteEnhancedPayload(packet, GW008_PAYLOAD_SIZE, 0, 0x3c7d);
NRF24L01_SetPower(); // Set tx_power
}
static void __attribute__((unused)) GW008_init()
{
NRF24L01_Initialize();
NRF24L01_SetTxRxMode(TX_EN);
XN297_SetTXAddr((uint8_t*)"\xcc\xcc\xcc\xcc\xcc", 5);
XN297_SetRXAddr((uint8_t*)"\xcc\xcc\xcc\xcc\xcc", 5);
NRF24L01_FlushTx();
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); // Clear data ready, data sent, and retransmit
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No Auto Acknowldgement on all data pipes
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, 0x01);
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, GW008_PAYLOAD_SIZE+2); // payload + 2 bytes for pcf
NRF24L01_WriteReg(NRF24L01_03_SETUP_AW, 0x03);
NRF24L01_WriteReg(NRF24L01_04_SETUP_RETR, 0x00); // no retransmits
NRF24L01_SetBitrate(NRF24L01_BR_1M);
NRF24L01_SetPower();
NRF24L01_Activate(0x73); // Activate feature register
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
NRF24L01_WriteReg(NRF24L01_1D_FEATURE, 0x01); // Set feature bits on
NRF24L01_Activate(0x73);
}
static void __attribute__((unused)) GW008_initialize_txid()
{
uint32_t lfsr = random(0xfefefefe) + ((uint32_t)random(0xfefefefe) << 16);
for(uint8_t i=0; i<4; i++)
hopping_frequency[i] = 0x10 + ((lfsr >> (i*8)) % 0x37);
}
uint16_t GW008_callback()
{
switch(phase)
{
case GW008_BIND1:
if((NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_RX_DR)) && // RX fifo data ready
XN297_ReadEnhancedPayload(packet, GW008_PAYLOAD_SIZE) == GW008_PAYLOAD_SIZE && // check payload size
packet[0] == rx_tx_addr[0] && packet[14] == rx_tx_addr[1]) // check tx id
{
NRF24L01_SetTxRxMode(TXRX_OFF);
NRF24L01_SetTxRxMode(TX_EN);
rx_tx_addr[2] = packet[13];
BIND_DONE;
phase = GW008_DATA;
}
else
{
NRF24L01_SetTxRxMode(TXRX_OFF);
NRF24L01_SetTxRxMode(TX_EN);
send_packet(1);
phase = GW008_BIND2;
return 300;
}
break;
case GW008_BIND2:
// switch to RX mode
NRF24L01_SetTxRxMode(TXRX_OFF);
NRF24L01_FlushRx();
NRF24L01_SetTxRxMode(RX_EN);
XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO)
| _BV(NRF24L01_00_PWR_UP) | _BV(NRF24L01_00_PRIM_RX));
phase = GW008_BIND1;
return 5000;
break;
case GW008_DATA:
send_packet(0);
break;
}
return GW008_PACKET_PERIOD;
}
uint16_t initGW008()
{
BIND_IN_PROGRESS; // autobind protocol
GW008_initialize_txid();
phase = GW008_BIND1;
GW008_init();
hopping_frequency_no = 0;
return GW008_INITIAL_WAIT;
}
#endif

View File

@ -352,7 +352,7 @@ uint16_t initHubsan() {
packet_count=0;
id_data=ID_NORMAL;
#ifdef HUBSAN_HUB_TELEMETRY
init_hub_telemetry();
init_frskyd_link_telemetry();
#endif
return 10000;
}

View File

@ -261,7 +261,8 @@ uint16_t initMT99XX(void)
bind_counter = MT99XX_BIND_COUNT;
memcpy(hopping_frequency,"\x02\x48\x0C\x3e\x16\x34\x20\x2A\x2A\x20\x34\x16\x3e\x0c\x48\x02",16);
hopping_frequency_no=0;
MT99XX_initialize_txid();
MT99XX_init();

View File

@ -598,7 +598,7 @@ clean_list :
$(REMOVE) $(TARGET).map
$(REMOVE) $(TARGET).sym
$(REMOVE) $(TARGET).lss
$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
$(REMOVE) $(CPPSRC:%.cpp=%.o)
$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
$(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d)

View File

@ -12,7 +12,7 @@
12,CX10,GREEN,BLUE,DM007,---,J3015_1,J3015_2,MK33041
13,CG023,CG023,YD829,H8_3D
14,Bayang,Bayang,H8S3D
15,FrskyX,CH_16,CH_8
15,FrskyX,CH_16,CH_8,EU_16,EU_8
16,ESky
17,MT99xx,MT,H7,YZ,LS,FY805
18,MJXq,WLH08,X600,X800,H26D,E010,H26WH
@ -28,3 +28,6 @@
28,AFHD2SA,PWM_IBUS,PPM_IBUS,PWM_SBUS,PPM_SBUS
29,Q2X2,Q222,Q242,Q282
30,WK2x01,WK2801,WK2401,W6_5_1,W6_6_1,W6_HEL,W6_HEL_I
31,Q303,Q303,CX35,CX10D,CX10WD
32,GW008
33,DM002

View File

@ -34,6 +34,8 @@ extern uint16_t DevoInit(void) ;
extern uint16_t devo_callback(void) ;
extern uint16_t initJ6Pro(void) ;
extern uint16_t ReadJ6Pro(void) ;
extern uint16_t WK_setup(void) ;
extern uint16_t WK_cb(void) ;
extern void randomSeed(unsigned int seed) ;
extern long random(long howbig) ;
@ -46,7 +48,7 @@ extern void delayMilliseconds(unsigned long ms) ;
extern void init(void) ;
extern void modules_reset() ;
extern void Update_All() ;
extern uint8_t Update_All() ;
extern void tx_pause() ;
extern void tx_resume() ;
extern void TelemetryUpdate() ;
@ -139,13 +141,14 @@ void init()
#include "Multiprotocol.ino"
#include "SPI.ino"
#include "Convert.ino"
#include "Common.ino"
#include "Arduino.ino"
#include "cyrf6936_SPI.ino"
#include "DSM_cyrf6936.ino"
#include "Devo_cyrf6936.ino"
#include "J6Pro_cyrf6936.ino"
#include "WK2x01_cyrf6936.ino"
#include "Telemetry.ino"

View File

@ -19,8 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 1
#define VERSION_REVISION 6
#define VERSION_PATCH_LEVEL 4
#define VERSION_PATCH_LEVEL 21
//******************
// Protocols
//******************
@ -57,6 +56,9 @@ enum PROTOCOLS
MODE_AFHDS2A = 28, // =>A7105
MODE_Q2X2 = 29, // =>NRF24L01, extension of CX-10 protocol
MODE_WK2x01 = 30, // =>CYRF6936
MODE_Q303 = 31, // =>NRF24L01
MODE_GW008 = 32, // =>NRF24L01
MODE_DM002 = 33, // =>NRF24L01
};
enum Flysky
@ -157,6 +159,8 @@ enum FRSKYX
{
CH_16 = 0,
CH_8 = 1,
EU_16 = 2,
EU_8 = 3,
};
enum HONTAI
{
@ -184,6 +188,13 @@ enum WK2x01
W6_HEL = 4,
W6_HEL_I= 5,
};
enum Q303
{
Q303 = 0,
CX35 = 1,
CX10D = 2,
CX10WD = 3,
};
#define NONE 0
#define P_HIGH 1
@ -275,11 +286,17 @@ enum MultiPacketTypes {
#define INPUT_SIGNAL_on protocol_flags2 |= _BV(5)
#define IS_INPUT_SIGNAL_on ( ( protocol_flags2 & _BV(5) ) !=0 )
#define IS_INPUT_SIGNAL_off ( ( protocol_flags2 & _BV(5) ) ==0 )
//CH16
//Bind from channel
#define BIND_CH_PREV_off protocol_flags2 &= ~_BV(6)
#define BIND_CH_PREV_on protocol_flags2 |= _BV(6)
#define IS_BIND_CH_PREV_on ( ( protocol_flags2 & _BV(6) ) !=0 )
#define IS_BIND_CH_PREV_off ( ( protocol_flags2 & _BV(6) ) ==0 )
//Wait for bind
#define WAIT_BIND_off protocol_flags2 &= ~_BV(7)
#define WAIT_BIND_on protocol_flags2 |= _BV(7)
#define IS_WAIT_BIND_on ( ( protocol_flags2 & _BV(7) ) !=0 )
#define IS_WAIT_BIND_off ( ( protocol_flags2 & _BV(7) ) ==0 )
//********************
//*** Blink timing ***
@ -287,8 +304,11 @@ enum MultiPacketTypes {
#define BLINK_BIND_TIME 100
#define BLINK_SERIAL_TIME 500
#define BLINK_PPM_TIME 1000
#define BLINK_BAD_PROTO_TIME_LOW 1000
#define BLINK_BAD_PROTO_TIME_HIGH 50
#define BLINK_BAD_PROTO_TIME_LOW 1000
#define BLINK_WAIT_BIND_TIME_HIGH 1000
#define BLINK_WAIT_BIND_TIME_LOW 100
//*******************
//*** AUX flags ***
@ -459,6 +479,9 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
AFHDS2A 28
Q2X2 29
WK2x01 30
Q303 31
GW008 32
DM002 33
BindBit=> 0x80 1=Bind/0=No
AutoBindBit=> 0x40 1=Yes /0=No
RangeCheck=> 0x20 1=Yes /0=No
@ -530,6 +553,8 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
sub_protocol==FRSKYX
CH_16 0
CH_8 1
EU_16 2
EU_8 3
sub_protocol==HONTAI
FORMAT_HONTAI 0
FORMAT_JJRCX1 1
@ -553,10 +578,15 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
W6_6_1 3
W6_HEL 4
W6_HEL_I 5
sub_protocol==Q303
Q303 0
CX35 1
CX10D 2
CX10WD 3
Power value => 0x80 0=High/1=Low
Stream[3] = option_protocol;
option_protocol value is -127..127
option_protocol value is -128..127
Stream[4] to [25] = Channels
16 Channels on 11 bits (0..2047)
0 -125%
@ -567,18 +597,41 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
Channels bits are concatenated to fit in 22 bytes like in SBUS protocol
*/
/*
Multiprotocol telemetry definition
Multimodule Status
Based on #define MULTI_STATUS
Serial: 100000 Baud 8e2 (same as input)
Format: header (2 bytes) + data (variable)
[0] = 'M' (0x4d)
[1] Length (excluding the 2 header bytes)
[2-xx] data
Type = 0x01 Multimodule Status:
[2] Flags
0x01 = Input signal detected
0x02 = Serial mode enabled
0x04 = protocol is valid
0x08 = module is in binding mode
0x10 = module waits a bind event to load the protocol
[3] major
[4] minor
[5] revision
[6] patchlevel,
version of multi code, should be displayed as major.minor.revision.patchlevel
*/
/*
Multiprotocol telemetry definition for OpenTX
Based on #define MULTI_TELEMETRY enables OpenTX to get the multimodule status and select the correct telemetry type automatically.
Serial: 100000 Baud 8e2 (same as input)
TLV Protocol (type, length, value), allows a TX to ignore unknown messages
Format: header (4 byte) + data (variable)
[0] = 'M' (0x4d)
[1] = 'P' (0x50)
The first byte is deliberatly chosen to be different from other telemetry protocols
(e.g. 0xAA for DSM/Multi, 0xAA for FlySky and 0x7e for Frsky) to allow a TX to detect
the telemetry format of older versions
@ -588,13 +641,13 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
[4-xx] data
Type = 0x01 Multimodule Status:
Type = 0x01 Multimodule Status:
[4] Flags
0x01 = Input signal detected
0x02 = Serial mode enabled
0x04 = protocol is valid
0x08 = module is in binding mode
0x10 = module waits a bind event to load the protocol
[5] major
[6] minor
[7] revision
@ -604,25 +657,25 @@ Type = 0x01 Multimodule Status:
more information can be added by specifing a longer length of the type, the TX will just ignore these bytes
Type 0x02 Frksy S.port telemetry
Type 0x03 Frsky Hub telemetry
Type 0x02 Frksy S.port telemetry
Type 0x03 Frsky Hub telemetry
*No* usual frsky byte stuffing and without start/stop byte (0x7e)
Type 0x04 Spektrum telemetry data
Type 0x04 Spektrum telemetry data
data[0] RSSI
data[1-15] telemetry data
Type 0x05 DSM bind data
Type 0x05 DSM bind data
data[0-16] DSM bind data
technically DSM bind data is only 10 bytes but multi send 16
like with telemtry, check length field)
Type 0x06 Flysky AFHDS2 telemetry data
Type 0x06 Flysky AFHDS2 telemetry data
length: 29
data[0] = RSSI value
data[1-28] telemetry data
*/
*/

View File

@ -22,10 +22,22 @@
*/
#include <avr/pgmspace.h>
//#define DEBUG_TX
//#define USE_MY_CONFIG
#include "Multiprotocol.h"
//Multiprotocol module configuration file
#include "_Config.h"
// Let's automatically select the board
// if arm is selected
#ifdef __arm__
#define STM32_BOARD
#endif
//Personal config file
#if defined USE_MY_CONFIG
#include "_MyConfig.h"
#endif
#include "Pins.h"
#include "TX_Def.h"
#include "Validate.h"
@ -140,16 +152,29 @@ uint8_t pkt[MAX_PKT];//telemetry receiving packets
#endif
uint8_t pass = 0;
uint8_t pktt[MAX_PKT];//telemetry receiving packets
#ifndef BASH_SERIAL
#define TXBUFFER_SIZE 32
#ifdef BASH_SERIAL
// For bit-bashed serial output
#define TXBUFFER_SIZE 128
volatile struct t_serial_bash
{
uint8_t head ;
uint8_t tail ;
uint8_t data[TXBUFFER_SIZE] ;
uint8_t busy ;
uint8_t speed ;
} SerialControl ;
#else
#define TXBUFFER_SIZE 64
volatile uint8_t tx_buff[TXBUFFER_SIZE];
volatile uint8_t tx_head=0;
volatile uint8_t tx_tail=0;
#endif // BASH_SERIAL
uint8_t v_lipo1;
uint8_t v_lipo2;
int16_t RSSI_dBm;
uint8_t RX_RSSI;
uint8_t TX_RSSI;
uint8_t RX_LQI;
uint8_t TX_LQI;
uint8_t telemetry_link=0;
uint8_t telemetry_counter=0;
uint8_t telemetry_lost;
@ -182,6 +207,7 @@ void setup()
TCC1.CTRLA = 0x0B ; // Event3 (prescale of 16)
#elif defined STM32_BOARD
//STM32
afio_cfg_debug_ports(AFIO_DEBUG_NONE);
pinMode(A7105_CSN_pin,OUTPUT);
pinMode(CC25_CSN_pin,OUTPUT);
pinMode(NRF_CSN_pin,OUTPUT);
@ -219,17 +245,17 @@ void setup()
// outputs
SDI_output;
SCLK_output;
#ifdef A7105_INSTALLED
#ifdef A7105_CSN_pin
A7105_CSN_output;
#endif
#ifdef CC2500_INSTALLED
#ifdef CC25_CSN_pin
CC25_CSN_output;
#endif
#ifdef CYRF6936_INSTALLED
#ifdef CYRF_CSN_pin
CYRF_RST_output;
CYRF_CSN_output;
#endif
#ifdef NRF24L01_INSTALLED
#ifdef NRF_CSN_pin
NRF_CSN_output;
#endif
PE1_output;
@ -252,16 +278,16 @@ void setup()
#endif
// Set Chip selects
#ifdef A7105_INSTALLED
#ifdef A7105_CSN_pin
A7105_CSN_on;
#endif
#ifdef CC2500_INSTALLED
#ifdef CC25_CSN_pin
CC25_CSN_on;
#endif
#ifdef CYRF6936_INSTALLED
#ifdef CYRF_CSN_pin
CYRF_CSN_on;
#endif
#ifdef NRF24L01_INSTALLED
#ifdef NRF_CSN_pin
NRF_CSN_on;
#endif
// Set SPI lines
@ -380,13 +406,13 @@ void loop()
while(1)
{
if(remote_callback==0 || diff>2*200)
if(remote_callback==0 || IS_WAIT_BIND_on || diff>2*200)
{
do
{
Update_All();
}
while(remote_callback==0);
while(remote_callback==0 || IS_WAIT_BIND_on);
}
#ifndef STM32_BOARD
if( (TIFR1 & OCF1A_bm) != 0)
@ -411,7 +437,7 @@ void loop()
{
TX_MAIN_PAUSE_on;
tx_pause();
if(IS_INPUT_SIGNAL_on)
if(IS_INPUT_SIGNAL_on && remote_callback!=0)
next_callback=remote_callback();
else
next_callback=2000; // No PPM/serial signal check again in 2ms...
@ -428,9 +454,11 @@ void loop()
TIMER2_BASE->SR &= ~TIMER_SR_CC1IF; //clear compare Flag
#endif
sei(); // enable global int
Update_All();
if(IS_CHANGE_PROTOCOL_FLAG_on)
break; // Protocol has been changed
if(Update_All()) // Protocol changed?
{
next_callback=0; // Launch new protocol ASAP
break;
}
#ifndef STM32_BOARD
while((TIFR1 & OCF1A_bm) == 0); // wait 2ms...
#else
@ -454,12 +482,13 @@ void loop()
}
}
void Update_All()
uint8_t Update_All()
{
#ifdef ENABLE_SERIAL
if(mode_select==MODE_SERIAL && IS_RX_FLAG_on) // Serial mode and something has been received
{
update_serial_data(); // Update protocol and data
update_channels_aux();
INPUT_SIGNAL_on; //valid signal received
last_signal=millis();
}
@ -467,7 +496,7 @@ void Update_All()
#ifdef ENABLE_PPM
if(mode_select!=MODE_SERIAL && IS_PPM_FLAG_on) // PPM mode and a full frame has been received
{
for(uint8_t i=0;i<NUM_CHN;i++)
for(uint8_t i=0;i<MAX_PPM_CHANNELS;i++)
{ // update servo data without interrupts to prevent bad read in protocols
uint16_t temp_ppm ;
cli(); // disable global int
@ -478,10 +507,18 @@ void Update_All()
Servo_data[i]= temp_ppm ;
}
PPM_FLAG_off; // wait for next frame before update
update_channels_aux();
INPUT_SIGNAL_on; //valid signal received
last_signal=millis();
}
#endif //ENABLE_PPM
update_led_status();
#if defined(TELEMETRY)
#if ( !( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) ) )
if((protocol==MODE_FRSKYD) || (protocol==MODE_BAYANG) || (protocol==MODE_HUBSAN) || (protocol==MODE_AFHDS2A) || (protocol==MODE_FRSKYX) || (protocol==MODE_DSM) )
#endif
TelemetryUpdate();
#endif
#ifdef ENABLE_BIND_CH
if(IS_AUTOBIND_FLAG_on && IS_BIND_CH_PREV_off && Servo_data[BIND_CH-1]>PPM_MAX_COMMAND && Servo_data[THROTTLE]<(servo_min_100+25))
{ // Autobind is on and BIND_CH went up and Throttle is low
@ -489,22 +526,23 @@ void Update_All()
BIND_CH_PREV_on;
}
if(IS_BIND_CH_PREV_on && Servo_data[BIND_CH-1]<PPM_MIN_COMMAND)
{
BIND_CH_PREV_off;
#if defined(FRSKYD_CC2500_INO) || defined(FRSKYX_CC2500_INO) || defined(FRSKYV_CC2500_INO)
if(protocol==MODE_FRSKYD || protocol==MODE_FRSKYX || protocol==MODE_FRSKYV)
BIND_DONE;
else
#endif
if(bind_counter>2)
bind_counter=2;
}
#endif //ENABLE_BIND_CH
if(IS_CHANGE_PROTOCOL_FLAG_on)
{ // Protocol needs to be changed or relaunched for bind
LED_off; //led off during protocol init
modules_reset(); //reset all modules
protocol_init(); //init new protocol
return 1;
}
update_channels_aux();
#if defined(TELEMETRY)
#if !defined(MULTI_TELEMETRY)
if((protocol==MODE_FRSKYD) || (protocol==MODE_BAYANG) || (protocol==MODE_HUBSAN) || (protocol==MODE_AFHDS2A) || (protocol==MODE_FRSKYX) || (protocol==MODE_DSM) )
#endif
TelemetryUpdate();
#endif
update_led_status();
return 0;
}
// Update channels direction and Servo_AUX flags based on servo AUX positions
@ -555,9 +593,19 @@ static void update_led_status(void)
}
else
{
if(IS_BIND_DONE_on)
LED_off; //bind completed force led on
blink+=BLINK_BIND_TIME; //blink fastly during binding
if(IS_WAIT_BIND_on)
{
if(IS_LED_on) //flash to indicate WAIT_BIND
blink+=BLINK_WAIT_BIND_TIME_LOW;
else
blink+=BLINK_WAIT_BIND_TIME_HIGH;
}
else
{
if(IS_BIND_DONE_on)
LED_off; //bind completed force led on
blink+=BLINK_BIND_TIME; //blink fastly during binding
}
}
LED_toggle;
}
@ -624,269 +672,312 @@ void start_timer2()
// Protocol start
static void protocol_init()
{
uint16_t next_callback=0; // Default is immediate call back
remote_callback = 0;
CHANGE_PROTOCOL_FLAG_off;
// reset telemetry
#ifdef TELEMETRY
tx_pause();
pass=0;
telemetry_link=0;
telemetry_lost=1;
#ifndef BASH_SERIAL
tx_tail=0;
tx_head=0;
#endif
TX_RX_PAUSE_off;
TX_MAIN_PAUSE_off;
#endif
//Set global ID and rx_tx_addr
MProtocol_id = RX_num + MProtocol_id_master;
set_rx_tx_addr(MProtocol_id);
blink=millis();
if(IS_BIND_BUTTON_FLAG_on)
AUTOBIND_FLAG_on;
if(IS_AUTOBIND_FLAG_on)
BIND_IN_PROGRESS; // Indicates bind in progress for blinking bind led
else
BIND_DONE;
PE1_on; //NRF24L01 antenna RF3 by default
PE2_off; //NRF24L01 antenna RF3 by default
switch(protocol) // Init the requested protocol
static uint16_t next_callback;
if(IS_WAIT_BIND_off)
{
#ifdef A7105_INSTALLED
#if defined(FLYSKY_A7105_INO)
case MODE_FLYSKY:
PE1_off; //antenna RF1
next_callback = initFlySky();
remote_callback = ReadFlySky;
break;
#endif
#if defined(AFHDS2A_A7105_INO)
case MODE_AFHDS2A:
PE1_off; //antenna RF1
next_callback = initAFHDS2A();
remote_callback = ReadAFHDS2A;
break;
#endif
#if defined(HUBSAN_A7105_INO)
case MODE_HUBSAN:
PE1_off; //antenna RF1
if(IS_BIND_BUTTON_FLAG_on) random_id(10,true); // Generate new ID if bind button is pressed.
next_callback = initHubsan();
remote_callback = ReadHubsan;
break;
remote_callback = 0; // No protocol
next_callback=0; // Default is immediate call back
LED_off; // Led off during protocol init
modules_reset(); // Reset all modules
// reset telemetry
#ifdef TELEMETRY
tx_pause();
pass=0;
telemetry_link=0;
telemetry_lost=1;
#ifdef BASH_SERIAL
TIMSK0 = 0 ; // Stop all timer 0 interrupts
#ifdef INVERT_SERIAL
SERIAL_TX_off;
#else
SERIAL_TX_on;
#endif
SerialControl.tail=0;
SerialControl.head=0;
SerialControl.busy=0;
#else
tx_tail=0;
tx_head=0;
#endif
TX_RX_PAUSE_off;
TX_MAIN_PAUSE_off;
#endif
#ifdef CC2500_INSTALLED
#if defined(FRSKYD_CC2500_INO)
case MODE_FRSKYD:
PE1_off; //antenna RF2
PE2_on;
next_callback = initFrSky_2way();
remote_callback = ReadFrSky_2way;
break;
//Set global ID and rx_tx_addr
MProtocol_id = RX_num + MProtocol_id_master;
set_rx_tx_addr(MProtocol_id);
blink=millis();
if(IS_BIND_BUTTON_FLAG_on)
AUTOBIND_FLAG_on;
if(IS_AUTOBIND_FLAG_on)
BIND_IN_PROGRESS; // Indicates bind in progress for blinking bind led
else
BIND_DONE;
PE1_on; //NRF24L01 antenna RF3 by default
PE2_off; //NRF24L01 antenna RF3 by default
switch(protocol) // Init the requested protocol
{
#ifdef A7105_INSTALLED
#if defined(FLYSKY_A7105_INO)
case MODE_FLYSKY:
PE1_off; //antenna RF1
next_callback = initFlySky();
remote_callback = ReadFlySky;
break;
#endif
#if defined(AFHDS2A_A7105_INO)
case MODE_AFHDS2A:
PE1_off; //antenna RF1
next_callback = initAFHDS2A();
remote_callback = ReadAFHDS2A;
break;
#endif
#if defined(HUBSAN_A7105_INO)
case MODE_HUBSAN:
PE1_off; //antenna RF1
if(IS_BIND_BUTTON_FLAG_on) random_id(10,true); // Generate new ID if bind button is pressed.
next_callback = initHubsan();
remote_callback = ReadHubsan;
break;
#endif
#endif
#if defined(FRSKYV_CC2500_INO)
case MODE_FRSKYV:
PE1_off; //antenna RF2
PE2_on;
next_callback = initFRSKYV();
remote_callback = ReadFRSKYV;
break;
#ifdef CC2500_INSTALLED
#if defined(FRSKYD_CC2500_INO)
case MODE_FRSKYD:
PE1_off; //antenna RF2
PE2_on;
next_callback = initFrSky_2way();
remote_callback = ReadFrSky_2way;
break;
#endif
#if defined(FRSKYV_CC2500_INO)
case MODE_FRSKYV:
PE1_off; //antenna RF2
PE2_on;
next_callback = initFRSKYV();
remote_callback = ReadFRSKYV;
break;
#endif
#if defined(FRSKYX_CC2500_INO)
case MODE_FRSKYX:
PE1_off; //antenna RF2
PE2_on;
next_callback = initFrSkyX();
remote_callback = ReadFrSkyX;
break;
#endif
#if defined(SFHSS_CC2500_INO)
case MODE_SFHSS:
PE1_off; //antenna RF2
PE2_on;
next_callback = initSFHSS();
remote_callback = ReadSFHSS;
break;
#endif
#endif
#if defined(FRSKYX_CC2500_INO)
case MODE_FRSKYX:
PE1_off; //antenna RF2
PE2_on;
next_callback = initFrSkyX();
remote_callback = ReadFrSkyX;
break;
#endif
#if defined(SFHSS_CC2500_INO)
case MODE_SFHSS:
PE1_off; //antenna RF2
PE2_on;
next_callback = initSFHSS();
remote_callback = ReadSFHSS;
break;
#endif
#endif
#ifdef CYRF6936_INSTALLED
#if defined(DSM_CYRF6936_INO)
case MODE_DSM:
PE2_on; //antenna RF4
next_callback = initDsm();
//Servo_data[2]=1500;//before binding
remote_callback = ReadDsm;
break;
#endif
#if defined(DEVO_CYRF6936_INO)
case MODE_DEVO:
#ifdef ENABLE_PPM
if(mode_select) //PPM mode
{
if(IS_BIND_BUTTON_FLAG_on)
#ifdef CYRF6936_INSTALLED
#if defined(DSM_CYRF6936_INO)
case MODE_DSM:
PE2_on; //antenna RF4
next_callback = initDsm();
//Servo_data[2]=1500;//before binding
remote_callback = ReadDsm;
break;
#endif
#if defined(DEVO_CYRF6936_INO)
case MODE_DEVO:
#ifdef ENABLE_PPM
if(mode_select) //PPM mode
{
eeprom_write_byte((EE_ADDR)(30+mode_select),0x00); // reset to autobind mode for the current model
option=0;
if(IS_BIND_BUTTON_FLAG_on)
{
eeprom_write_byte((EE_ADDR)(30+mode_select),0x00); // reset to autobind mode for the current model
option=0;
}
else
{
option=eeprom_read_byte((EE_ADDR)(30+mode_select)); // load previous mode: autobind or fixed id
if(option!=1) option=0; // if not fixed id mode then it should be autobind
}
}
else
{
option=eeprom_read_byte((EE_ADDR)(30+mode_select)); // load previous mode: autobind or fixed id
if(option!=1) option=0; // if not fixed id mode then it should be autobind
}
}
#endif //ENABLE_PPM
PE2_on; //antenna RF4
next_callback = DevoInit();
remote_callback = devo_callback;
break;
#endif
#if defined(WK2x01_CYRF6936_INO)
case MODE_WK2x01:
#ifdef ENABLE_PPM
if(mode_select) //PPM mode
{
if(IS_BIND_BUTTON_FLAG_on)
#endif //ENABLE_PPM
PE2_on; //antenna RF4
next_callback = DevoInit();
remote_callback = devo_callback;
break;
#endif
#if defined(WK2x01_CYRF6936_INO)
case MODE_WK2x01:
#ifdef ENABLE_PPM
if(mode_select) //PPM mode
{
eeprom_write_byte((EE_ADDR)(30+mode_select),0x00); // reset to autobind mode for the current model
option=0;
if(IS_BIND_BUTTON_FLAG_on)
{
eeprom_write_byte((EE_ADDR)(30+mode_select),0x00); // reset to autobind mode for the current model
option=0;
}
else
{
option=eeprom_read_byte((EE_ADDR)(30+mode_select)); // load previous mode: autobind or fixed id
if(option!=1) option=0; // if not fixed id mode then it should be autobind
}
}
else
{
option=eeprom_read_byte((EE_ADDR)(30+mode_select)); // load previous mode: autobind or fixed id
if(option!=1) option=0; // if not fixed id mode then it should be autobind
}
}
#endif //ENABLE_PPM
PE2_on; //antenna RF4
next_callback = WK_setup();
remote_callback = WK_cb;
break;
#endif //ENABLE_PPM
PE2_on; //antenna RF4
next_callback = WK_setup();
remote_callback = WK_cb;
break;
#endif
#if defined(J6PRO_CYRF6936_INO)
case MODE_J6PRO:
PE2_on; //antenna RF4
next_callback = initJ6Pro();
remote_callback = ReadJ6Pro;
break;
#endif
#endif
#if defined(J6PRO_CYRF6936_INO)
case MODE_J6PRO:
PE2_on; //antenna RF4
next_callback = initJ6Pro();
remote_callback = ReadJ6Pro;
break;
#ifdef NRF24L01_INSTALLED
#if defined(HISKY_NRF24L01_INO)
case MODE_HISKY:
next_callback=initHiSky();
remote_callback = hisky_cb;
break;
#endif
#if defined(V2X2_NRF24L01_INO)
case MODE_V2X2:
next_callback = initV2x2();
remote_callback = ReadV2x2;
break;
#endif
#if defined(YD717_NRF24L01_INO)
case MODE_YD717:
next_callback=initYD717();
remote_callback = yd717_callback;
break;
#endif
#if defined(KN_NRF24L01_INO)
case MODE_KN:
next_callback = initKN();
remote_callback = kn_callback;
break;
#endif
#if defined(SYMAX_NRF24L01_INO)
case MODE_SYMAX:
next_callback = initSymax();
remote_callback = symax_callback;
break;
#endif
#if defined(SLT_NRF24L01_INO)
case MODE_SLT:
next_callback=initSLT();
remote_callback = SLT_callback;
break;
#endif
#if defined(CX10_NRF24L01_INO)
case MODE_Q2X2:
sub_protocol|=0x08; // Increase the number of sub_protocols for CX-10
case MODE_CX10:
next_callback=initCX10();
remote_callback = CX10_callback;
break;
#endif
#if defined(CG023_NRF24L01_INO)
case MODE_CG023:
next_callback=initCG023();
remote_callback = CG023_callback;
break;
#endif
#if defined(BAYANG_NRF24L01_INO)
case MODE_BAYANG:
next_callback=initBAYANG();
remote_callback = BAYANG_callback;
break;
#endif
#if defined(ESKY_NRF24L01_INO)
case MODE_ESKY:
next_callback=initESKY();
remote_callback = ESKY_callback;
break;
#endif
#if defined(MT99XX_NRF24L01_INO)
case MODE_MT99XX:
next_callback=initMT99XX();
remote_callback = MT99XX_callback;
break;
#endif
#if defined(MJXQ_NRF24L01_INO)
case MODE_MJXQ:
next_callback=initMJXQ();
remote_callback = MJXQ_callback;
break;
#endif
#if defined(SHENQI_NRF24L01_INO)
case MODE_SHENQI:
next_callback=initSHENQI();
remote_callback = SHENQI_callback;
break;
#endif
#if defined(FY326_NRF24L01_INO)
case MODE_FY326:
next_callback=initFY326();
remote_callback = FY326_callback;
break;
#endif
#if defined(FQ777_NRF24L01_INO)
case MODE_FQ777:
next_callback=initFQ777();
remote_callback = FQ777_callback;
break;
#endif
#if defined(ASSAN_NRF24L01_INO)
case MODE_ASSAN:
next_callback=initASSAN();
remote_callback = ASSAN_callback;
break;
#endif
#if defined(HONTAI_NRF24L01_INO)
case MODE_HONTAI:
next_callback=initHONTAI();
remote_callback = HONTAI_callback;
break;
#endif
#if defined(Q303_NRF24L01_INO)
case MODE_Q303:
next_callback=initQ303();
remote_callback = Q303_callback;
break;
#endif
#if defined(GW008_NRF24L01_INO)
case MODE_GW008:
next_callback=initGW008();
remote_callback = GW008_callback;
break;
#endif
#if defined(DM002_NRF24L01_INO)
case MODE_DM002:
next_callback=initDM002();
remote_callback = DM002_callback;
break;
#endif
#endif
#endif
#ifdef NRF24L01_INSTALLED
#if defined(HISKY_NRF24L01_INO)
case MODE_HISKY:
next_callback=initHiSky();
remote_callback = hisky_cb;
break;
#endif
#if defined(V2X2_NRF24L01_INO)
case MODE_V2X2:
next_callback = initV2x2();
remote_callback = ReadV2x2;
break;
#endif
#if defined(YD717_NRF24L01_INO)
case MODE_YD717:
next_callback=initYD717();
remote_callback = yd717_callback;
break;
#endif
#if defined(KN_NRF24L01_INO)
case MODE_KN:
next_callback = initKN();
remote_callback = kn_callback;
break;
#endif
#if defined(SYMAX_NRF24L01_INO)
case MODE_SYMAX:
next_callback = initSymax();
remote_callback = symax_callback;
break;
#endif
#if defined(SLT_NRF24L01_INO)
case MODE_SLT:
next_callback=initSLT();
remote_callback = SLT_callback;
break;
#endif
#if defined(CX10_NRF24L01_INO)
case MODE_Q2X2:
sub_protocol|=0x08; // Increase the number of sub_protocols for CX-10
case MODE_CX10:
next_callback=initCX10();
remote_callback = CX10_callback;
break;
#endif
#if defined(CG023_NRF24L01_INO)
case MODE_CG023:
next_callback=initCG023();
remote_callback = CG023_callback;
break;
#endif
#if defined(BAYANG_NRF24L01_INO)
case MODE_BAYANG:
next_callback=initBAYANG();
remote_callback = BAYANG_callback;
break;
#endif
#if defined(ESKY_NRF24L01_INO)
case MODE_ESKY:
next_callback=initESKY();
remote_callback = ESKY_callback;
break;
#endif
#if defined(MT99XX_NRF24L01_INO)
case MODE_MT99XX:
next_callback=initMT99XX();
remote_callback = MT99XX_callback;
break;
#endif
#if defined(MJXQ_NRF24L01_INO)
case MODE_MJXQ:
next_callback=initMJXQ();
remote_callback = MJXQ_callback;
break;
#endif
#if defined(SHENQI_NRF24L01_INO)
case MODE_SHENQI:
next_callback=initSHENQI();
remote_callback = SHENQI_callback;
break;
#endif
#if defined(FY326_NRF24L01_INO)
case MODE_FY326:
next_callback=initFY326();
remote_callback = FY326_callback;
break;
#endif
#if defined(FQ777_NRF24L01_INO)
case MODE_FQ777:
next_callback=initFQ777();
remote_callback = FQ777_callback;
break;
#endif
#if defined(ASSAN_NRF24L01_INO)
case MODE_ASSAN:
next_callback=initASSAN();
remote_callback = ASSAN_callback;
break;
#endif
#if defined(HONTAI_NRF24L01_INO)
case MODE_HONTAI:
next_callback=initHONTAI();
remote_callback = HONTAI_callback;
break;
#endif
#endif
}
}
#if defined(WAIT_FOR_BIND) && defined(ENABLE_BIND_CH)
if( IS_AUTOBIND_FLAG_on && ! ( IS_BIND_CH_PREV_on || IS_BIND_BUTTON_FLAG_on || (cur_protocol[1]&0x80)!=0 ) )
{
WAIT_BIND_on;
return;
}
#endif
WAIT_BIND_off;
CHANGE_PROTOCOL_FLAG_off;
if(next_callback>32000)
{ // next_callback should not be more than 32767 so we will wait here...
uint16_t temp=(next_callback>>10)-2;
@ -926,15 +1017,26 @@ void update_serial_data()
if( (rx_ok_buff[0] != cur_protocol[0]) || ((rx_ok_buff[1]&0x5F) != (cur_protocol[1]&0x5F)) || ( (rx_ok_buff[2]&0x7F) != (cur_protocol[2]&0x7F) ) )
{ // New model has been selected
CHANGE_PROTOCOL_FLAG_on; //change protocol
WAIT_BIND_off;
protocol=(rx_ok_buff[0]==0x55?0:32) + (rx_ok_buff[1]&0x1F); //protocol no (0-63) bits 4-6 of buff[1] and bit 0 of buf[0]
sub_protocol=(rx_ok_buff[2]>>4)& 0x07; //subprotocol no (0-7) bits 4-6
RX_num=rx_ok_buff[2]& 0x0F; // rx_num bits 0---3
}
else
if( ((rx_ok_buff[1]&0x80)!=0) && ((cur_protocol[1]&0x80)==0) ) // Bind flag has been set
if( ((rx_ok_buff[1]&0x80)!=0) && ((cur_protocol[1]&0x80)==0) ) // Bind flag has been set
CHANGE_PROTOCOL_FLAG_on; //restart protocol with bind
else
CHANGE_PROTOCOL_FLAG_off; //no need to restart
if( ((rx_ok_buff[1]&0x80)==0) && ((cur_protocol[1]&0x80)!=0) ) // Bind flag has been reset
{
#if defined(FRSKYD_CC2500_INO) || defined(FRSKYX_CC2500_INO) || defined(FRSKYV_CC2500_INO)
if(protocol==MODE_FRSKYD || protocol==MODE_FRSKYX || protocol==MODE_FRSKYV)
BIND_DONE;
else
#endif
if(bind_counter>2)
bind_counter=2;
}
//store current protocol values
for(uint8_t i=0;i<3;i++)
cur_protocol[i] = rx_ok_buff[i];
@ -1036,21 +1138,12 @@ void Mprotocol_serial_init()
#if defined(TELEMETRY)
void PPM_Telemetry_serial_init()
{
#ifdef MULTI_TELEMETRY
Mprotocol_serial_init();
#ifndef ORANGE_TX
#ifndef STM32_BOARD
UCSR0B &= ~(_BV(RXEN0)|_BV(RXCIE0));//rx disable and interrupt
#endif
#endif
#else
if( (protocol==MODE_FRSKYD) || (protocol==MODE_HUBSAN) || (protocol==MODE_AFHDS2A) || (protocol==MODE_BAYANG) )
initTXSerial( SPEED_9600 ) ;
if(protocol==MODE_FRSKYX)
initTXSerial( SPEED_57600 ) ;
if(protocol==MODE_DSM)
initTXSerial( SPEED_125K ) ;
#endif
if( (protocol==MODE_FRSKYD) || (protocol==MODE_HUBSAN) || (protocol==MODE_AFHDS2A) || (protocol==MODE_BAYANG) )
initTXSerial( SPEED_9600 ) ;
if(protocol==MODE_FRSKYX)
initTXSerial( SPEED_57600 ) ;
if(protocol==MODE_DSM)
initTXSerial( SPEED_125K ) ;
}
#endif
@ -1081,35 +1174,41 @@ static uint32_t random_value(void)
}
#endif
static uint32_t random_id(uint16_t adress, uint8_t create_new)
static uint32_t random_id(uint16_t address, uint8_t create_new)
{
uint32_t id=0;
#ifndef FORCE_GLOBAL_ID
uint32_t id=0;
if(eeprom_read_byte((EE_ADDR)(adress+10))==0xf0 && !create_new)
{ // TXID exists in EEPROM
for(uint8_t i=4;i>0;i--)
if(eeprom_read_byte((EE_ADDR)(address+10))==0xf0 && !create_new)
{ // TXID exists in EEPROM
for(uint8_t i=4;i>0;i--)
{
id<<=8;
id|=eeprom_read_byte((EE_ADDR)address+i-1);
}
if(id!=0x2AD141A7) //ID with seed=0
return id;
}
// Generate a random ID
#if defined STM32_BOARD
#define STM32_UUID ((uint32_t *)0x1FFFF7E8)
if (!create_new)
id = STM32_UUID[0] ^ STM32_UUID[1] ^ STM32_UUID[2];
#else
id = random(0xfefefefe) + ((uint32_t)random(0xfefefefe) << 16);
#endif
for(uint8_t i=0;i<4;i++)
{
id<<=8;
id|=eeprom_read_byte((EE_ADDR)adress+i-1);
eeprom_write_byte((EE_ADDR)address+i,id);
id>>=8;
}
if(id!=0x2AD141A7) //ID with seed=0
return id;
}
// Generate a random ID
#if defined STM32_BOARD
#define STM32_UUID ((uint32_t *)0x1FFFF7E8)
if (!create_new)
id = STM32_UUID[0] ^ STM32_UUID[1] ^ STM32_UUID[2];
eeprom_write_byte((EE_ADDR)(address+10),0xf0);//write bind flag in eeprom.
return id;
#else
id = random(0xfefefefe) + ((uint32_t)random(0xfefefefe) << 16);
(void)address;
(void)create_new;
return FORCE_GLOBAL_ID;
#endif
for(uint8_t i=0;i<4;i++)
{
eeprom_write_byte((EE_ADDR)adress+i,id);
id>>=8;
}
eeprom_write_byte((EE_ADDR)(adress+10),0xf0);//write bind flag in eeprom.
return id;
}
/**************************/
@ -1146,7 +1245,7 @@ static uint32_t random_id(uint16_t adress, uint8_t create_new)
else
if(Cur_TCNT1>4840)
{ //start of frame
if(chan>3)
if(chan>=MIN_PPM_CHANNELS)
PPM_FLAG_on; // good frame received if at least 4 channels have been seen
chan=0; // reset channel counter
bad_frame=0;
@ -1155,7 +1254,7 @@ static uint32_t random_id(uint16_t adress, uint8_t create_new)
if(bad_frame==0) // need to wait for start of frame
{ //servo values between 500us and 2420us will end up here
PPM_data[chan]= Cur_TCNT1>>1;;
if(chan++>=NUM_CHN)
if(chan++>=MAX_PPM_CHANNELS)
bad_frame=1; // don't accept any new channels
}
Prev_TCNT1+=Cur_TCNT1;

View File

@ -160,7 +160,11 @@ void NRF24L01_SetPower()
{
uint8_t power=NRF_BIND_POWER;
if(IS_BIND_DONE_on)
power=IS_POWER_FLAG_on?NRF_HIGH_POWER:NRF_LOW_POWER;
#ifdef NRF24L01_ENABLE_LOW_POWER
power=IS_POWER_FLAG_on?NRF_HIGH_POWER:NRF_LOW_POWER;
#else
power=NRF_HIGH_POWER;
#endif
if(IS_RANGE_FLAG_on)
power=NRF_POWER_0;
rf_setup = (rf_setup & 0xF9) | (power << 1);
@ -278,10 +282,10 @@ static uint8_t bit_reverse(uint8_t b_in)
}
static const uint16_t polynomial = 0x1021;
static uint16_t crc16_update(uint16_t crc, uint8_t a)
static uint16_t crc16_update(uint16_t crc, uint8_t a, uint8_t bits)
{
crc ^= a << 8;
for (uint8_t i = 0; i < 8; ++i)
while(bits--)
if (crc & 0x8000)
crc = (crc << 1) ^ polynomial;
else
@ -370,7 +374,7 @@ void XN297_WritePayload(uint8_t* msg, uint8_t len)
uint8_t offset = xn297_addr_len < 4 ? 1 : 0;
uint16_t crc = 0xb5d2;
for (uint8_t i = offset; i < last; ++i)
crc = crc16_update(crc, buf[i]);
crc = crc16_update(crc, buf[i], 8);
if(xn297_scramble_enabled)
crc ^= pgm_read_word(&xn297_crc_xorout_scrambled[xn297_addr_len - 3 + len]);
else
@ -381,6 +385,76 @@ void XN297_WritePayload(uint8_t* msg, uint8_t len)
NRF24L01_WritePayload(buf, last);
}
void XN297_WriteEnhancedPayload(uint8_t* msg, uint8_t len, uint8_t noack, uint16_t crc_xorout)
{
uint8_t packet[32];
uint8_t scramble_index=0;
uint8_t last = 0;
static uint8_t pid=0;
// address
if (xn297_addr_len < 4)
{
// If address length (which is defined by receive address length)
// is less than 4 the TX address can't fit the preamble, so the last
// byte goes here
packet[last++] = 0x55;
}
for (uint8_t i = 0; i < xn297_addr_len; ++i)
{
packet[last] = xn297_tx_addr[xn297_addr_len-i-1];
if(xn297_scramble_enabled)
packet[last] ^= xn297_scramble[scramble_index++];
last++;
}
// pcf
packet[last] = (len << 1) | (pid>>1);
if(xn297_scramble_enabled)
packet[last] ^= xn297_scramble[scramble_index++];
last++;
packet[last] = (pid << 7) | (noack << 6);
// payload
packet[last]|= bit_reverse(msg[0]) >> 2; // first 6 bit of payload
if(xn297_scramble_enabled)
packet[last] ^= xn297_scramble[scramble_index++];
for (uint8_t i = 0; i < len-1; ++i)
{
last++;
packet[last] = (bit_reverse(msg[i]) << 6) | (bit_reverse(msg[i+1]) >> 2);
if(xn297_scramble_enabled)
packet[last] ^= xn297_scramble[scramble_index++];
}
last++;
packet[last] = bit_reverse(msg[len-1]) << 6; // last 2 bit of payload
if(xn297_scramble_enabled)
packet[last] ^= xn297_scramble[scramble_index++] & 0xc0;
// crc
if (xn297_crc)
{
uint8_t offset = xn297_addr_len < 4 ? 1 : 0;
uint16_t crc = 0xb5d2;
for (uint8_t i = offset; i < last; ++i)
crc = crc16_update(crc, packet[i], 8);
crc = crc16_update(crc, packet[last] & 0xc0, 2);
crc ^= crc_xorout;
packet[last++] |= (crc >> 8) >> 2;
packet[last++] = ((crc >> 8) << 6) | ((crc & 0xff) >> 2);
packet[last++] = (crc & 0xff) << 6;
}
NRF24L01_WritePayload(packet, last);
pid++;
if(pid>3)
pid=0;
}
void XN297_ReadPayload(uint8_t* msg, uint8_t len)
{
// TODO: if xn297_crc==1, check CRC before filling *msg
@ -393,7 +467,26 @@ void XN297_ReadPayload(uint8_t* msg, uint8_t len)
}
}
// End of XN297 emulation
uint8_t XN297_ReadEnhancedPayload(uint8_t* msg, uint8_t len)
{
uint8_t buffer[32];
uint8_t pcf_size; // pcf payload size
NRF24L01_ReadPayload(buffer, len+2); // pcf + payload
pcf_size = buffer[0];
if(xn297_scramble_enabled)
pcf_size ^= xn297_scramble[xn297_addr_len];
pcf_size = pcf_size >> 1;
for(int i=0; i<len; i++)
{
msg[i] = bit_reverse((buffer[i+1] << 2) | (buffer[i+2] >> 6));
if(xn297_scramble_enabled)
msg[i] ^= bit_reverse((xn297_scramble[xn297_addr_len+i+1] << 2) |
(xn297_scramble[xn297_addr_len+i+2] >> 6));
}
return pcf_size;
}
// End of XN297 emulation
///////////////
// LT8900 emulation layer
@ -527,14 +620,14 @@ uint8_t LT8900_ReadPayload(uint8_t* msg, uint8_t len)
//Check len
if(LT8900_Flags&_BV(LT8900_PACKET_LENGTH_EN))
{
crc=crc16_update(crc,buffer[pos]);
crc=crc16_update(crc,buffer[pos],8);
if(bit_reverse(len)!=buffer[pos++])
return 0; // wrong len...
}
//Decode message
for(i=0;i<len;i++)
{
crc=crc16_update(crc,buffer[pos]);
crc=crc16_update(crc,buffer[pos],8);
msg[i]=bit_reverse(buffer[pos++]);
}
//Check CRC
@ -556,14 +649,14 @@ void LT8900_WritePayload(uint8_t* msg, uint8_t len)
{
tmp=bit_reverse(len);
buffer[pos++]=tmp;
crc=crc16_update(crc,tmp);
crc=crc16_update(crc,tmp,8);
}
//Add payload
for(i=0;i<len;i++)
{
tmp=bit_reverse(msg[i]);
buffer[pos++]=tmp;
crc=crc16_update(crc,tmp);
crc=crc16_update(crc,tmp,8);
}
//Add CRC
if(LT8900_Flags&_BV(LT8900_CRC_ON))

View File

@ -0,0 +1,409 @@
/*
This project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Multiprotocol is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
*/
#if defined(Q303_NRF24L01_INO)
#include "iface_nrf24l01.h"
#define Q303_BIND_COUNT 1500
#define Q303_INITIAL_WAIT 500
#define Q303_RF_BIND_CHANNEL 0x02
#define Q303_BTN_TAKEOFF 1
#define Q303_BTN_DESCEND 2
#define Q303_BTN_SNAPSHOT 4
#define Q303_BTN_VIDEO 8
#define Q303_BTN_RTH 16
#define Q303_BTN_VTX 32
static uint8_t __attribute__((unused)) cx10wd_getButtons()
{
#define CX10WD_FLAG_LAND 0x20
#define CX10D_FLAG_LAND 0x80
#define CX10WD_FLAG_TAKEOFF 0x40
static uint8_t BTN_state;
static uint8_t command;
// startup
if(packet_count < 50)
{
BTN_state = 0;
command = 0;
packet_count++;
}
// auto land
else if((Servo_data[AUX1] < PPM_MIN_COMMAND) && !(BTN_state & Q303_BTN_DESCEND))
{
BTN_state |= Q303_BTN_DESCEND;
BTN_state &= ~Q303_BTN_TAKEOFF;
switch(sub_protocol)
{
case CX10WD:
command ^= CX10WD_FLAG_LAND;
break;
case CX10D:
command ^= CX10D_FLAG_LAND;
break;
}
}
// auto take off
else if(Servo_AUX1 && !(BTN_state & Q303_BTN_TAKEOFF))
{
BTN_state |= Q303_BTN_TAKEOFF;
BTN_state &= ~Q303_BTN_DESCEND;
command ^= CX10WD_FLAG_TAKEOFF;
}
return command;
}
static uint8_t __attribute__((unused)) cx35_lastButton()
{
#define CX35_CMD_RATE 0x09
#define CX35_CMD_TAKEOFF 0x0e
#define CX35_CMD_DESCEND 0x0f
#define CX35_CMD_SNAPSHOT 0x0b
#define CX35_CMD_VIDEO 0x0c
#define CX35_CMD_RTH 0x11
#define CX35_CMD_VTX 0x10
static uint8_t BTN_state;
static uint8_t command;
// simulate 2 keypress on rate button just after bind
if(packet_count < 50)
{
BTN_state = 0;
packet_count++;
command = 0x00; // startup
}
else if(packet_count < 150)
{
packet_count++;
command = CX35_CMD_RATE; // 1st keypress
}
else if(packet_count < 250)
{
packet_count++;
command |= 0x20; // 2nd keypress
}
// descend
else if(!(GET_FLAG(Servo_AUX1, 1)) && !(BTN_state & Q303_BTN_DESCEND))
{
BTN_state |= Q303_BTN_DESCEND;
BTN_state &= ~Q303_BTN_TAKEOFF;
command = CX35_CMD_DESCEND;
}
// take off
else if(GET_FLAG(Servo_AUX1,1) && !(BTN_state & Q303_BTN_TAKEOFF))
{
BTN_state |= Q303_BTN_TAKEOFF;
BTN_state &= ~Q303_BTN_DESCEND;
command = CX35_CMD_TAKEOFF;
}
// RTH
else if(GET_FLAG(Servo_AUX6,1) && !(BTN_state & Q303_BTN_RTH))
{
BTN_state |= Q303_BTN_RTH;
if(command == CX35_CMD_RTH)
command |= 0x20;
else
command = CX35_CMD_RTH;
}
else if(!(GET_FLAG(Servo_AUX6,1)) && (BTN_state & Q303_BTN_RTH))
{
BTN_state &= ~Q303_BTN_RTH;
if(command == CX35_CMD_RTH)
command |= 0x20;
else
command = CX35_CMD_RTH;
}
// video
else if(GET_FLAG(Servo_AUX4,1) && !(BTN_state & Q303_BTN_VIDEO))
{
BTN_state |= Q303_BTN_VIDEO;
if(command == CX35_CMD_VIDEO)
command |= 0x20;
else
command = CX35_CMD_VIDEO;
}
else if(!(GET_FLAG(Servo_AUX4,1)) && (BTN_state & Q303_BTN_VIDEO))
{
BTN_state &= ~Q303_BTN_VIDEO;
if(command == CX35_CMD_VIDEO)
command |= 0x20;
else
command = CX35_CMD_VIDEO;
}
// snapshot
else if(GET_FLAG(Servo_AUX3,1) && !(BTN_state & Q303_BTN_SNAPSHOT))
{
BTN_state |= Q303_BTN_SNAPSHOT;
if(command == CX35_CMD_SNAPSHOT)
command |= 0x20;
else
command = CX35_CMD_SNAPSHOT;
}
// vtx channel
else if(GET_FLAG(Servo_AUX2,1) && !(BTN_state & Q303_BTN_VTX))
{
BTN_state |= Q303_BTN_VTX;
if(command == CX35_CMD_VTX)
command |= 0x20;
else
command = CX35_CMD_VTX;
}
if(!(GET_FLAG(Servo_AUX3,1)))
BTN_state &= ~Q303_BTN_SNAPSHOT;
if(!(GET_FLAG(Servo_AUX2,1)))
BTN_state &= ~Q303_BTN_VTX;
return command;
}
static void __attribute__((unused)) Q303_send_packet(uint8_t bind)
{
uint16_t aileron, elevator, throttle, rudder, slider;
if(bind)
{
packet[0] = 0xaa;
memcpy(&packet[1], rx_tx_addr + 1, 4);
memset(&packet[5], 0, packet_length-5);
}
else
{
packet[0] = 0x55;
// sticks
switch(sub_protocol)
{
case Q303:
case CX35:
aileron = convert_channel_16b(AILERON, 0, 1000);
elevator = convert_channel_16b(ELEVATOR, 1000, 0);
throttle = convert_channel_16b(THROTTLE, 0, 1000);
rudder = convert_channel_16b(RUDDER, 1000, 0);
if(sub_protocol == CX35)
aileron = 1000 - aileron;
packet[1] = aileron >> 2; // 8 bits
packet[2] = (aileron & 0x03) << 6 // 2 bits
| (elevator >> 4); // 6 bits
packet[3] = (elevator & 0x0f) << 4 // 4 bits
| (throttle >> 6); // 4 bits
packet[4] = (throttle & 0x3f) << 2 // 6 bits
| (rudder >> 8); // 2 bits
packet[5] = rudder & 0xff; // 8 bits
break;
case CX10D:
case CX10WD:
aileron = convert_channel_16b(AILERON, 2000, 1000);
elevator = convert_channel_16b(ELEVATOR, 2000, 1000);
throttle = convert_channel_16b(THROTTLE, 1000, 2000);
rudder = convert_channel_16b(RUDDER, 1000, 2000);
packet[1] = aileron & 0xff;
packet[2] = aileron >> 8;
packet[3] = elevator & 0xff;
packet[4] = elevator >> 8;
packet[5] = throttle & 0xff;
packet[6] = throttle >> 8;
packet[7] = rudder & 0xff;
packet[8] = rudder >> 8;
break;
}
// buttons
switch(sub_protocol)
{
case Q303:
packet[6] = 0x10; // trim(s) ?
packet[7] = 0x10; // trim(s) ?
packet[8] = 0x03 // high rate (0-3)
| GET_FLAG(Servo_AUX1, 0x40)
| GET_FLAG(Servo_AUX6, 0x80);
packet[9] = 0x40 // always set
| GET_FLAG(Servo_AUX5,0x08)
| GET_FLAG(Servo_AUX2, 0x80)
| GET_FLAG(Servo_AUX3,0x10)
| GET_FLAG(Servo_AUX4, 0x01);
if(Servo_data[AUX7] < PPM_MIN_COMMAND)
packet[9] |= 0x04; // gimbal down
else if(Servo_data[AUX7] > PPM_MAX_COMMAND)
packet[9] |= 0x20; // gimbal up
break;
case CX35:
slider = convert_channel_16b(AUX7, 731, 342);
packet[6] = slider >> 2;
packet[7] = ((slider & 3) << 6)
| 0x3e; // ?? 6 bit left (always 111110 ?)
packet[8] = 0x80; // always set
packet[9] = cx35_lastButton();
break;
case CX10D:
packet[8] |= GET_FLAG(Servo_AUX2, 0x10);
packet[9] = 0x02; // rate (0-2)
packet[10]= cx10wd_getButtons(); // auto land / take off management
break;
case CX10WD:
packet[8] |= GET_FLAG(Servo_AUX2, 0x10);
packet[9] = 0x02 // rate (0-2)
| cx10wd_getButtons(); // auto land / take off management
packet[10] = 0x00;
break;
}
}
// Power on, TX mode, CRC enabled
XN297_Configure(_BV(NRF24L01_00_EN_CRC) | _BV(NRF24L01_00_CRCO) | _BV(NRF24L01_00_PWR_UP));
NRF24L01_WriteReg(NRF24L01_05_RF_CH, bind ? Q303_RF_BIND_CHANNEL : hopping_frequency[hopping_frequency_no++]);
hopping_frequency_no %= rf_ch_num;
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70);
NRF24L01_FlushTx();
XN297_WritePayload(packet, packet_length);
NRF24L01_SetPower(); // Set tx_power
}
static void __attribute__((unused)) Q303_init()
{
const uint8_t bind_address[] = {0xcc,0xcc,0xcc,0xcc,0xcc};
NRF24L01_Initialize();
NRF24L01_SetTxRxMode(TX_EN);
switch(sub_protocol)
{
case CX35:
case CX10D:
case CX10WD:
XN297_SetScrambledMode(XN297_SCRAMBLED);
NRF24L01_SetBitrate(NRF24L01_BR_1M);
break;
case Q303:
XN297_SetScrambledMode(XN297_UNSCRAMBLED);
NRF24L01_SetBitrate(NRF24L01_BR_250K);
break;
}
XN297_SetTXAddr(bind_address, 5);
NRF24L01_FlushTx();
NRF24L01_FlushRx();
NRF24L01_WriteReg(NRF24L01_07_STATUS, 0x70); // Clear data ready, data sent, and retransmit
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No Auto Acknowldgement on all data pipes
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, 0x01);
NRF24L01_WriteReg(NRF24L01_03_SETUP_AW, 0x03);
NRF24L01_WriteReg(NRF24L01_04_SETUP_RETR, 0x00); // no retransmits
NRF24L01_SetPower();
NRF24L01_Activate(0x73); // Activate feature register
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
NRF24L01_WriteReg(NRF24L01_1D_FEATURE, 0x01); // Set feature bits on
NRF24L01_Activate(0x73);
}
static void __attribute__((unused)) Q303_initialize_txid()
{
uint8_t i,offset;
rx_tx_addr[0] = 0x55;
switch(sub_protocol)
{
case Q303:
case CX10WD:
offset = rx_tx_addr[1] & 3;
for(i=0; i<4; i++)
hopping_frequency[i] = 0x46 + i*2 + offset;
break;
case CX35:
case CX10D:
// not thoroughly figured out rx_tx_addr/channels mapping yet
// for now 5 msb of rx_tx_addr[1] must be cleared
rx_tx_addr[1] &= 7;
offset = 6+(rx_tx_addr[1]*3);
hopping_frequency[0] = 0x14; // works only if rx_tx_addr[1] < 8
for(i=1; i<16; i++)
{
hopping_frequency[i] = hopping_frequency[i-1] + offset;
if(hopping_frequency[i] > 0x41)
hopping_frequency[i] -= 0x33;
if(hopping_frequency[i] < 0x14)
hopping_frequency[i] += offset;
}
// CX35 tx uses only 4 of those channels (#0,3,6,9)
if(sub_protocol == CX35)
for(i=0; i<4; i++)
hopping_frequency[i] = hopping_frequency[i*3];
break;
}
}
uint16_t Q303_callback()
{
if(IS_BIND_DONE_on)
Q303_send_packet(0);
else
{
if (bind_counter == 0)
{
XN297_SetTXAddr(rx_tx_addr, 5);
packet_count = 0;
BIND_DONE;
}
else
{
Q303_send_packet(1);
bind_counter--;
}
}
return packet_period;
}
uint16_t initQ303()
{
Q303_initialize_txid();
Q303_init();
bind_counter = Q303_BIND_COUNT;
switch(sub_protocol)
{
case Q303:
packet_period = 1500;
packet_length = 10;
rf_ch_num = 4;
break;
case CX35:
packet_period = 3000;
packet_length = 10;
rf_ch_num = 4;
break;
case CX10D:
packet_period = 3000;
packet_length = 11;
rf_ch_num = 16;
break;
case CX10WD:
packet_period = 3000;
packet_length = 11;
rf_ch_num = 4;
break;
}
hopping_frequency_no = 0;
BIND_IN_PROGRESS; // autobind protocol
return Q303_INITIAL_WAIT;
}
#endif

View File

@ -122,22 +122,17 @@ static void __attribute__((unused)) SFHSS_calc_next_chan()
}
}
// Channel values are 10-bit values between 86 and 906, 496 is the middle.
// Values grow down and to the right, so we just revert every channel.
static uint16_t __attribute__((unused)) SFHSS_convert_channel(uint8_t num)
{
return (uint16_t) (map(limit_channel_100(num),servo_min_100,servo_max_100,906,86));
}
/*// Channel values are 10-bit values between 86 and 906, 496 is the middle.
// Values grow down and to the right.
static void __attribute__((unused)) SFHSS_build_data_packet()
{
#define spacer1 0x02 //0b10
#define spacer1 0x02
#define spacer2 (spacer1 << 4)
uint8_t ch_offset = phase == SFHSS_DATA1 ? 0 : 4;
uint16_t ch1 = SFHSS_convert_channel(CH_AETR[ch_offset+0]);
uint16_t ch2 = SFHSS_convert_channel(CH_AETR[ch_offset+1]);
uint16_t ch3 = SFHSS_convert_channel(CH_AETR[ch_offset+2]);
uint16_t ch4 = SFHSS_convert_channel(CH_AETR[ch_offset+3]);
uint16_t ch1 = convert_channel_16b_nolim(CH_AETR[ch_offset+0],86,906);
uint16_t ch2 = convert_channel_16b_nolim(CH_AETR[ch_offset+1],86,906);
uint16_t ch3 = convert_channel_16b_nolim(CH_AETR[ch_offset+2],86,906);
uint16_t ch4 = convert_channel_16b_nolim(CH_AETR[ch_offset+3],86,906);
packet[0] = 0x81; // can be 80 or 81 for Orange, only 81 for XK
packet[1] = rx_tx_addr[0];
@ -146,13 +141,40 @@ static void __attribute__((unused)) SFHSS_build_data_packet()
packet[4] = 0;
packet[5] = (rf_ch_num << 3) | spacer1 | ((ch1 >> 9) & 0x01);
packet[6] = (ch1 >> 1);
packet[7] = (ch1 << 7) | spacer2 | ((ch2 >> 5) & 0x1F /*0b11111*/);
packet[7] = (ch1 << 7) | spacer2 | ((ch2 >> 5) & 0x1F);
packet[8] = (ch2 << 3) | spacer1 | ((ch3 >> 9) & 0x01);
packet[9] = (ch3 >> 1);
packet[10] = (ch3 << 7) | spacer2 | ((ch4 >> 5) & 0x1F /*0b11111*/);
packet[11] = (ch4 << 3) | ((fhss_code >> 2) & 0x07 /*0b111 */);
packet[10] = (ch3 << 7) | spacer2 | ((ch4 >> 5) & 0x1F);
packet[11] = (ch4 << 3) | ((fhss_code >> 2) & 0x07);
packet[12] = (fhss_code << 6) | phase;
}
*/
// Channel values are 12-bit values between 1020 and 2020, 1520 is the middle.
// Futaba @140% is 2070...1520...970
// Values grow down and to the right.
static void __attribute__((unused)) SFHSS_build_data_packet()
{
uint8_t ch_offset = phase == SFHSS_DATA1 ? 0 : 4;
uint16_t ch1 = convert_channel_16b_nolim(CH_AETR[ch_offset+0],2020,1020);
uint16_t ch2 = convert_channel_16b_nolim(CH_AETR[ch_offset+1],2020,1020);
uint16_t ch3 = convert_channel_16b_nolim(CH_AETR[ch_offset+2],2020,1020);
uint16_t ch4 = convert_channel_16b_nolim(CH_AETR[ch_offset+3],2020,1020);
packet[0] = 0x81; // can be 80 or 81 for Orange, only 81 for XK
packet[1] = rx_tx_addr[0];
packet[2] = rx_tx_addr[1];
packet[3] = 0x0f; //10J
packet[4] = 0x09; //10J
packet[5] = (rf_ch_num << 3) | ((ch1 >> 9) & 0x07);
packet[6] = (ch1 >> 1);
packet[7] = (ch1 << 7) | ((ch2 >> 5) & 0x7F );
packet[8] = (ch2 << 3) | ((ch3 >> 9) & 0x07);
packet[9] = (ch3 >> 1);
packet[10] = (ch3 << 7) | ((ch4 >> 5) & 0x7F );
packet[11] = (ch4 << 3) | ((fhss_code >> 2) & 0x07 );
packet[12] = (fhss_code << 6) | phase;
}
static void __attribute__((unused)) SFHSS_send_packet()
{

View File

@ -20,20 +20,15 @@
// For code readability
#define SLT_PAYLOADSIZE 7
#define SLT_VISTA_PAYLOADSIZE 11
#define SLT_NFREQCHANNELS 15
#define SLT_TXID_SIZE 4
enum {
// flags going to packet[6]
SLT_VISTA_FLAG_FLIP = 0x04,
SLT_VISTA_FLAG_MODE = 0x20
};
enum {
SLT_BIND=0,
SLT_BUILD,
SLT_DATA,
SLT_BUILD=0,
SLT_DATA1,
SLT_DATA2,
SLT_DATA3,
SLT_BIND
};
static void __attribute__((unused)) SLT_init()
@ -108,37 +103,24 @@ static void __attribute__((unused)) SLT_send_data(uint8_t *data, uint8_t len)
static void __attribute__((unused)) SLT_build_packet()
{
// aileron, elevator, throttle, rudder, gear, pitch
// Set radio channel - once per packet batch
NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency[hopping_frequency_no]);
if (++hopping_frequency_no >= SLT_NFREQCHANNELS)
hopping_frequency_no = 0;
// aileron, elevator, throttle, rudder, gear, pitch
uint8_t e = 0; // byte where extension 2 bits for every 10-bit channel are packed
for (uint8_t i = 0; i < 4; ++i)
{
uint16_t v = convert_channel_10b(CH_AETR[i]);
if(sub_protocol==VISTA && CH_AETR[i]==THROTTLE)
v = (uint16_t) map(limit_channel_100(THROTTLE),servo_min_100,servo_max_100,850,150); // Throttel is between 850=0% and 150=100%
packet[i] = v;
e = (e >> 2) | (uint8_t) ((v >> 2) & 0xC0);
}
// Extra bits for AETR
packet[4] = e;
if(sub_protocol==SLT)
{
// 8-bit channels
packet[5] = convert_channel_8b(AUX1);
packet[6] = convert_channel_8b(AUX2);
}
else
{ // VISTA
packet[5] = 0xA6;
packet[6] = 0x00;
if(Servo_AUX1)
packet[6] = SLT_VISTA_FLAG_FLIP;
if(Servo_AUX2)
packet[6] |= SLT_VISTA_FLAG_MODE;
packet[7] = 0x00;
packet[8] = 0x7F;
packet[9] = 0xAA;
packet[10] = 0x00;
}
// 8-bit channels
packet[5] = convert_channel_8b(AUX1);
packet[6] = convert_channel_8b(AUX2);
}
static void __attribute__((unused)) SLT_send_bind_packet()
@ -162,83 +144,47 @@ uint16_t SLT_callback()
{
switch (phase)
{
case SLT_BIND:
bind_phase = 0;
SLT_send_bind_packet();
if(sub_protocol == VISTA)
case SLT_BUILD:
SLT_build_packet();
phase++;
return 1000;
case SLT_DATA1:
SLT_send_data(packet, SLT_PAYLOADSIZE);
phase++;
return 1000;
case SLT_DATA2:
SLT_send_data(packet, SLT_PAYLOADSIZE);
phase++;
return 1000;
case SLT_DATA3:
SLT_send_data(packet, SLT_PAYLOADSIZE);
if (++packet_count >= 100)
{
phase=SLT_DATA;
packet_count = 0;
phase++;
return 1000;
}
phase++; // SLT_BUILD
return 18000;
case SLT_BUILD:
if(sub_protocol==SLT)
{ // Set radio channel - once per packet batch
NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency[hopping_frequency_no]);
if (++hopping_frequency_no >= SLT_NFREQCHANNELS)
hopping_frequency_no = 0;
}
SLT_build_packet();
packet_count=0;
phase++; // SLT_DATA
return 1000;
case SLT_DATA:
if(sub_protocol==VISTA)
{ // Change radio channel every 9 packets
NRF24L01_WriteReg(NRF24L01_05_RF_CH, hopping_frequency[hopping_frequency_no]);
rf_ch_num++;
if(rf_ch_num>=9)
{
if (++hopping_frequency_no >= SLT_NFREQCHANNELS)
hopping_frequency_no = 0;
rf_ch_num=0;
}
}
SLT_send_data(packet, sub_protocol == VISTA?SLT_VISTA_PAYLOADSIZE:SLT_PAYLOADSIZE);
packet_count++;
if(packet_count >= (sub_protocol == VISTA?5:3))
{ // repeat the same data packet 3(SLT) or 5(VISTA) times
bind_phase++;
else
{
NRF24L01_SetPower(); // Set tx_power
phase = SLT_BUILD; // Refresh data
if(sub_protocol == VISTA)
return 1000;
else
if(bind_phase>=100)
{ //SLT sends bind packet every 2.2s
phase=SLT_BIND;
return 1000;
}
phase = SLT_BUILD;
return 19000;
}
if(sub_protocol == VISTA)
{ //VISTA sends bind packet every 1.5s
if(bind_phase>=150)
phase=SLT_BIND;
else
return 2000;
}
return 1000;
case SLT_BIND:
SLT_send_bind_packet();
phase = SLT_BUILD;
return 18000;
}
return 1000;
return 19000;
}
uint16_t initSLT()
{
packet_count = 0;
packet_sent = 0;
rf_ch_num=0;
hopping_frequency_no = 0;
if(sub_protocol == VISTA)
{
memcpy(rx_tx_addr,"\x00\x00\x23\x00",SLT_TXID_SIZE);
memcpy(hopping_frequency,"\x03\x0A\x11\x18\x1F\x26\x13\x0F\x0B\x10\x08\x16\x1D\x24\x06",15);
}
else
SLT_set_freq();
SLT_set_freq();
SLT_init();
SLT_build_packet();
phase = SLT_BIND;
return 50000;
}

View File

@ -319,12 +319,12 @@ uint16_t symax_callback()
return SYMAX_FIRST_PACKET_DELAY;
break;
case SYMAX_BIND2:
counter = SYMAX_BIND_COUNT;
bind_counter = SYMAX_BIND_COUNT;
phase = SYMAX_BIND3;
SYMAX_send_packet(1);
break;
case SYMAX_BIND3:
if (counter == 0)
if (bind_counter == 0)
{
symax_init2();
phase = SYMAX_DATA;
@ -333,7 +333,7 @@ uint16_t symax_callback()
else
{
SYMAX_send_packet(1);
counter--;
bind_counter--;
}
break;
case SYMAX_DATA:

View File

@ -10,8 +10,8 @@
#if defined(TX_DEVO7)
#define PPM_MAX_100 1920 // 100%
#define PPM_MIN_100 1120 // 100%
#define PPM_MAX_125 2100 // 125%
#define PPM_MIN_125 900 // 125%
#define PPM_MAX_125 2120 // 125%
#define PPM_MIN_125 920 // 125%
#endif
// SPEKTRUM PPM and channels
@ -24,10 +24,10 @@
// HISKY
#if defined(TX_HISKY)
#define PPM_MAX_100 1900 // 100%
#define PPM_MIN_100 1100 // 100%
#define PPM_MAX_125 2000 // 125%
#define PPM_MIN_125 1000 // 125%
#define PPM_MAX_100 1920 // 100%
#define PPM_MIN_100 1120 // 100%
#define PPM_MAX_125 2020 // 125%
#define PPM_MIN_125 1020 // 125%
#endif
// Multiplex MC2020
@ -38,6 +38,14 @@
#define PPM_MIN_125 1150 // 125%
#endif
// Walkera PL0811-01H
#if defined(TX_WALKERA)
#define PPM_MAX_100 1800 // 100%
#define PPM_MIN_100 1000 // 100%
#define PPM_MAX_125 1900 // 125%
#define PPM_MIN_125 900 // 125%
#endif
//Serial MIN MAX values
#define SERIAL_MAX_100 2012 // 100%
#define SERIAL_MIN_100 988 // 100%

View File

@ -17,8 +17,10 @@
//**************************
#if defined TELEMETRY
#if defined MULTI_TELEMETRY
#define MULTI_TIME 250 //in ms
uint8_t RetrySequence ;
#if ( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) )
#define MULTI_TIME 500 //in ms
uint32_t lastMulti = 0;
#endif
@ -28,7 +30,6 @@
uint32_t last = 0;
uint8_t sport_counter=0;
uint8_t RxBt = 0;
uint8_t rssi;
uint8_t sport = 0;
#endif
#if defined HUB_TELEMETRY
@ -45,32 +46,17 @@ uint8_t pktx1[MAX_PKTX];
uint8_t indx;
uint8_t frame[18];
#ifdef BASH_SERIAL
// For bit-bashed serial output
volatile struct t_serial_bash
{
uint8_t head ;
uint8_t tail ;
uint8_t data[64] ;
uint8_t busy ;
uint8_t speed ;
} SerialControl ;
#endif
#ifdef MULTI_TELEMETRY
#if ( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) )
static void multi_send_header(uint8_t type, uint8_t len)
{
Serial_write('M');
Serial_write('P');
Serial_write(type);
Serial_write(len);
}
static void multi_send_frskyhub()
{
multi_send_header(MULTI_TELEMETRY_HUB, 9);
for (uint8_t i = 0; i < 9; i++)
Serial_write(frame[i]);
Serial_write('M');
#ifdef MULTI_TELEMETRY
Serial_write('P');
Serial_write(type);
#else
(void)type;
#endif
Serial_write(len);
}
static void multi_send_status()
@ -84,9 +70,14 @@ static void multi_send_status()
if (mode_select==MODE_SERIAL)
flags |= 0x02;
if (remote_callback != 0)
flags |= 0x04;
if (!IS_BIND_DONE_on)
flags |= 0x08;
{
flags |= 0x04;
if (IS_WAIT_BIND_on)
flags |= 0x10;
else
if (!IS_BIND_DONE_on)
flags |= 0x08;
}
Serial_write(flags);
// Version number example: 1.1.6.1
@ -138,6 +129,15 @@ static void multi_send_status()
}
#endif
#ifdef MULTI_TELEMETRY
static void multi_send_frskyhub()
{
multi_send_header(MULTI_TELEMETRY_HUB, 9);
for (uint8_t i = 0; i < 9; i++)
Serial_write(frame[i]);
}
#endif
void frskySendStuffed()
{
Serial_write(START_STOP);
@ -153,25 +153,53 @@ void frskySendStuffed()
Serial_write(START_STOP);
}
void compute_RSSIdbm()
{
RSSI_dBm = (((uint16_t)(pktt[len-2])*18)>>4);
if(pktt[len-2] >=128)
RSSI_dBm -= 164;
else
RSSI_dBm += 130;
}
void frsky_check_telemetry(uint8_t *pkt,uint8_t len)
{
if(pkt[1] == rx_tx_addr[3] && pkt[2] == rx_tx_addr[2] && len ==(pkt[0] + 3))
{
for (uint8_t i=3;i<len;i++)
pktt[i]=pkt[i];
telemetry_link=1;
if(pktt[6])
telemetry_counter=(telemetry_counter+1)%32;
telemetry_link|=1; // Telemetry data is available
/*previous version
RSSI_dBm = (((uint16_t)(pktt[len-2])*18)>>4);
if(pktt[len-2] >=128) RSSI_dBm -= 164;
else RSSI_dBm += 130;*/
TX_RSSI = pkt[len-2];
if(TX_RSSI >=128)
TX_RSSI -= 128;
else
TX_RSSI += 128;
TX_LQI = pkt[len-1]&0x7F;
for (uint8_t i=3;i<len-2;i++)
pktt[i]=pkt[i]; // Buffer telemetry values to be sent
if(pktt[6]>0 && pktt[6]<=10)
{
if (protocol==MODE_FRSKYD)
{
if ( ( pktt[7] & 0x1F ) == (telemetry_counter & 0x1F) )
{
uint8_t topBit = 0 ;
if ( telemetry_counter & 0x80 )
{
if ( ( telemetry_counter & 0x1F ) != RetrySequence )
{
topBit = 0x80 ;
}
}
telemetry_counter = ( (telemetry_counter+1)%32 ) | topBit ; // Request next telemetry frame
}
else
{
// incorrect sequence
RetrySequence = pktt[7] & 0x1F ;
telemetry_counter |= 0x80 ;
pktt[6]=0 ; // Discard current packet and wait for retransmit
}
}
}
else
{
pktt[6]=0; // Discard packet
}
//
#if defined SPORT_TELEMETRY && defined FRSKYX_CC2500_INO
telemetry_lost=0;
@ -195,36 +223,41 @@ void frsky_check_telemetry(uint8_t *pkt,uint8_t len)
}
}
void init_hub_telemetry()
void init_frskyd_link_telemetry()
{
telemetry_link=0;
telemetry_counter=0;
v_lipo1=0;
v_lipo2=0;
RSSI_dBm=0;
RX_RSSI=0;
TX_RSSI=0;
RX_LQI=0;
TX_LQI=0;
}
void frsky_link_frame()
{
frame[0] = 0xFE;
frame[0] = 0xFE; // Link frame
if (protocol==MODE_FRSKYD)
{
compute_RSSIdbm();
frame[1] = pktt[3];
frame[2] = pktt[4];
frame[3] = pktt[5];
frame[4] = (uint8_t)RSSI_dBm;
frame[1] = pktt[3]; // A1
frame[2] = pktt[4]; // A2
frame[3] = pktt[5]; // RX_RSSI
telemetry_link &= ~1 ; // Sent
telemetry_link |= 2 ; // Send hub if available
}
else
if (protocol==MODE_HUBSAN||protocol==MODE_AFHDS2A||protocol==MODE_BAYANG)
{
frame[1] = v_lipo1;
frame[2] = v_lipo2;
frame[3] = (uint8_t)RSSI_dBm;
frame[4] = TX_RSSI;
frame[3] = RX_RSSI;
telemetry_link=0;
}
frame[5] = frame[6] = frame[7] = frame[8] = 0;
frame[4] = TX_RSSI;
frame[5] = RX_LQI;
frame[6] = TX_LQI;
frame[7] = frame[8] = 0;
#if defined MULTI_TELEMETRY
multi_send_frskyhub();
#else
@ -235,66 +268,26 @@ void frsky_link_frame()
#if defined HUB_TELEMETRY
void frsky_user_frame()
{
uint8_t indexx = 0, j=8, i;
//uint8_t c=0, n=0;
if(pktt[6]>0 && pktt[6]<=10)
{//only valid hub frames
frame[0] = 0xFD;
frame[2] = pktt[7];
switch(pass)
if(pktt[6])
{//only send valid hub frames
frame[0] = 0xFD; // user frame
if(pktt[6]>USER_MAX_BYTES)
{
case 0:
indexx=pktt[6];
for(i=0;i<indexx;i++)
{
// if(pktt[j]==0x5E)
// {
// if(c++)
// {
// c=0;
// n++;
// j++;
// }
// }
pktx[i]=pktt[j++];
}
// indexx = indexx-n;
pass=1;
case 1:
indx=indexx;
prev_index = indexx;
if(indx<USER_MAX_BYTES)
{
for(i=0;i<indx;i++)
frame[i+3]=pktx[i];
pktt[6]=0;
pass=0;
}
else
{
indx = USER_MAX_BYTES;
for(i=0;i<indx;i++)
frame[i+3]=pktx[i];
pass=2;
}
break;
case 2:
indx = prev_index - indx;
prev_index=0;
if(indx<=(MAX_PKTX-USER_MAX_BYTES)) //10-6=4
for(i=0;i<indx;i++)
frame[i+3]=pktx[USER_MAX_BYTES+i];
pass=0;
pktt[6]=0;
break;
default:
break;
frame[1]=USER_MAX_BYTES; // packet size
pktt[6]-=USER_MAX_BYTES;
telemetry_link |= 2 ; // 2 packets need to be sent
}
if(!indx)
return;
frame[1] = indx;
else
{
frame[1]=pktt[6]; // packet size
telemetry_link=0; // only 1 packet or processing second packet
}
frame[2] = pktt[7];
for(uint8_t i=0;i<USER_MAX_BYTES;i++)
frame[i+3]=pktt[i+8];
if(telemetry_link & 2) // prepare the content of second packet
for(uint8_t i=8;i<USER_MAX_BYTES+8;i++)
pktt[i]=pktt[i+USER_MAX_BYTES];
#if defined MULTI_TELEMETRY
multi_send_frskyhub();
#else
@ -302,10 +295,8 @@ void frsky_user_frame()
#endif
}
else
pass=0;
telemetry_link=0;
}
#endif
/*
HuB RX packets.
pkt[6]|(counter++)|00 01 02 03 04 05 06 07 08 09
@ -320,6 +311,8 @@ pkt[6]|(counter++)|00 01 02 03 04 05 06 07 08 09
0A 0F 5E 3A 06 00 5E 5E 3B 09 00 5E
05 10 5E 06 16 72 5E 5E 3A 06 00 5E
*/
#endif
#if defined SPORT_TELEMETRY
/* SPORT details serial
@ -440,7 +433,7 @@ void sportSendFrame()
frame[0] = 0x98;
frame[1] = 0x10;
for (i=5;i<8;i++)
frame[i]=0;
frame[i]=0;
}
switch (sport_counter)
{
@ -454,7 +447,10 @@ void sportSendFrame()
case 2: // RSSI
frame[2] = 0x01;
frame[3] = 0xf1;
frame[4] = rssi;
frame[4] = RX_RSSI;
frame[5] = TX_RSSI;
frame[6] = RX_LQI;
frame[7] = TX_LQI;
break;
case 4: //BATT
frame[2] = 0x04;
@ -538,45 +534,33 @@ void TelemetryUpdate()
h = SerialControl.head ;
t = SerialControl.tail ;
if ( h >= t )
{
t += 64 - h ;
}
t += 128 - h ;
else
{
t -= h ;
}
if ( t < 32 )
{
if ( t < 64 )
return ;
}
#else
uint8_t h ;
uint8_t t ;
h = tx_head ;
t = tx_tail ;
if ( h >= t )
{
t += TXBUFFER_SIZE - h ;
}
else
{
t -= h ;
}
if ( t < 16 )
{
if ( t < 32 )
return ;
}
#endif
#if defined MULTI_TELEMETRY
{
uint32_t now = millis();
if ((now - lastMulti) > MULTI_TIME) {
multi_send_status();
lastMulti = now;
return;
}
}
#if ( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) )
{
uint32_t now = millis();
if ((now - lastMulti) > MULTI_TIME)
{
multi_send_status();
lastMulti = now;
return;
}
}
#endif
#if defined SPORT_TELEMETRY
@ -585,10 +569,10 @@ void TelemetryUpdate()
if(telemetry_link)
{
if(pktt[4] & 0x80)
rssi=pktt[4] & 0x7F ;
RX_RSSI=pktt[4] & 0x7F ;
else
RxBt = (pktt[4]<<1) + 1 ;
if(pktt[6]<=6)
if(pktt[6] && pktt[6]<=6)
for (uint8_t i=0; i < pktt[6]; i++)
proces_sport_data(pktt[7+i]);
telemetry_link=0;
@ -607,7 +591,7 @@ void TelemetryUpdate()
#endif
#if defined DSM_TELEMETRY
if(telemetry_link && protocol == MODE_DSM )
if(telemetry_link && protocol == MODE_DSM)
{ // DSM
DSM_frame();
telemetry_link=0;
@ -619,17 +603,18 @@ void TelemetryUpdate()
{
AFHDSA_short_frame();
telemetry_link=0;
return;
}
#endif
if(telemetry_link && protocol != MODE_FRSKYX )
if((telemetry_link & 1 )&& protocol != MODE_FRSKYX)
{ // FrSkyD + Hubsan + AFHDS2A + Bayang
frsky_link_frame();
telemetry_link=0;
return;
}
#if defined HUB_TELEMETRY
if(!telemetry_link && protocol == MODE_FRSKYD)
{ // FrSky
if((telemetry_link & 2) && protocol == MODE_FRSKYD)
{ // FrSkyD
frsky_user_frame();
return;
}
@ -849,7 +834,7 @@ void Serial_write( uint8_t byte )
#ifdef INVERT_SERIAL
byte |= 1 ; // Start bit
#endif
uint8_t next = (SerialControl.head + 2) & 0x3f ;
uint8_t next = (SerialControl.head + 2) & 0x7f ;
if ( next != SerialControl.tail )
{
SerialControl.data[SerialControl.head] = byte ;
@ -943,7 +928,7 @@ ISR(TIMER0_COMPB_vect)
{
GPIOR0 = ptr->data[ptr->tail] ;
GPIOR2 = ptr->data[ptr->tail+1] ;
ptr->tail = ( ptr->tail + 2 ) & 0x3F ;
ptr->tail = ( ptr->tail + 2 ) & 0x7F ;
GPIOR1 = 8 ;
OCR0A = OCR0B + 40 ;
OCR0B = OCR0A + 8 * 20 ;
@ -994,7 +979,7 @@ ISR(TIMER0_OVF_vect)
{
GPIOR0 = ptr->data[ptr->tail] ;
GPIOR2 = ptr->data[ptr->tail+1] ;
ptr->tail = ( ptr->tail + 2 ) & 0x3F ;
ptr->tail = ( ptr->tail + 2 ) & 0x7F ;
GPIOR1 = 10 ;
}
else

View File

@ -252,19 +252,18 @@ uint16_t ReadV2x2()
return 150;
break;
case V202_BIND2:
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED) {
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED)
return V2X2_PACKET_CHKTIME;
}
V2X2_send_packet(1);
if (--counter == 0) {
if (--bind_counter == 0)
{
phase = V202_DATA;
BIND_DONE;
}
break;
case V202_DATA:
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED) {
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED)
return V2X2_PACKET_CHKTIME;
}
V2X2_send_packet(0);
break;
}
@ -278,7 +277,7 @@ uint16_t initV2x2()
//
if (IS_AUTOBIND_FLAG_on)
{
counter = V2X2_BIND_COUNT;
bind_counter = V2X2_BIND_COUNT;
phase = V202_INIT2;
}
else

View File

@ -22,8 +22,11 @@
#ifdef ORANGE_TX
#undef ENABLE_PPM // Disable PPM for OrangeTX module
#undef A7105_INSTALLED // Disable A7105 for OrangeTX module
#undef A7105_CSN_pin
#undef CC2500_INSTALLED // Disable CC2500 for OrangeTX module
#undef CC25_CSN_pin
#undef NRF24L01_INSTALLED // Disable NRF for OrangeTX module
#undef NRF_CSN_pin
#define TELEMETRY // Enable telemetry
#define INVERT_TELEMETRY // Enable invert telemetry
#define DSM_TELEMETRY // Enable DSM telemetry
@ -65,6 +68,9 @@
#undef FQ777_NRF24L01_INO
#undef ASSAN_NRF24L01_INO
#undef HONTAI_NRF24L01_INO
#undef Q303_NRF24L01_INO
#undef GW008_NRF24L01_INO
#undef DM002_NRF24L01_INO
#endif
//Make sure telemetry is selected correctly
@ -77,8 +83,12 @@
#undef HUB_TELEMETRY
#undef SPORT_TELEMETRY
#undef DSM_TELEMETRY
#undef MULTI_STATUS
#undef MULTI_TELEMETRY
#else
#if defined MULTI_TELEMETRY && not defined INVERT_TELEMETRY
#warning MULTI_TELEMETRY has been defined but not INVERT_TELEMETRY. They should be both enabled for OpenTX telemetry and status to work.
#endif
#if not defined(BAYANG_NRF24L01_INO)
#undef BAYANG_HUB_TELEMETRY
#endif
@ -98,7 +108,7 @@
#if not defined(DSM_CYRF6936_INO)
#undef DSM_TELEMETRY
#endif
#if not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY)
#if not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS)
#undef TELEMETRY
#undef INVERT_TELEMETRY
#endif
@ -120,3 +130,16 @@
#error BIND_CH must be below or equal to 16.
#endif
#endif
#if MIN_PPM_CHANNELS>16
#error MIN_PPM_CHANNELS must be below or equal to 16. The default for this value is 4.
#endif
#if MIN_PPM_CHANNELS<2
#error MIN_PPM_CHANNELS must be larger than 1. The default for this value is 4.
#endif
#if MAX_PPM_CHANNELS<MIN_PPM_CHANNELS
#error MAX_PPM_CHANNELS must be higher than MIN_PPM_CHANNELS. The default for this value is 16.
#endif
#if MAX_PPM_CHANNELS>16
#error MAX_PPM_CHANNELS must be below or equal to 16. The default for this value is 16.
#endif

View File

@ -77,13 +77,9 @@ static void __attribute__((unused)) WK_build_bind_pkt(const uint8_t *init)
WK_add_pkt_crc(init[4]);
}
static int16_t __attribute__((unused)) WK_map_16(int32_t x, int32_t in_min, int32_t in_max, int32_t out_min, int32_t out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
static int16_t __attribute__((unused)) WK_get_channel(uint8_t ch, int32_t scale, int16_t center, int16_t range)
{
int16_t value = WK_map_16(Servo_data[CH_AETR[ch]],servo_min_100,servo_max_100,-scale,scale)+center;
int16_t value = map(Servo_data[CH_AETR[ch]],servo_min_100,servo_max_100,-scale,scale)+center;
if (value < center - range) value = center - range;
if (value > center + range) value = center + range;
return value;
@ -270,7 +266,7 @@ static void __attribute__((unused)) WK_build_data_pkt_2801()
for (uint8_t i = 0; i < 8; i++)
{
if (i == 4) { offset = 1; }
int16_t value = WK_get_channel(i, 0x190, 0, 0x3FF);
int16_t value = WK_get_channel(i, 0x1C2, 0, 0x3FF);
uint16_t mag = value < 0 ? -value : value;
packet[i+offset] = mag & 0xff;
msb = (msb << 2) | ((mag >> 8) & 0x03);

View File

@ -17,16 +17,6 @@
/** Multiprotocol module configuration file ***/
/**********************************************/
/********************/
/*** BOARD TYPE ***/
/********************/
//Uncomment one of the line below if you have a different module not based on the original Multi Atmega328p design which includes the 4-in-1.
//If you don't know then leave them commented.
#ifdef __arm__
#define STM32_BOARD // Let's automatically select this board if arm is selected since this is the only one for now...
#endif
/*******************/
/*** TX SETTINGS ***/
/*******************/
@ -41,15 +31,28 @@
//#define REVERSE_THROTTLE
//#define REVERSE_RUDDER
//Comment to disable the bind feature on a channel
/*************************/
/*** BIND FROM CHANNEL ***/
/*************************/
//Bind from channel enables you to bind when a specified channel is giong from low to high. This feature is only active
// if you specify AUTOBIND in PPM mode or set AutoBind to YES for serial mode. It also requires that the throttle channel is low.
//Comment to globaly disable the bind feature from a channel.
#define ENABLE_BIND_CH
//Set the channel number used for bind. Default is 16.
#define BIND_CH 16
//Comment to disable the wait for bind feature. This feature will not activate the selected
// protocol unless a bind is requested using bind from channel or the GUI "Bind" button.
//The goal is to prevent binding other people's model when powering up the TX, changing model or scanning through protocols.
#define WAIT_FOR_BIND
/**************************/
/*** RF CHIPS INSTALLED ***/
/**************************/
/****************/
/*** RF CHIPS ***/
/****************/
//There are 4 RF components supported. If one of them is not installed you must comment it using "//".
//If a chip is not installed all associated protocols are disabled.
//4-in-1 modules have all RF chips installed
@ -59,6 +62,31 @@
#define CC2500_INSTALLED
#define NRF24L01_INSTALLED
//Low power is reducing the transmit power of the multi module. This setting is configurable per model in PPM (table below) or Serial mode (radio GUI).
//It can be activated when flying indoor or small models since the distance is short or if a model is causing issues when flying closed to the TX.
//By default low power is completly disabled on all rf chips to prevent mistakes, but you can enable it by uncommenting the lines below:
//#define A7105_ENABLE_LOW_POWER
//#define CYRF6936_ENABLE_LOW_POWER
//#define CC2500_ENABLE_LOW_POWER
//#define NRF24L01_ENABLE_LOW_POWER
/*****************/
/*** GLOBAL ID ***/
/*****************/
//A global ID is used by most protocols to bind and retain the bind to models. To prevent duplicate IDs, it is automatically
// generated using a random 32 bits number the first time the eeprom is initialized.
//If you have 2 Multi modules which you want to share the same ID so you can use either to control the same RC model
// then you can force the ID to a certain known value using the lines below.
//Default is commented, you should uncoment only for test purpose or if you know exactly what you are doing!!!
//#define FORCE_GLOBAL_ID 0x12345678
//Protocols using the CYRF6936 (DSM, Devo, Walkera...) are using the CYRF ID instead which should prevent duplicated IDs.
//If you have 2 Multi modules which you want to share the same ID so you can use either to control the same RC model
// then you can force the ID to a certain known value using the lines below.
//Default is commented, you should uncoment only for test purpose or if you know exactly what you are doing!!!
//#define FORCE_CYRF_ID "\x12\x34\x56\x78\x9A\xBC"
/****************************/
/*** PROTOCOLS TO INCLUDE ***/
@ -102,7 +130,9 @@
#define FQ777_NRF24L01_INO
#define ASSAN_NRF24L01_INO
#define HONTAI_NRF24L01_INO
#define Q303_NRF24L01_INO
#define GW008_NRF24L01_INO
#define DM002_NRF24L01_INO
/**************************/
/*** TELEMETRY SETTINGS ***/
@ -114,17 +144,21 @@
//Comment to invert the polarity of the output telemetry serial signal.
//This function takes quite some flash space and processor power on an atmega.
//For OpenTX and ersky9x it must be uncommented.
//For OpenTX it must be uncommented.
//On a 9XR_PRO running ersky9x both commented and uncommented will work depending on the radio setting Invert COM1 under the Telemetry menu.
//On other addon/replacement boards like the 9xtreme board or the Ar9x board, you need to uncomment the line below.
//On other addon/replacement boards like the 9xtreme board or the Ar9x board running ersky9x, you need to uncomment the line below.
//For er9x it depends if you have an inveter mod or not on the telemetry pin. If you don't have an inverter comment this line.
#define INVERT_TELEMETRY
//#define INVERT_TELEMETRY
//Uncomment to send also Multi status and wrap other telemetry to allow TX to autodetect the format
//Only for newest OpenTX version
//Comment if you don't want to send Multi status telemetry frames (Protocol available, Bind in progress, version...)
//Use with er9x/erksy9x, for OpenTX MULTI_TELEMETRY below is preferred instead
#define MULTI_STATUS
//Uncomment to send Multi status and allow OpenTX to autodetect the telemetry format
//Supported by OpenTX version 2.2 RC9 and newer. NOT supported by er9x/ersky9x use MULTI_STATUS instead.
//#define MULTI_TELEMETRY
//Comment a line to disable a protocol telemetry
//Comment a line to disable a specific protocol telemetry
#define DSM_TELEMETRY // Forward received telemetry packet directly to TX to be decoded
#define SPORT_TELEMETRY // Use FrSkyX SPORT format to send telemetry to TX
#define AFHDS2A_FW_TELEMETRY // Forward received telemetry packet directly to TX to be decoded
@ -133,6 +167,7 @@
#define BAYANG_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define HUBSAN_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
/****************************/
/*** SERIAL MODE SETTINGS ***/
/****************************/
@ -158,8 +193,9 @@
#define TX_ER9X //ER9X/ERSKY9X/OpenTX ( 988<->2012µs)
//#define TX_DEVO7 //DEVO (1120<->1920µs)
//#define TX_SPEKTRUM //Spektrum (1100<->1900µs)
//#define TX_HISKY //HISKY (1100<->1900µs)
//#define TX_HISKY //HISKY (1120<->1920µs)
//#define TX_MPX //Multiplex MC2020 (1250<->1950µs)
//#define TX_WALKERA //Walkera PL0811-01H (1000<->1800µs)
//#define TX_CUSTOM //Custom
// The lines below are used to set the end points in microseconds (µs) if you have selected TX_CUSTOM.
@ -175,6 +211,13 @@
#define PPM_MIN_125 1000 // 125%
#endif
// The line below is used to set the minimum number of channels which the module should receive to consider a PPM frame valid.
// The default value is 4 to receive at least AETR for flying models but you could also connect the PPM from a car radio which has only 3 channels by changing this number to 3.
#define MIN_PPM_CHANNELS 4
// The line below is used to set the maximum number of channels which the module should work with. Any channels received above this number are discarded.
// The default value is 16 to receive all possible channels but you might want to filter some "bad" channels from the PPM frame like the ones above 6 on the Walkera PL0811.
#define MAX_PPM_CHANNELS 16
//The table below indicates which protocol to run when a specific position on the dial has been selected.
//All fields and values are explained below. Everything is configurable from here like in the Serial mode.
//Example: You can associate multiple times the same protocol to different dial positions to take advantage of the model match (RX_Num)
@ -185,8 +228,8 @@ const PPM_Parameters PPM_prot[15]= {
/* 3 */ {MODE_FRSKYD, 0 , 0 , P_HIGH , NO_AUTOBIND , 40 }, // option=fine freq tuning
/* 4 */ {MODE_HISKY , Hisky , 0 , P_HIGH , NO_AUTOBIND , 0 },
/* 5 */ {MODE_V2X2 , 0 , 0 , P_HIGH , NO_AUTOBIND , 0 },
/* 6 */ {MODE_DSM , DSM2_22 , 0 , P_HIGH , NO_AUTOBIND , 6 }, // option=number of channels
/* 7 */ {MODE_DEVO , 0 , 0 , P_HIGH , NO_AUTOBIND , 0 },
/* 6 */ {MODE_DSM , DSMX_11 , 0 , P_HIGH , NO_AUTOBIND , 6 }, // option=number of channels
/* 7 */ {MODE_DSM , DSM2_22 , 0 , P_HIGH , NO_AUTOBIND , 6 },
/* 8 */ {MODE_YD717 , YD717 , 0 , P_HIGH , NO_AUTOBIND , 0 },
/* 9 */ {MODE_KN , WLTOYS , 0 , P_HIGH , NO_AUTOBIND , 0 },
/* 10 */ {MODE_SYMAX , SYMAX , 0 , P_HIGH , NO_AUTOBIND , 0 },
@ -205,8 +248,15 @@ const PPM_Parameters PPM_prot[15]= {
CX20
MODE_HUBSAN
NONE
MODE_FRSKYV
NONE
MODE_FRSKYD
NONE
MODE_FRSKYX
CH_16
CH_8
EU_16
EU_8
MODE_HISKY
Hisky
HK310
@ -255,9 +305,6 @@ const PPM_Parameters PPM_prot[15]= {
MODE_BAYANG
BAYANG
H8S3D
MODE_FRSKYX
CH_16
CH_8
MODE_ESKY
NONE
MODE_MT99XX
@ -286,8 +333,6 @@ const PPM_Parameters PPM_prot[15]= {
NONE
MODE_ASSAN
NONE
MODE_FRSKYV
NONE
MODE_HONTAI
FORMAT_HONTAI
FORMAT_JJRCX1
@ -305,6 +350,15 @@ const PPM_Parameters PPM_prot[15]= {
W6_6_1
W6_HEL
W6_HEL_I
MODE_Q303
Q303
CX35
CX10D
CX10WD
MODE_GW008
NONE
MODE_DM002
NONE
*/
// RX_Num is used for model match. Using RX_Num values different for each receiver will prevent starting a model with the false config loaded...
@ -318,5 +372,5 @@ const PPM_Parameters PPM_prot[15]= {
// As an example, it's usefull for the WLTOYS F929/F939/F949/F959 (all using the Flysky protocol) which requires a bind at each power up.
// It also enables the Bind from channel feature, allowing to execute a bind by toggling a designated channel.
// Option: the value is between -127 and +127.
// Option: the value is between -128 and +127.
// The option value is only valid for some protocols, read this page for more information: https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/blob/master/Protocols_Details.md

View File

@ -16,16 +16,6 @@
#ifndef _IFACE_CC2500_H_
#define _IFACE_CC2500_H_
enum {
FRSKY_BIND = 0,
FRSKY_BIND_DONE = 1000,
FRSKY_DATA1,
FRSKY_DATA2,
FRSKY_DATA3,
FRSKY_DATA4,
FRSKY_DATA5
};
enum {
CC2500_00_IOCFG2 = 0x00, // GDO2 output pin configuration
CC2500_01_IOCFG1 = 0x01, // GDO1 output pin configuration
@ -157,42 +147,4 @@ enum {
//void CC2500_ReadData(u8 *dpbuffer, int len);
//void CC2500_SetTxRxMode(enum TXRX_State);
const PROGMEM uint8_t cc2500_conf[][2]={
{ CC2500_02_IOCFG0, 0x06 },
{ CC2500_00_IOCFG2, 0x06 },
{ CC2500_17_MCSM1, 0x0c },
{ CC2500_18_MCSM0, 0x18 },
{ CC2500_06_PKTLEN, 0x19 },
{ CC2500_07_PKTCTRL1, 0x04 },
{ CC2500_08_PKTCTRL0, 0x05 },
{ CC2500_3E_PATABLE, 0xff },
{ CC2500_0B_FSCTRL1, 0x08 },
{ CC2500_0C_FSCTRL0, 0x00 }, // option
{ CC2500_0D_FREQ2, 0x5c },
{ CC2500_0E_FREQ1, 0x76 },
{ CC2500_0F_FREQ0, 0x27 },
{ CC2500_10_MDMCFG4, 0xAA },
{ CC2500_11_MDMCFG3, 0x39 },
{ CC2500_12_MDMCFG2, 0x11 },
{ CC2500_13_MDMCFG1, 0x23 },
{ CC2500_14_MDMCFG0, 0x7a },
{ CC2500_15_DEVIATN, 0x42 },
{ CC2500_19_FOCCFG, 0x16 },
{ CC2500_1A_BSCFG, 0x6c },
{ CC2500_1B_AGCCTRL2, 0x43 }, // bind ? 0x43 : 0x03
{ CC2500_1C_AGCCTRL1,0x40 },
{ CC2500_1D_AGCCTRL0,0x91 },
{ CC2500_21_FREND1, 0x56 },
{ CC2500_22_FREND0, 0x10 },
{ CC2500_23_FSCAL3, 0xa9 },
{ CC2500_24_FSCAL2, 0x0A },
{ CC2500_25_FSCAL1, 0x00 },
{ CC2500_26_FSCAL0, 0x11 },
{ CC2500_29_FSTEST, 0x59 },
{ CC2500_2C_TEST2, 0x88 },
{ CC2500_2D_TEST1, 0x31 },
{ CC2500_2E_TEST0, 0x0B },
{ CC2500_03_FIFOTHR, 0x07 },
{ CC2500_09_ADDR, 0x00 }
};
#endif

View File

@ -1,4 +1,4 @@
#Protocols details
# Protocols details
Here are detailed descriptions of every supported protocols (sorted by RF modules) as well as the available options for each protocol.
If you want to see a list of models that use these protocols see the [Models](docs/Models.md) page.
@ -32,28 +32,28 @@ Dial|Protocol|Sub_protocol|RX Num|Power|Auto Bind|Option|RF Module
## Useful notes and definitions
- **Extended limits supported** - A command range of -125%..+125% will be transmitted. Otherwise the default is -100%..+100% only.
- **Channel Order** - The channel order assumed in all the documentation is AETR and it is highly recommended that you keep it this way. You can change this in the compilation settings. However, please indicate your channel order in all questions and posts on the forum pages.
- **Italic numbers** are referring to protocol/sub_protocol numbers that you should use if the radio (serial mode only) is not displaying (yet) the protocol you want to access.
- **Autobind protocol**:
1. The transmitter will automatically initiate a bind sequence on power up. This is for models where the receiver expects to rebind every time it is powered up. In these protocols you do not need to press the bind button at power up to bind, it will be done automatically.
2. Enable Bind from channel feature:
* Bind from channel can be globally enabled/disabled in _config.h using ENABLE_BIND_CH.
* Bind from channel can be locally enabled/disabled by setting Autobind to Y/N per model for serial or per dial switch number for ppm.
* Bind channel can be choosen on any channel between 5 and 16 using BIND_CH in _config.h.
* Bind will only happen if all these elements are happening at the same time:
- Autobind = Y
- Throttle = LOW (<-95%)
- Bind channel is going from -100% to +100%
* Bind from channel can be globally enabled/disabled in _config.h using ENABLE_BIND_CH.
* Bind from channel can be locally enabled/disabled by setting Autobind to Y/N per model for serial or per dial switch number for ppm.
* Bind channel can be choosen on any channel between 5 and 16 using BIND_CH in _config.h.
* Bind will only happen if all these elements are happening at the same time:
- Autobind = Y
- Throttle = LOW (<-95%)
- Bind channel is going from -100% to +100%
* Additional notes:
- It's recommended to combine Throttle cut with another button to drive the bind channel. This will prevent to launch a bind while flying...
- Bind channel does not have to be assigned to a free channel. Since it only acts when Throttle is Low (and throttle cut active), it could be used on the same channel as Flip for example since you are not going to flip your model when Throttle is low... Same goes for RTH and such other features.
- Using channel 16 for the bind channel seems the most relevant as only one protocol so far is using 16 channels which is FrSkyX. But even on FrSkyX this feature won't have any impact since there is NO valid reason to have Autobind set to Y for such a protocol.
- It's recommended to combine Throttle cut with another button to drive the bind channel. This will prevent to launch a bind while flying...
- Bind channel does not have to be assigned to a free channel. Since it only acts when Throttle is Low (and throttle cut active), it could be used on the same channel as Flip for example since you are not going to flip your model when Throttle is low... Same goes for RTH and such other features.
- Using channel 16 for the bind channel seems the most relevant as only one protocol so far is using 16 channels which is FrSkyX. But even on FrSkyX this feature won't have any impact since there is NO valid reason to have Autobind set to Y for such a protocol.
***
#A7105 RF Module
# A7105 RF Module
##FLYSKY
## FLYSKY - *1*
Extended limits supported
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
@ -62,28 +62,30 @@ A|E|T|R|CH5|CH6|CH7|CH8
Note that the RX ouput will be AETR.
###Sub_protocol V9X9
### Sub_protocol Flysky - *0*
### Sub_protocol V9X9 - *1*
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|LIGHT|PICTURE|VIDEO
###Sub_protocol V6X6
### Sub_protocol V6X6 - *2*
CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---
FLIP|LIGHT|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL
###Sub_protocol V912
### Sub_protocol V912 - *3*
CH5|CH6
---|---
BTMBTN|TOPBTN
###CX20
### Sub_protocol CX20 - *4*
Model: Cheerson Cx-20
CH5|CH6|CH7
---|---|---
##FLYSKY AFHDS2A
## FLYSKY AFHDS2A - *28*
Extended limits supported
Telemetry enabled for battery voltage and RX&TX RSSI using FrSky Hub protocol
@ -98,12 +100,12 @@ A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14
Note that the RX ouput will be AETR.
###Sub_protocol PWM_IBUS
###Sub_protocol PPM_IBUS
###Sub_protocol PWM_SBUS
###Sub_protocol PPM_SBUS
### Sub_protocol PWM_IBUS - *0*
### Sub_protocol PPM_IBUS - *1*
### Sub_protocol PWM_SBUS - *2*
### Sub_protocol PPM_SBUS - *3*
##HUBSAN
## HUBSAN - *2*
Models: Hubsan H102D, H107/L/C/D and Hubsan H107P/C+/D+
Autobind protocol
@ -117,64 +119,100 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS
***
#CC2500 RF Module
# CC2500 RF Module
##FRSKYV = FrSky 1 way
## FRSKYV = FrSky 1 way - *25*
Models: FrSky receivers V8R4, V8R7 and V8FR.
Extended limits supported
Option=fine frequency tuning. This value is different for each board. To determine this value, find the two limits where the RX loses connection then set the option value to half way between them. If you have a 4in1 V2 board the value is around 40 or -40.
Option for this protocol is fine frequency tuning. This value is different for each Module. To determine this value:
- find a value where the RX accepts to bind. A good start is to use one of these values -40, 0 and 40.
- find the values min/max where the RX loses connection. In serial mode you can change the value and see the effect live.
- set the value to half way between min and max.
- [video showing the process](https://youtu.be/C483uNWwAaM)
CH1|CH2|CH3|CH4
---|---|---|---
CH1|CH2|CH3|CH4
##FRSKYD
Models: FrSky receivers D4R and D8R. DIY RX-F801 and RX-F802 receivers.
## FRSKYD - *3*
Models: FrSky receivers D4R and D8R. DIY RX-F801 and RX-F802 receivers. Also known as D8.
Extended limits supported
Telemetry enabled for A0, A1, RSSI, TSSI and Hub
Option=fine frequency tuning. This value is different for each board. To determine this value, find the two limits where the RX loses connection then set the option value to half way between them. If you have a 4in1 V2 board the value is around 40 or -40.
Option for this protocol is fine frequency tuning. This value is different for each Module. To determine this value:
- find a value where the RX accepts to bind. A good start is to use one of these values -40, 0 and 40.
- find the values min/max where the RX loses connection. In serial mode you can change the value and see the effect live.
- set the value to half way between min and max.
- [video showing the process](https://youtu.be/C483uNWwAaM)
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
##FRSKYX
Models: FrSky receivers X4R, X6R and X8R.
## FRSKYX - *15*
Models: FrSky receivers X4R, X6R and X8R. Also known as D16.
Extended limits supported
Telemetry enabled for A1 (RxBatt), A2, RSSI, TSSI and Hub
Option=fine frequency tuning. This value is different for each board. To determine this value, find the two limits where the RX loses connection then set the option value to half way between them. If you have a 4in1 V2 board the value is around 40 or -40.
Option for this protocol is fine frequency tuning. This value is different for each Module. To determine this value:
- find a value where the RX accepts to bind. A good start is to use one of these values -40, 0 and 40.
- find the values min/max where the RX loses connection. In serial mode you can change the value and see the effect live.
- set the value to half way between min and max.
- [video showing the process](https://youtu.be/C483uNWwAaM)
### Sub_protocol CH_16 - *0*
FCC protocol 16 channels @18ms.
###Sub_protocol CH_16
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
---|---|---|---|---|---|---|---|---|----|----|----|----|----|----|----
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
###Sub_protocol CH_8
### Sub_protocol CH_8 - *1*
FCC protocol 8 channels @9ms.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
##SFHSS
### Sub_protocol EU_16 - *2*
EU-LBT protocol 16 channels @18ms. Note that the LBT part is not implemented, the TX transmits right away.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
---|---|---|---|---|---|---|---|---|----|----|----|----|----|----|----
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
### Sub_protocol EU_8 - *3*
EU-LBT protocol 8 channels @9ms. Note that the LBT part is not implemented, the TX transmits right away.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
## SFHSS - *21*
Models: Futaba RXs and XK models.
Option=fine frequency tuning. This value is different for each board. To determine this value, find the two limits where the RX loses connection then set the option value to half way between them. If you have a 4in1 V2 board the value is around 40 or -40.
Extended limits supported
Option for this protocol is fine frequency tuning. This value is different for each Module. To determine this value:
- find a value where the RX accepts to bind. A good start is to use one of these values -40, 0 and 40.
- find the values min/max where the RX loses connection. In serial mode you can change the value and see the effect live.
- set the value to half way between min and max.
- [video showing the process](https://youtu.be/C483uNWwAaM)
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|CH5|CH6|CH7|CH8
***
#CYRF6936 RF Module
# CYRF6936 RF Module
##DEVO
## DEVO - *7*
Extended limits supported
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
@ -204,13 +242,13 @@ Bind procedure using PPM:
- To verify that the TX is in fixed mode: power cycle the TX, the module LED should be solid ON (no blink).
- Note: Autobind/fixed ID mode is linked to the dial number. Which means that you can have multiple dial numbers set to the same protocol DEVO with different RX_Num and have different bind modes at the same time. It enables PPM users to get model match under DEVO.
##WK2X01
## WK2X01 - *30*
Extended limits supported
Autobind protocol
Note: RX ouput will always be AETR independently of the input AETR, RETA...
###WK2801
### Sub_protocol WK2801 - *0*
This roughly corresponds to the number of channels supported, but many of the newer 6-channel receivers actually support the WK2801 protocol. It is recommended to try the WK2801 protocol 1st when working with older Walkera models before attempting the WK2601 or WK2401 mode, as the WK2801 is a superior protocol. The WK2801 protocol supports up to 8 channels.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
@ -238,28 +276,28 @@ Bind procedure using PPM:
- To verify that the TX is in fixed mode: power cycle the TX, the module LED should be solid ON (no blink).
- Note: Autobind/fixed ID mode is linked to the dial number. Which means that you can have multiple dial numbers set to the same protocol WK2X01 and sub_protocol WK2801 with different RX_Num and have different bind modes at the same time. It enables PPM users to get model match.
###WK2401
### Sub_protocol WK2401 - *1*
The WK2401 protocol is used to control older Walkera models.
CH1|CH2|CH3|CH4
---|---|---|---
A|E|T|R
###W6_5_1
### Sub_protocol W6_5_1 - *2*
WK2601 5+1: AIL, ELE, THR, RUD, GYRO (ch 7) are proportional. Gear (ch 5) is binary. Ch 6 is disabled
CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|GEAR|DIS|GYRO
###W6_6_1
### Sub_protocol W6_6_1 - *3*
WK2601 6+1: AIL, ELE, THR, RUD, COL (ch 6), GYRO (ch 7) are proportional. Gear (ch 5) is binary. **This mode is highly experimental.**
CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|GEAR|COL|GYRO
###W6_HEL and W6HEL_I
### Sub_protocol W6_HEL - *4* and W6HEL_I - *5*
WK2601 Heli: AIL, ELE, THR, RUD, GYRO are proportional. Gear (ch 5) is binary. COL (ch 6) is linked to Thr. If Ch6 >= 0, the receiver will apply a 3D curve to the Thr. If Ch6 < 0, the receiver will apply normal curves to the Thr. The value of Ch6 defines the ratio of COL to THR.
W6HEL_I: Invert COL servo
@ -270,7 +308,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|GEAR|COL|GYRO
##DSM
## DSM - *6*
Extended limits supported
Telemetry enabled for TSSI and plugins
@ -285,31 +323,31 @@ Notes:
- model/type/number of channels indicated on the RX can be different from what the RX is in fact wanting to see. So don't hesitate to test different combinations until you have something working. Using Auto is the best way to find these settings.
- RX ouput will always be TAER independently of the input AETR, RETA...
###Sub_protocol DSM2_22
### Sub_protocol DSM2_22 - *0*
DSM2, Resolution 1024, refresh rate 22ms
###Sub_protocol DSM2_11
### Sub_protocol DSM2_11 - *1*
DSM2, Resolution 2048, refresh rate 11ms
###Sub_protocol DSMX_22
### Sub_protocol DSMX_22 - *2*
DSMX, Resolution 2048, refresh rate 22ms
###Sub_protocol DSMX_11
### Sub_protocol DSMX_11 - *3*
DSMX, Resolution 2048, refresh rate 11ms
###Sub_protocol AUTO
### Sub_protocol AUTO - *4*
The "AUTO" feature enables the TX to automatically choose what are the best settings for your DSM RX and update your model protocol settings accordingly.
The current radio firmware which are able to use the "AUTO" feature are ersky9x (9XR Pro, 9Xtreme, Taranis, ...) and er9x for M128 (9XR) and M2561.
For these firmwares, you must have a telemetry enabled TX and you have to make sure you set the Telemetry "Usr proto" to "DSMx".
Also on er9x you will need to be sure to match the polarity of the telemetry serial (normal or inverted by bitbashing), while on ersky9x you can set "Invert COM1" accordinlgy.
##J6Pro
## J6Pro - *22*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---|---|----|----|----
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
***
#NRF24L01 RF Module
# NRF24L01 RF Module
##ASSAN
## ASSAN - *24*
Extended limits supported
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
@ -318,7 +356,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
The transmitter must be close to the receiver while binding.
##BAYANG
## BAYANG - *14*
Models: EAchine H8(C) mini, BayangToys X6/X7/X9, JJRC JJ850, Floureon H101 ...
Autobind protocol
@ -327,35 +365,47 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
---|---|---|---|---|---|---|---|---|----
A|E|T|R|FLIP|RTH|PICTURE|VIDEO|HEADLESS|INVERTED
### Sub_protocol BAYANG - *0*
Option=0 -> normal Bayang protocol
Option=1 -> enable telemetry with [Silverxxx firmware](https://github.com/silver13/H101-acro/tree/master). Value returned to the TX using FrSkyD Hub are RX RSSI, TX RSSI, A1=uncompensated battery voltage, A2=compensated battery voltage
###Sub_protocol H8S3D
### Sub_protocol H8S3D - *1*
Model: H8S 3D
Same channels assignement as above.
##CG023
Models: EAchine CG023/CG031/3D X4
## DM002 - *33*
Autobind protocol
**Only 2 TX IDs available, change RX_Num value 0-1 to cycle through them**
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|----|----
A|E|T|R|FLIP|LED|CAMERA1|CAMERA2|HEADLESS|RTH|RATE_LOW
## CG023 - *13*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS
###Sub_protocol YD829
### Sub_protocol CG023 - *0*
Models: EAchine CG023/CG031/3D X4
### Sub_protocol YD829 - *1*
Models: Attop YD-822/YD-829/YD-829C ...
CH5|CH6|CH7|CH8|CH9
---|---|---|---|---
FLIP||PICTURE|VIDEO|HEADLESS
###Sub_protocol H8_3D
### Sub_protocol H8_3D - *2*
Models: EAchine H8 mini 3D, JJRC H20/H22/H11D
CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13
---|---|---|---|---|---|---|---
---|---|---|---|---|---|---|---|---
FLIP|LIGTH|PICTURE|VIDEO|OPT1|OPT2|CAL1|CAL2|GIMBAL
JJRC H20: OPT1=Headless, OPT2=RTH
@ -367,7 +417,7 @@ H8 3D: OPT1=RTH then press a direction to enter headless mode (like stock TX), O
CAL1: H8 3D acc calib, H20 headless calib
CAL2: H11D/H20 acc calib
##CX10
## CX10 - *12*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6
@ -376,12 +426,12 @@ A|E|T|R|FLIP|RATE
Rate: -100%=rate 1, 0%=rate 2, +100%=rate 3
###Sub_protocol GREEN
### Sub_protocol GREEN - *0*
Models: Cheerson CX-10 green pcb
Same channels assignement as above.
###Sub_protocol BLUE
### Sub_protocol BLUE - *1*
Models: Cheerson CX-10 blue pcb & some newer red pcb, CX-10A, CX-10C, CX11, CX12, Floureon FX10, JJRC DHD D1
CH5|CH6|CH7|CH8
@ -390,14 +440,39 @@ FLIP|RATE|PICTURE|VIDEO
Rate: -100%=rate 1, 0%=rate 2, +100%=rate 3 or headless for CX-10A
###Sub_protocol DM007
### Sub_protocol DM007 - *2*
CH5|CH6|CH7|CH8|CH9
---|---|---|---|---
FLIP|MODE|PICTURE|VIDEO|HEADLESS
##Q2X2
###Sub_protocol Q242 and Q282
### Sub_protocol JC3015_1 - *4*
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|MODE|PICTURE|VIDEO
### Sub_protocol JC3015_2 - *5*
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|MODE|LED|DFLIP
### Sub_protocol MK33041 - *6*
CH5|CH6|CH7|CH8|CH9|CH10
---|---|---|---|---|---
FLIP|MODE|PICTURE|VIDEO|HEADLESS|RTH
## Q2X2 - *29*
### Sub_protocol Q222 - *0*
Models: Q222 v1 and V686 v2
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|MODULE2|MODULE1|HEADLESS|RTH|XCAL|YCAL
### Sub_protocol Q242 - *1* and Q282 - *2*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---|---|---|---|---
@ -405,139 +480,124 @@ A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL
Model: JXD 509 is using Q282 with CH12=Start/Stop motors
###Sub_protocol Q222
Models: Q222 v1 and V686 v2
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|MODULE2|MODULE1|HEADLESS|RTH|XCAL|YCAL
###Sub_protocol JC3015_1
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|MODE|PICTURE|VIDEO
###Sub_protocol JC3015_2
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|MODE|LED|DFLIP
###Sub_protocol MK33041
CH5|CH6|CH7|CH8|CH9|CH10
---|---|---|---|---|---
FLIP|MODE|PICTURE|VIDEO|HEADLESS|RTH
##ESKY
## ESKY - *16*
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|GYRO|PITCH
##FY326
## FY326 - *20*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|RTH|HEADLESS|EXPERT|CALIBRATE
##FQ777
## FQ777 - *23*
Model: FQ777-124 (with SV7241A)
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|FLIP|RTH|HEADLESS|EXPERT
##HISKY
## GW008 - *32*
Model: Global Drone GW008 from Banggood
There are 3 versions of this small quad, this protocol is for the one with a XNS104 IC in the stock Tx and PAN159CY IC in the quad. The xn297 version is compatible with the CX10 protocol (green pcb). The LT8910 version is not supported yet.
CH1|CH2|CH3|CH4|CH5
---|---|---|---|---
A|E|T|R|FLIP
## HISKY - *4*
### Sub_protocol Hisky - *0*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|GEAR|PITCH|GYRO|CH8
GYRO: -100%=6G, +100%=3G
###Sub_protocol HK310
### Sub_protocol HK310 - *1*
Models: RX HK-3000, HK3100 and XY3000 (TX are HK-300, HK-310 and TL-3C)
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
|||T|R|AUX|T_FSAFE|R_FSAFE|AUX_FSAFE
| | |T|R|AUX|T_FSAFE|R_FSAFE|AUX_FSAFE
##KN
## KN - *9*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|----|----
A|E|T|R|DR|THOLD|IDLEUP|GYRO|Ttrim|Atrim|Etrim
Dual Rate: +100%=full range, Throttle Hold: +100%=hold, Idle Up: +100%=3D, GYRO: -100%=6G, +100%=3G
###Sub_protocol WLTOYS
###Sub_protocol FEILUN
### Sub_protocol WLTOYS - *0*
### Sub_protocol FEILUN - *1*
Same channels assignement as above.
##HONTAI
## HONTAI - *26*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|----|----
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|CAL
###Sub_protocol HONTAI
###Sub_protocol JJRCX1
### Sub_protocol HONTAI - *0*
### Sub_protocol JJRCX1 - *1*
CH6|
---|
ARM|
###Sub_protocol X5C1 clone
### Sub_protocol X5C1 clone - *2*
###Sub_protocol FQ777_951
### Sub_protocol FQ777_951 - *3*
##MJXQ
## MJXQ - *18*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13
---|---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|AUTOFLIP|PAN|TILT
###Sub_protocol WLH08
###Sub_protocol X600
### Sub_protocol WLH08 - *0*
### Sub_protocol X600 - *1*
Only 3 TX IDs available, change RX_Num value 0..2 to cycle through them
###Sub_protocol X800
### Sub_protocol X800 - *2*
Only 3 TX IDs available, change RX_Num value 0..2 to cycle through them
###Sub_protocol H26D
### Sub_protocol H26D - *3*
Only 3 TX IDs available, change RX_Num value 0..2 to cycle through them
###Sub_protocol H26WH
### Sub_protocol E010 - *4*
15 TX IDs available, change RX_Num value 0..14 to cycle through them
If the E010 does not respond well to inputs or hard to bind, set Power to Low.
### Sub_protocol H26WH - *5*
CH6|
---|
ARM|
Only 1 TX ID available
###Sub_protocol E010
15 TX IDs available, change RX_Num value 0..14 to cycle through them
If the E010 does not respond well to inputs or hard to bind, set Power to Low.
##MT99XX
## MT99XX - *17*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS
###Sub_protocol MT
### Sub_protocol MT99 - *0*
Models: MT99xx
###Sub_protocol H7
### Sub_protocol H7 - *1*
Models: Eachine H7, Cheerson CX023
###Sub_protocol YZ
### Sub_protocol YZ - *2*
Model: Yi Zhan i6S
Only one model can be flown at the same time since the ID is hardcoded.
###Sub_protocol LS
### Sub_protocol LS - *3*
Models: LS114, 124, 215
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|INVERT|PICTURE|VIDEO|HEADLESS
###Sub_protocol FY805
### Sub_protocol FY805 - *4*
Model: FY805
Only 1 ID available
@ -546,7 +606,41 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP||||HEADLESS
##Shenqi
## Q303 - *31*
Autobind protocol
CH1|CH2|CH3|CH4
---|---|---|---
A|E|T|R
### Sub_protocol Q303 - *0*
Q303 warning: this sub_protocol is known to not work at all/properly with 4in1 RF modules.
CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---
AHOLD|FLIP|PICTURE|VIDEO|HEADLESS|RTH|GIMBAL
GIMBAL needs 3 position -100%/0%/100%
### Sub_protocol CX35 - *1*
CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---
ARM|VTX|PICTURE|VIDEO||RTH|GIMBAL
ARM is 2 positions: land / take off
Each toggle of VTX will increment the channel.
Gimbal is full range.
### Sub_protocol CX10D - *2* and Sub_protocol CX10WD - *3*
CH5|CH6
---|---
ARM|FLIP
ARM is 3 positions: -100%=land / 0%=manual / +100%=take off
## Shenqi - *19*
Autobind protocol
Model: Shenqiwei 1/20 Mini Motorcycle
@ -557,56 +651,55 @@ CH1|CH2|CH3|CH4
Throttle +100%=full forward,0%=stop,-100%=full backward.
##SLT
## SLT - *11*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|GEAR|PITCH
##Symax
## Symax - *10*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP||PICTURE|VIDEO|HEADLESS
###Sub_protocol SYMAX
### Sub_protocol SYMAX - *0*
Models: Syma X5C-1/X11/X11C/X12
###Sub_protocol SYMAX5C
### Sub_protocol SYMAX5C - *1*
Model: Syma X5C (original) and X2
##V2X2
Models: WLToys V202/252/272, JXD 385/388, JJRC H6C, Yizhan Tarantula X6 ...
## V2X2 - *5*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|----|----
A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS|MAG_CAL_X|MAG_CAL_Y
### Sub_protocol V2x2 - *0*
Models: WLToys V202/252/272, JXD 385/388, JJRC H6C, Yizhan Tarantula X6 ...
PICTURE: also automatic Missile Launcher and Hoist in one direction
VIDEO: also Sprayer, Bubbler, Missile Launcher(1), and Hoist in the other dir
###Sub_protocol JXD506
### Sub_protocol JXD506 - *1*
Model: JXD 506
CH10|CH11|CH12
---|---|---
Start/Stop|EMERGENCY|CAMERA_UP/DN
##YD717
## YD717 - *8*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS
###Sub_protocol YD717
###Sub_protocol SKYWLKR
###Sub_protocol SYMAX4
###Sub_protocol XINXUN
###Sub_protocol NIHUI
### Sub_protocol YD717 - *0*
### Sub_protocol SKYWLKR - *1*
### Sub_protocol SYMAX4 - *2*
### Sub_protocol XINXUN - *3*
### Sub_protocol NIHUI - *4*
Same channels assignement as above.

View File

@ -1,3 +1,5 @@
If you like this project and want to support further development [<img style="float:right" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate" />](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VF2K9T23DRY56&lc=US&item_name=DIY%20Multiprotocol&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)EUR [<img style="float:right" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate" />](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VF2K9T23DRY56&lc=FR&item_name=DIY%20Multiprotocol&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)USD
# Overview of the MULTI-Module
The **Multiprotocol Tx Module** (or **MULTI-Module**) is a 2.4GHz transmitter module which enables almost any TX to control lot of different models available on the market.
@ -5,7 +7,7 @@ The source code is partly based on the [Deviation TX project](http://www.deviati
## Quicklinks
* [Download latest releases of the firmware](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/releases) and [instructions to upload .hex files](docs/Advanced_Manually_Setting_ATmega328_Fuses.md)
* [Forum on rcroups](http://www.rcgroups.com/forums/showthread.php?t=2165676)
* [Forum on rcgroups](http://www.rcgroups.com/forums/showthread.php?t=2165676)
* [Available Protocols list](Protocols_Details.md)
* [The old documentation](docs/README-old.md)
@ -15,11 +17,10 @@ The source code is partly based on the [Deviation TX project](http://www.deviati
1. [Available protocols](Protocols_Details.md)
1. [Transmitters and serial/telemetry options](docs/Transmitters.md)
1. [Module Hardware options](docs/Hardware.md)
1. [Compiling and programming the module (ATmega328)](docs/Compiling.md) and [Compiling STM32](docs/Compiling_STM32.md).
1. Compiling and programming the module
* [4in1/DIY Multiprotocol module based on ATmega328](docs/Compiling.md)
* [DIY Multiprotocol module based on STM32](docs/Compiling_STM32.md)
1. [Transmitter Setup](docs/Transmitters.md)
- [Taranis](docs/Tx-Taranis.md)
- [FlySky TH9X, Turnigy 9X/R](docs/Tx-FlyskyTH9X.md)
- [erSky Transmitters](docs/Tx-erSky9X.md)
1. [How to for popular models](docs/Models.md)
1. [Troubleshooting](docs/Troubleshooting.md)
2. [Advanced Topics (not for the fainthearted!)](docs/Advanced_Topics.md)
@ -31,22 +32,19 @@ A functioning MULTI-Module consists of (see image below):
1. A host RC Tx
1. A Multiprotocol Transmitter Module (MULTI-Module) that connects to a host transmitter. This module is typically comprised of
* A microcontroller (currently ATMega328P or STM32) that interfaces with the Tx, controls the module functions and forwards the RC commands to the RF hardware
* One or more (but at least one) RF modules that provide the capability to communicate with RC receivers. To communicate with the receiver the RF module in the Tx must match with the RF module type in the receiver. The four most common 2.4GHz RF chips on the market are supported TI CC2500, Nordic NRF24L01, Cypress CYRF6936, and the Amiccom A7105
* MULTI-firmware loaded on to the microprocessor. At a high level, this firmware performs a few different functions:
* A microcontroller (currently ATMega328P or STM32) that interfaces with the Tx, controls the module functions and forwards the RC commands to the RF hardware
* One or more (but at least one) RF modules that provide the capability to communicate with RC receivers. To communicate with the receiver the RF module in the Tx must match with the RF module type in the receiver. The four most common 2.4GHz RF chips on the market are supported TI CC2500, Nordic NRF24L01, Cypress CYRF6936, and the Amiccom A7105
* MULTI-firmware loaded on to the microprocessor. At a high level, this firmware performs a few different functions:
* It interfaces with signals from the host Tx and decodes these for transmission to the model, it manages the activation of the correct hardware RF module for each protocol
* It implements the unique communication protocols for each receiver/model and manages the all-important binding process with a receiver/model
* In the case of some protocols (for example DSMX and FrSky) it receives and decodes the telemetry information and makes this available to the receiver.
* In the case of some protocols (for example DSMX and FrSky) it receives and decodes the telemetry information and makes this available to the radio.
1. The physical 2.4GHz antenna (or in some cases multiple antennas) for the modules
On of the most attractive features of the MULTI-module is the ability to send telemetry signals back to the transmitter. The MULTI-Module is fully telemetry capable for all protocols that support telemetry. Your ability to use the telemetry information depends on the your transmitter hardware and your transmitter firmware.
One of the most attractive features of the MULTI-module is the ability to send telemetry signals back to the transmitter. The MULTI-Module is fully telemetry capable for all protocols that support telemetry. Your ability to use the telemetry information depends on your radio hardware and firmware.
In constructing a functioning MULTI-Module there are important choices to be made and tradeoffs to be aware of. The most important are:
##**Choice 1:** Which MULTI-Module hardware option
## **Choice 1:** Which MULTI-Module hardware option
There are currently four generic paths to get your hands on an MULTI-Module. These are outlined in detail on the [hardware](docs/Hardware.md) page. Here they are, in order of increasing difficulty:
- **Ready-made MULTI-Module** - Available from Banggood which includes a 4-in-1 RF module and an antenna switcher
@ -58,37 +56,37 @@ The last option is where it all started and how the pioneers in this project mad
For more information on these options see the [hardware](docs/Hardware.md) page
##**Choice 2:** Which RF modules to include in the MULTI-Module
## **Choice 2:** Which RF modules to include in the MULTI-Module
This depends on your specific needs. However, recent the availability of the 4-in-1 RF modules from Banggood for less than $35 makes it easy to “have it all”. Most manufacturers of RC systems (Spektrum, FrSky, FlySky) and toys (Syma, Hubsan, Horizon Hobby, etc.) use one of these four RF chips to manage the RF link between the transmitter and the reciever/model. Here is an incomplete list of the RF modules and some of the most popular toys that use them. For the complete list see the [Protocol Details](Protocols_Details.md) page.
This depends on your specific needs. However, recent the availability of the 4-in-1 RF modules from Banggood for less than $35 makes it easy to “have it all”. Most manufacturers of RC systems (Spektrum, FrSky, FlySky) and toys (Syma, Hubsan, etc.) use one of these four RF chips to manage the RF link between the transmitter and the reciever/model. Here is an incomplete list of the RF modules and some of the most popular toys that use them. For the complete list see the [Protocol Details](Protocols_Details.md) page.
Manufacturer|RF Chip|Example Protocols
:-----------|-------|:-------
Cyprus Semiconductor| CYRF6936|DSM/DSMX
| |Walkera Devo
| |J6Pro
Texas Instruments|CC2500|FrSky
| |Futaba SFHSS
Amiccom|A7105|FlySky
| |FlySky AFHDS2A
| |Hubsan
Nordic Semiconductor|NRF24L01|HiSky
| |Syma
| |ASSAN
| |and most other Chinese models
|Manufacturer|RF Chip|Example Protocols|
|---|---|---|
|Cyprus Semiconductor|CYRF6936|DSM/DSMX|
|||Walkera Devo|
|||J6Pro|
|Texas Instruments|CC2500|FrSky|
|||Futaba SFHSS|
|Amiccom|A7105|FlySky|
|||FlySky AFHDS2A|
|||Hubsan|
|Nordic Semiconductor|NRF24L01|HiSky|
|||Syma|
|||ASSAN|
|||and most other Chinese models|
For example, if you have no interest in binding your Tx to an model with and FrSky or Futaba SFHSS receiver you do not need to include the CC2500 RF module in your system.
##**Choice 3:** Which protocols to upload to the MULTI-Module
## **Choice 3:** Which protocols to upload to the MULTI-Module
Of course there always a catch. In this case it is the 32K memory limit on the ATmega328 processor. Due to the amazing work done by devs on this project, the memory required by all the possible protocols exceeds this limit considerably. This means that you will need to make a choice of which protocols you will compile into your firmware. Fortunately, the process of selecting and compiling is not too difficult and it is fully documented on the [Compiling and Programming](docs/Compiling.md) page.
Of course there is always a catch. In this case it is the 32KB memory limit on the ATmega328 processor. Due to the amazing work done by devs on this project, the memory required by all the possible protocols exceeds this limit considerably. This means that you will need to make a choice of which protocols you will compile into your firmware. Fortunately, the process of selecting and compiling is not too difficult and it is fully documented on the [Compiling and Programming](docs/Compiling.md) page.
Also, the lead dev Pascal Langer (rcgroups:hpnuts) makes this process even easier for many users by making compiled binaries available for three popular combinations of RF modules. These are always “fresh” (based on the latest stable firmware) and available on the [Releases](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/releases) page.
Midelic has ported a version the firmware to an STM32 ARM microcontroller. If you go the route of building this version of the DIY MULTI-Module then the memory limits do not apply.
An alternatice is to use a STM32 ARM microcontroller based module. If you go the route of building this version of the DIY MULTI-Module then the memory limits do not apply anymore.
##**Choice 4:** Choosing the type of interface between the MULTI-Module and your Tx (PPM or Serial)
## **Choice 4:** Choosing the type of interface between the MULTI-Module and your radio (PPM or Serial)
The all the MULTI-Module options supports industry standard PPM interface that works with all transmitters with either:
The MULTI-Module supports industry standard PPM interface that works with all transmitters with either:
- a module bay or
- a trainer port or
- any PPM signal that can be accessed inside the Tx.
@ -96,10 +94,10 @@ The all the MULTI-Module options supports industry standard PPM interface that w
Most of the older FM radios support the PPM interface.
If you are the owner of a transmitter that supports the er9X/erSky9X or OpenTX firmwares (Frsky Taranis, Horus or the FlySky TH9X or the Turnigy 9X family) you have the additional option to use a serial protocol to communicate between your Tx and the MULTI-Module. (Owners of Walkera Devo transmitters should look at the [Deviation Tx](http://www.deviationtx.com) project for how to achieve the same end goal). This serial protocol does not require any hardware modifications, but will likely require updating the firmware on your radio. For those willing to do this, there are some nice advantages:
- The model and protocol selection and binding is done from the Model Settings menu on the Tx
- The model protocol selection and binding is done from the Model Settings menu on the Tx
- For telemetry capable transmitters, the telemetry integration is done seamlessly with the Tx firmware. (Note that FrSky TH9X/Turnigy 9X/R transmitters require a telemetry mod to be done before telemetry can work). Click on the link corressponding to your Tx on the [Transmitters](docs/Transmitters.md) page for more details.
#How to get started?
# How to get started?
1. Browse the [Protocols](Protocols_Details.md) page to see which protocols you would like on your module
1. Go to the [Hardware Options](docs/Hardware.md) page to decide which of the MULTI-Module hardware options appeals to you and which RF modules you plan to integrate
1. Once you have your module, you should review what jumper settings or modifications are required to the module to support serial communication and possibly telemetry
@ -107,7 +105,7 @@ If you are the owner of a transmitter that supports the er9X/erSky9X or OpenTX f
1. Finally, you should visit the setup page for your transmitter by clicking on the link corressponding to your Tx on the [Transmitters](docs/Transmitters.md) page to configure the last few settings before you can fly to your hearts content!!!!!
# Troubleshooting
Visit the [Troubleshooting](docs/Troubleshooting.md) page. Please bear in mind that the MULTI-Module is a complex system of hardware and software and it make take some patience to get it up and running. Also remember that the developers of the system are actual users of the system. This means that at any moment in time the system is working perfectly for them. A corollary to this is that if you are struggling there are likely two scenarios. First, that the problem is with your hardware or with your configuration, second, and much more unlikely but not impossible scenario, is that you are struggling with a new undiscovered bug. (The author of this documentation speaks from experience ;-) Please check the RC Groups forum and search for keywords relating to your problem before posting a reply. When you do post a reply please so humbly and respectfully you will find many helpful people there. In your reply please include as much relevant information as possible and attach compilation output and _Config.h files as text attachments to keep the forum clean.
Visit the [Troubleshooting](docs/Troubleshooting.md) page. Please bear in mind that the MULTI-Module is a complex system of hardware and software and it make take some patience to get it up and running. Also remember that the developers of the system are actual users of the system. This means that at any moment in time the system is working perfectly for them. A corollary to this is that if you are struggling there are likely two scenarios. First, that the problem is with your hardware or with your configuration, second, and much more unlikely but not impossible scenario, is that you are struggling with a new undiscovered bug. (The author of this documentation speaks from experience ;-) Please check the RC Groups forum and search for keywords relating to your problem before posting a reply. When you do post a reply please so humbly and respectfully you will find many helpful people there. In your reply please include as much relevant information as possible and attach compilation output and ```_Config.h``` files as text attachments to keep the forum clean.
# A final word
A very big thanks to all the people who have shared their time so graciously to create this great project. If you come across them on RC Groups, please be kind and show appreciation. In no particular order:
* Pascal Langer (rcgroups: hpnuts)
@ -120,4 +118,4 @@ A very big thanks to all the people who have shared their time so graciously to
Your help would be greatly appreciated. If protocol reverse-engineering and dev is not your thing then any help with testing and contributing to the documentation would be amazing. Given the number of different Tx/module hardware/RF module/protocol/model combinations the process of testing and documenting is a major bottleneck for the developers. Anything you can do to help will free them up to do even greater things.
If you like this project and want to support further development EUR[<img style="float:right" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate" />](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VF2K9T23DRY56&lc=US&item_name=DIY%20Multiprotocol&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted) USD[<img style="float:right" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate" />](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VF2K9T23DRY56&lc=FR&item_name=DIY%20Multiprotocol&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)
If you like this project and want to support further development [<img style="float:right" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate" />](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VF2K9T23DRY56&lc=US&item_name=DIY%20Multiprotocol&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)EUR [<img style="float:right" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate" />](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VF2K9T23DRY56&lc=FR&item_name=DIY%20Multiprotocol&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)USD

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -1,4 +1,4 @@
#ATmega Serial Uploader
# ATmega Serial Uploader
Mike Blandford adapted the optiboot bootloader for the 4-in-1 module to allow flashing of the module using a standard Arduino USB to serial adapter or FTDI adapter. No need to open the module case. Once set up is very easy to use:
@ -22,7 +22,7 @@ While the bootloader is running, if it detects a communication problem, it confi
This bootloader is for reading and writing the flash only, the EEPROM is not supported, neither is reading/writing the fuses, but it only uses 512 bytes of flash.
##Install the bootloader
## Install the bootloader
To get the bootloader onto the ATmega you need to connect an flashing tool (like USBasp) to the 6-pin ISP connector on the board.
Simply flash the .hex file to get the bootloader on the chip, and change the high fuse at the same time.

View File

@ -1,5 +1,6 @@
#Bluetooth Telemetry in PPM Mode
###Telemetry
# Bluetooth Telemetry in PPM Mode
## Telemetry
There are 4 protocols supporting telemetry: Hubsan, DSM, FrSkyD and FrSkyX.
@ -11,7 +12,7 @@ FrSkyD displays full telemetry (A0, A1, RX RSSI, TX RSSI and Hub).
FrSkyX displays full telemetry (A1, A2, RX RSSI, TX RSSI and Hub).
### If used in PPM mode
## If used in PPM mode
Telemetry is available as a serial output on the TX pin of the Atmega328p using the FrSky hub format for Hubsan, FrSkyD, FrSkyX and DSM format for DSM2/X. The serial paramets depends on the protocol:

View File

@ -1,92 +1,56 @@
#Manually Uploading HEX files and setting ATmega328 Fuses
There are many different options to upload a .hex firmware file to the MULTI-Module and to set the correct fuses. This document outlines an approach that uses a USBASP programmer and which is equally compatible with OSX, Windows and Linux operating systems. It does this by using the uploading capabilities bundled in the Arduino IDE package. There are five steps to the process:
1. Finding the location of the AVRdude uploader and the uploading command
2. Modifying the uploading command to create three commands:
- Verify the connection and current fuse settings
- Upload your .hex file
- Set your fuses
2. Verify
1. Uploading your firmware
1. Setting your fuses
# Manually Uploading HEX files and setting Fuses on ATmega328
**The .hex files provided are only for tests purpose. The recommended method is to use [Compiling and Programming](Compiling.md).**
There are many different options to upload a .hex firmware file to the MULTI-Module and to set the correct fuses. This document outlines an approach that uses a USBASP programmer and which is equally compatible with OSX, Windows and Linux operating systems.
1. Follow this section: [Material you need to upload the firmware](Compiling.md#material-you-need-to-upload-the-firmware)
1. Follow this section: [Install the Arduino IDE](Compiling.md#install-the-arduino-ide-and-the-multiprotocol-project-firmware)
1. Make sure to write down the location of your installation since you need to know where avrdude is installed to configure the AVR8 Burn-O-Mat. For example on a default windows installation, avrdude.exe is located in "C:\Program Files (x86)\Arduino\hardware\tools\avr\bin" where "C:\Program Files (x86)\Arduino" is the installation path.
1. Install [AVR8 Burn-O-Mat](http://avr8-burn-o-mat.brischalle.de/avr8_burn_o_mat_avrdude_gui_en.php) which is available for all platforms. Installation instructions are on the software page (Don't forget to install [Java](http://java.sun.com/javase/downloads) as explained).
1. Launch AVR8 Burn-O-Mat.
1. You should now have a window which looks like this: <br> <img src="images/AVR8BurnOMat-main.png" />
1. Click on **Settings->AVRDUDE** and fill in the details about avrdude location using the installation path written previously as well as selecting USBASP for the programmer: <br> <img src="images/AVR8BurnOMat-settings.png" />
1. Once done click on OK.
1. You are now done with all the installations/configuration and ready to program your Multi-module.
## Fuse settings
To understand fuses refer to the ATmega328P datasheet (See Section 28.3 Fuse Bits)
The fuse settings have to be done only once for all.
Here are some fuse settings for common configurations:
Board|Low Fuse|High Fuse|Extended Fuse
Board|Extended Fuse (efuse)|High Fuse (hfuse)|Low Fuse (lfuse)
-----|--------|---------|-------------
Arduino Pro Mini with Arduino bootloader|0xFF|0xD2|0xFD
DIY 3.2d PCB without bootloader |0xFF|0xD3|0xFD
DIY 3.2d PCB with [custom mikeb bootloader](Advanced_ATmega_Serial_Uploader.md) |0xFF|0xD6|0xFD
Banggood 4-in-1 module without bootloader |0xFF|0xD3|0xFD
Banggood 4-in-1 module with [custom mikeb bootloader](Advanced_ATmega_Serial_Uploader.md) |0xFF|0xD6|0xFD
Banggood 4-in-1 module |0xFD|0xD3|0xFF
Arduino Pro Mini |0xFD|0xD3|0xFF
DIY 2.3d PCB |0xFD|0xD3|0xFF
DIY 2.3d PCB with [custom mikeb bootloader](Advanced_ATmega_Serial_Uploader.md) |0xFD|0xD6|0xFF
Banggood 4-in-1 module with [custom mikeb bootloader](Advanced_ATmega_Serial_Uploader.md) |0xFD|0xD6|0xFF
If you don't know which one to take the 1st line is the one you want.
## Step 1. Determining the location of the avrdude program
The AVRdude software is commonly used to upload firmware and set fuses on the ATMega microprocessor.
### Burn the fuses
1. Follow this section: [Connect the programmer](Compiling.md#connect-the-programmer)
1. Launch AVR8 Burn-O-Mat.
1. In the **AVR type** drop down select **ATmega328P** and click on **Fuses**
1. In the **ATmega328P Fuses** window which just open click on read fuses.
1. Ignore the error "warning : Can not Set sck period . usbasp please check for firmware update .".
1. If you get an error there is something wrong with your connections, your programmer, or your board. Verify everything and go back to the 1st bullet point.
1. Set the 3 Fuse values <br> <img src="images/AVR8BurnOMat-fuses.png" />
1. Click on **apply**
1. Click on **write fuses**
1. Ignore the error "warning : Can not Set sck period . usbasp please check for firmware update .".
1. If you get an error there is something wrong with your connections, your programmer, or your board. Verify everything and go back to the 1st bullet point.
1. You are done with setting the Fuses and can close the **ATmega328P Fuses** window
You can install avrdude on your computer, but it is already contained in the Arduino IDE bundle and we suggest that you use the Arduino-bundled version.
1. Unplug any programmer that may be connected to the computer
1. In the Arduino IDE Tools -> Board and select the Arduino Pro Mini board
1. Then click on Sketch -> Upload Using Programmer
1. After a series of compiling messages you will see an error that a programmer is not found. Scroll up and find the programming command that caused the errors (usually the last white line before the red errors) and copy it into TextEdit or Notepad.
1. This is the command we will be modifying to verify, program and set fuses.
It should look something like this:
**Mac:**
> /Applications/Arduino.app/Contents/Java/hardware/tools /avr/bin/avrdude -C/Applications/Arduino.app/Contents/ Java/hardware/tools/avr/etc/avrdude.conf -patmega328p -cusbasp -Pusb -Uflash:w:{this part will be unique to your system} /Multiprotocol.ino.hex:i
**PC:**
> C:\Program Files (x86)\Arduino\Contents\Java\hardware\tools\ avr\bin\avrdude -CC:\Program Files (x86)\Arduino\Contents\Java\ hardware\tools\avr\etc\avrdude.conf -patmega328p -cusbasp -Pusb -Uflash:w:{this part will be unique on your system}\ Multiprotocol.ino.hex:i
## Step 2. Modifying the command
### Verify commnad
Select all the text up to the ```-Uflash ``` command, copy it and paste it into a new line and add a “-v” (without the "") at the end of the line.
This is your “verify” command and it should look something like this:
> /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/ tools/avr/etc/avrdude.conf -patmega328p -cusbasp -Pusb -v
### Program command
Select all the text up to and including the ```-Uflash:w: ```, copy it and paste it into a new line. Add the full name of the .hex firmware file you wish to upload, including the ".hex" suffix, and at the end add a ":i". There should be no spaces before or after the file name.
This is your “program” command and it should look something like this:
> /Applications/Arduino.app/Contents/Java/hardware/tools /avr/bin/avrdude -C/Applications/Arduino.app/Contents/ Java/hardware/tools/avr/etc/avrdude.conf -patmega328p -cusbasp -Pusb -Uflash:w:**Multiprotocol.ino.hex**:i
We will be using the command line to program the module.
## STEP 3: Verify
Check that your USBASP programmer is set to 3.3.V (make 100% certain or you will blow all your RF modules). Plug your USBASP into your computer and connect it to the ISP pins on your MULTI-Module.
Open a terminal or command window and change to the directory where your .hex file is located
Copy and past the "verify" command from above into the terminal and press enter. You should see an output that looks something like this. Confirm that a connection has been made with the MCU. It may be important to note and record the fuse settings and compare them with the table above.
Once you have established that the programmer is connecting correctly move on to the programming step.
## STEP 4: Program
Copy and past the "program" command from above into the terminal and press enter. You should see an output shows that the correct board has been identified and progress uploading the firmware.
If this completes successfully you have flashed the new firmware onto the board.
## STEP 5: Set Fuses
1. It is always good practice to check on the connection with the board before you program fuses. This is the one step that could "brick" your MCU. Paste the "verify" command from above into a command line terminal. It should retun with messages that indicate an ATmega328p was successfully found and it should return the current fuse settings.
1. To program the Low Fuse to 0xFF (for example) copy the “verify” command and paste it into the shell add the following text to the end of the line ```-U lfuse:w:0xFF:m ``` . Press Enter. **Note: If you want a different fuse setting, change the 0xFF with the hexadecimal value of the low fuse setting.**
1. To program the Extended Fuse to 0xFD (for example) copy the “verify” command and paste it into the shell add the following text to the end of the line ```-U efuse:w:0xFD:m ``` . Press Enter. **Note: If you want a different fuse setting, change the 0xFD with the hexadecimal value of the extended fuse setting.**
1. There are two options for the High fuse.
- If you selected the 4-in-1 Board in the Arduino IDE then you compiled firmware to not include the unecessary Arduino bootloader. To program the High Fuse to 0xD3 (for example) copy the “verify” command and paste it into the shell and add the following text to the end of the line ```-U hfuse:w:0xD3:m ``` . Press Enter. **Note: If you want a different fuse setting, change the 0xD3 with the hexadecimal value of the extended fuse setting.**
- If you selected the Arduino Pro-Mini (or any other Arduino board) in the Arduino IDE then you compiled firmware to include the Arduino bootloader. To program the High Fuse to 0xD2 (for example) copy the “verify” command and paste it into the shell and add the following text to the end of the line ```-U hfuse:w:0xD2:m ``` . Press Enter. **Note: If you want a different fuse setting, replace the 0xD2 with the hexadecimal value of the extended fuse setting.**
## Upload the firmware
1. Follow this section: [Connect the programmer](Compiling.md#connect-the-programmer)
1. Download the [latest release firmware](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/releases) you want to burn and store it in a knwon location
1. Launch AVR8 Burn-O-Mat.
1. In the **AVR type** drop down select **ATmega328P**
1. Under **Flash** select the file you've just downloaded
1. Under **Flash** click on **Write**
1. Ignore the error "warning : Can not Set sck period . usbasp please check for firmware update .".
1. If you get an error there is something wrong with your connections, your programmer, or your board. Verify everything and go back to the 1st bullet point.
1. You are done with uploading the firmware. Your module is ready to operate.

View File

@ -1,20 +1,53 @@
#Advanced Topics {This page is currently a proof of concept}
# Advanced Topics {This page is currently a proof of concept}
Warning: the topics on this page are not for the fainthearted. It is strongly recommended that you have some experience in getting up and runnning with your module before you dive in there. On the other hand what is described on this page are some very useful options that could greatly increase the value and the enjoyment of your Multiprotocol module.
#Serial uploader that works through the transmitter pins
# Serial uploader that works through the transmitter pins
This document describes how you can set up your ATmega-based Mulitprotocol module to allow you to update the firmware by connecting a USB to TTL serial (like a FTDI) adapter to the module's transmitter interface pins. It is great if you exclusively use the Serial interface with your transmitter because the Bind button is used as "bootloader" button. It requires a small custom bootloader to be uploaded and a simple interface cable to be soldered up. See the [Advanced ATmega Serial Uploader](Advanced_ATmega_Serial_Uploader.md) page for more details.
Created and supported by: Mike Blandford
RCGroups page: http://www.rcgroups.com/forums/showpost.php?p=35584619&postcount=4867
#Telemetry in PPM mode
# Telemetry in PPM mode
It is possible to access the telemetry stream coming from the receiver through the MULTI-module. This document describes a simple bluetooth module to stream telemetry information to a mobile device like an Android smartphone or tablet. The method may be generalized to feed telemetry to the transmitter if the transmitter has the capabilities to process the information. This is very useful with modules used in the PPM mode with transmitters that do not support telemetry. See the [Advanced Bluetooth Telemetry](Advanced_Bluetooth_Telemetry.md) page for more details.
Created and supported by: Midelic
RCGroups page: None
#Manually setting fuses on ATmega328
# Manually setting fuses on ATmega328
This document describes a relatively simple process to set the fuses on ATmega328 using the flexibility of the command line. It does not require installation of AVRdude because it uses the AVRdude that is bundled with the Arduino IDE. See the [Advanced Manually Setting ATmega328 Fuses](Advanced_Manually_Setting_ATmega328_Fuses.md) page for more details.
Created and supported by: hpnuts
Created and supported by: hpnuts
## Flashing Multi_STM32 module.
#### Flashing without Tx power
This is another method of Flshing Multi_STM32 which is riskier.This method is for skilled users who understand the task.
The key difference of this method is that the 3.3V FTDI cable must also provide power to the 5V circuitry during the flashing process. To do this, a jumper must be enabled connecting the 3.3V VCC to the 5V line. The risk is to forget 3.3V jumper in, after flashing and when TX restarted.
**If the module is powered through the transmitter and this jumper(3.3V) is enabled, then it will feed 5V throughout the 3.3V circuit and this will fry your RF modules. Do not plug the module into the transmitter before removing this jumper!**
**YOU HAVE BEEN WARNED!!!.**
1. Remove the module from the transmitter bay
1. Set BOOT0 jumper Skip this step if you made your own cable.
1. Set the 3.3V jumper.
1. Connect your 3.3V FTDI cable (USB - TTL serial) to Multiprotocol serial port (RX,TX,GND,5V).
Connect the pins as follows:
* Module RX pin to FTDI TX pin
* Module TX pin to FTDI Rx pin
* Module GND to FTDI GND
* Module 5V to FTDI 3.3V FTDI power supply
1. In arduino IDE under the **Tools** -> **Board:** check that you have selected the **Generic STM32F103C series** board
1. Under **Tools** -> **Upload Method:** select **Serial**.
1. Click "Upload" and the sketch will be uploaded normally.
1. Once the firmware has uploaded:
* Remove the 3.3V jumper!!!!
* Remove the BOOT0 jumper
* Check that you removed the 3.3V jumper
1. Insert the module into the transmitter bay
RCGroups page: No rcgroups page

View File

@ -1,8 +1,8 @@
#Bill of Materials DIY ATmega Module
# Bill of Materials DIY ATmega Module
Here is the bill of materials for the ATmega328 version of the DIY MPTM.
If you are looking for the BOM for the DIY STM32 version click [here](BOM_DIY_STM32.md).
If you are looking for the BOM for the DIY STM32 version click [here](BOM_DIY_STM32%20&amp;%20Schematic.md).
Digikey may not be your preferred supplier, but you should find enough information on their page to cross reference parts.

View File

@ -1,81 +1,29 @@
#Bill of Materials DIY STM32 Module
# Bill of Materials DIY STM32 Module
Here is the bill of materials for the STM32 version of the DIY MPTM. There are three versions. Carefully compare your board with the pictures below to determine which version you have.
All diagrams and eagle files are available [here](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/tree/master/STM32%20PCB)
If you are looking for the BOM for the DIY ATmega328 3.2d version click [here](BOM_DIY_ATmega.md).
Digikey may not be your preferred supplier, but you should find enough information on their page to cross reference parts.
## BOM DIY STM32 PCB - the first Version
This BOM is for the board that looks like this - check carefully:
<img src="https://camo.githubusercontent.com/9b8dc4eb5618583ebe8fc01f03f2da75766080b3/68747470733a2f2f36343464623464653335303563343061303434342d33323737323362636532393865336666353831336662343262616565666261612e73736c2e6366312e7261636b63646e2e636f6d2f66326435393865616364386539656562633338313861646634373737373139392e706e67" width="300" height="400"/>
## IMPORTANT NOTE on Telemetry
In the case of the Turnigy 9X/9XR/9XR Pro you don't need to invert the telemetry signal therefore the instalation of the inverter chip SN74LVC2G86DCTR is **OPTIONAL**. In this case and in order to have telemetry you need to solder **SJ1/SJ301** on the back of the board depending on which board version you have.
Qty|Part|Description|Value|Package|Digikey Part Number
---|----|-----------|-----|-------|-------------------
1|3.3VJumper|Jumper|1x2||[3M9467-ND](https://www.digikey.com/product-detail/en/3m/961102-5604-AR/3M9467-ND/2071508)
2|C1,C2|Cap Cera|0.1uF|0805|[311-1361-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V9BB104/311-1361-1-ND/2103145)
3|C3,8,9|Cap Tantal|22uF/16V|1206|[478-8254-1-ND](https://www.digikey.com/product-detail/en/avx-corporation/F931C226MAA/478-8254-1-ND/4005702)
1|D1|Diode Shottky|1N5819||[1N5819HW-FDICT-ND](https://www.digikey.com/product-detail/en/diodes-incorporated/1N5819HW-7-F/1N5819HW-FDICT-ND/815283)
1|IC1|Voltage reg 3.3V|AMS1117-33|SOT223|[LM1117MPX-3.3/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MPX-3.3-NOPB/LM1117MPX-3.3-NOPBCT-ND/1010516)
1|IC2|Voltage reg 5V|AMS1117-50|SOT223|[LM1117MP-5.0/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MP-5.0-NOPB/LM1117MP-5.0-NOPBCT-ND/363589)
1|J301|Receptacle|5-pin||[WM3103-ND](http://www.digikey.com/product-search/en?keywords=WM3103-ND)
1|JP1|Pin header|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|JP2|Pin header|1x4||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|L1|High Freq Inductor|10uH|1812|[CM453232-100KLCT-ND](https://www.digikey.com/product-detail/en/bourns-inc/CM453232-100KL/CM453232-100KLCT-ND/3437938)
1|LED|Red Led|LED3mm|||
2|R1,R8|SMD Resistor|2.2K|0805|[RMCF0805JT2K20CT-ND ](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT2K20/RMCF0805JT2K20CT-ND/1942563)
3|R2,R5,R10|SMD Resistor|10K|0805|[RMCF0805JT10K0CT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT10K0/RMCF0805JT10K0CT-ND/1942577)
1|R3|SMD Resistor|4.7K|0805|[311-4.70KCRCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805FR-074K7L/311-4.70KCRCT-ND/730876)
1|R5|SMD Resistor|1K|0805|[311-1.0KARCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805JR-071KL/311-1.0KARCT-ND/731165)
1|R7|SMD Resistor|470|0805|[RMCF0805JT470RCT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT470R/RMCF0805JT470RCT-ND/1942551)
1|Switch|Hex Switch||4-DIP|[FR01KR16P-W-S-ND](https://www.digikey.com/product-detail/en/nkk-switches/FR01KR16P-W-S/FR01KR16P-W-S-ND/2104098)
1|Switch|Momentary Switch||6mm|[ 450-1643-ND](https://www.digikey.com/product-detail/en/te-connectivity-alcoswitch-switches/2-1825910-7/450-1642-ND/1632528)
1|MCU|STM32F103CBT6||LQFP48|[STM32F103CBT6](https://www.digikey.com/product-detail/en/stmicroelectronics/STM32F103CBT6/497-6288-ND/1754420)
1|U$1|4-in-1 RF Module|||[Banggood 4-in-1 Module](http://www.banggood.com/DIY-2_4G-CC2500-NRF24L01-A7105-CYRF6936-Multi-RF-4-IN-1-Wireless-Module-p-1046308.html)
1|Y2|8mHz Resonator|8mHz||[490-1195-1-ND](https://www.digikey.com/product-detail/en/murata-electronics-north-america/CSTCE8M00G55-R0/490-1195-1-ND/584632)
1|U1|Dual INPUT-XOR|SN74LVC2G00DCTR|SSOP-8|[296-13257-1-ND](https://www.digikey.com/product-detail/en/texas-instruments/SN74LVC2G00DCTR/296-13257-1-ND/484537)
1|U.FL|SMD ant. conn.|||[WM5587CT-ND](https://www.digikey.com/product-detail/en/molex-llc/0734120110/WM5587CT-ND/1894612)
The inverted telemetry signal is required by TARANIS TX and other boards so for telemetry to work properly the inverter chip must be installed.
## BOM DIY STM32 PCB V1.1t - USB version update
The board is available at OSHpark [here](https://oshpark.com/shared_projects/eWtNW6jo)
<img src="images/Board_PCB_STM32_USB_V1.1-2.png" width="300" height="400"/> <img src="images/Board_PCB_STM32_USB_V1.1-1.png" width="300" height="400"/>
## BOM DIY STM32 PCB - the V0.8
This BOM is for the board that looks like the image below (avialble from OSHpark [here](https://oshpark.com/shared_projects/3IU1JXoN)) - check carefully:
<img src="https://camo.githubusercontent.com/b46c53c214cf87184d202f57f328413d3629ca24/68747470733a2f2f36343464623464653335303563343061303434342d33323737323362636532393865336666353831336662343262616565666261612e73736c2e6366312e7261636b63646e2e636f6d2f36633561613434363133356336363336613030383064623763613238663162652e706e67" width="300" height="400"/>
## BOM DIY STM32 PCB V1.0t & V1.1 - the USB version
This BOM is for the board with the USB port which allows firmware upload.
Qty|Part|Description|Value|Package|Digikey Part Number
---|----|-----------|-----|-------|-------------------
1|J301|Receptacle|5-pin||[WM3103-ND](http://www.digikey.com/product-search/en?keywords=WM3103-ND)
1|SV201|Jumper|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV202|Pin header|1x4||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV203|Pin header|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV204|Pin header|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
3|C101, 102, 103|Cap Tantal|22uF/16V|1206|[478-8254-1-ND](https://www.digikey.com/product-detail/en/avx-corporation/F931C226MAA/478-8254-1-ND/4005702)
7|C201, 202, 204, 205, 206, 209, 301|Cap Cera|0.1uF|0805|[311-1361-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V9BB104/311-1361-1-ND/2103145)
1|C203|Cap Cera|4u7|0805|[311-1371-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V6BB475/311-1371-1-ND/2103155)
1|C207|Cap Cera|1uF|0805|[311-1365-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805KKX7R7BB105/311-1365-1-ND/2103149)
1|C208|Cap Cera|10nF|0805|[311-1085-1-ND](http://www.digikey.com/product-detail/en/yageo/CC0603KRX7R9BB103/311-1085-1-ND/302995)
1|D301, D302, D303|Diode Shottky|BAT48||[497-5711-1-ND](https://www.digikey.com/product-detail/en/stmicroelectronics/BAT48JFILM/497-5711-1-ND/1299964)
1|IC101|Voltage reg 5V|AMS1117-50|SOT223|[LM1117MP-5.0/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MP-5.0-NOPB/LM1117MP-5.0-NOPBCT-ND/363589)
1|IC102|Voltage reg 3.3V|AMS1117-33|SOT223|[LM1117MPX-3.3/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MPX-3.3-NOPB/LM1117MPX-3.3-NOPBCT-ND/1010516)
1|L101|High Freq Inductor|10uH|1812|[CM453232-100KLCT-ND](https://www.digikey.com/product-detail/en/bourns-inc/CM453232-100KL/CM453232-100KLCT-ND/3437938)
1|LED101, LED102|Red/Green Led|LED3mm|||
2|R302, R303|SMD Resistor|2.2K|0805|[RMCF0805JT2K20CT-ND ](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT2K20/RMCF0805JT2K20CT-ND/1942563)
3|R202, R203|SMD Resistor|10K|0805|[RMCF0805JT10K0CT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT10K0/RMCF0805JT10K0CT-ND/1942577)
1|R301, R305|SMD Resistor|4.7K|0805|[311-4.70KCRCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805FR-074K7L/311-4.70KCRCT-ND/730876)
1|R101, 201|SMD Resistor|1K|0805|[311-1.0KARCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805JR-071KL/311-1.0KARCT-ND/731165)
1|R304|SMD Resistor|470|0805|[RMCF0805JT470RCT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT470R/RMCF0805JT470RCT-ND/1942551)
1|S201|Hex Switch||4-DIP|[FR01KR16P-W-S-ND](https://www.digikey.com/product-detail/en/nkk-switches/FR01KR16P-W-S/FR01KR16P-W-S-ND/2104098)
1|S202|Momentary Switch||6mm|[ 450-1643-ND](https://www.digikey.com/product-detail/en/te-connectivity-alcoswitch-switches/2-1825910-7/450-1642-ND/1632528)
1|IC201|STM32F103CBT6||LQFP48|[STM32F103CBT6](https://www.digikey.com/product-detail/en/stmicroelectronics/STM32F103CBT6/497-6288-ND/1754420)
1|M401|4-in-1 RF Module|||[Banggood 4-in-1 Module](http://www.banggood.com/DIY-2_4G-CC2500-NRF24L01-A7105-CYRF6936-Multi-RF-4-IN-1-Wireless-Module-p-1046308.html)
1|Y201|8mHz Resonator|8mHz||[490-1195-1-ND](https://www.digikey.com/product-detail/en/murata-electronics-north-america/CSTCE8M00G55-R0/490-1195-1-ND/584632)
1|U301|Dual INPUT-XOR|SN74LVC2G00DCTR|SSOP-8|[296-13257-1-ND](https://www.digikey.com/product-detail/en/texas-instruments/SN74LVC2G00DCTR/296-13257-1-ND/484537)
1|CON401|SMD ant. conn.|||[WM5587CT-ND](https://www.digikey.com/product-detail/en/molex-llc/0734120110/WM5587CT-ND/1894612)
The board is available at OSHpark [here](https://oshpark.com/shared_projects/GX51nEoH)
## BOM DIY STM32 PCB - the USB version
This BOM is for the board with the USB port for firmware uploading that looks like this - check carefully:
<img src="images/Board_PCB_STM32_USB-1.png" width="300" height="400"/> <img src="images/Board_PCB_STM32_USB-2.png" width="300" height="400"/>
Qty|Part|Description|Value|Package|Digikey Part Number
@ -84,33 +32,109 @@ Qty|Part|Description|Value|Package|Digikey Part Number
1|K201|USB Receptacle|USB||[732-2735-ND](https://www.digikey.com/product-search/en?keywords=651005136421)
1|SV201|Jumper|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV202|Pin header|1x4||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV203|Pin header|1x4||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV203|Pin header for future use, **NOT ISP**|2x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV204|Pin header|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
3|C101, 102, 103|Cap Tantal|22uF/16V|1206|[478-8254-1-ND](https://www.digikey.com/product-detail/en/avx-corporation/F931C226MAA/478-8254-1-ND/4005702)
7|C201, 202, 204, 205, 206, 209, 301|Cap Cera|0.1uF|0805|[311-1361-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V9BB104/311-1361-1-ND/2103145)
1|C203|Cap Cera|4u7|0805|[311-1371-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V6BB475/311-1371-1-ND/2103155)
1|C207|Cap Cera|1uF|0805|[311-1365-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805KKX7R7BB105/311-1365-1-ND/2103149)
1|C208|Cap Cera|10nF|0805|[311-1085-1-ND](http://www.digikey.com/product-detail/en/yageo/CC0603KRX7R9BB103/311-1085-1-ND/302995)
1|D201,301,302,303|Diode Shottky|BAT48||[497-5711-1-ND](https://www.digikey.com/product-detail/en/stmicroelectronics/BAT48JFILM/497-5711-1-ND/1299964)
3|C101, 102, 103|Cap Tantalum|22uF/16V (Band is +)|1206|[478-8254-1-ND](https://www.digikey.com/product-detail/en/avx-corporation/F931C226MAA/478-8254-1-ND/4005702)
7|C201, 202, 204, 205, 206, 209, 301|Cap Ceramic|0.1uF|0805|[311-1361-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V9BB104/311-1361-1-ND/2103145)
1|C203|Cap Ceramic|4u7|0805|[311-1371-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V6BB475/311-1371-1-ND/2103155)
1|C207|Cap Ceramic|1uF|0805|[311-1365-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805KKX7R7BB105/311-1365-1-ND/2103149)
1|C208|Cap Ceramic|10nF|0805|[311-1136-1-ND](http://www.digikey.com/products/en?keywords=311-1136-1-ND)
5|D101*,201,301,302,303|Diode Shottky|BAT48|SOD123|[497-5712-1-ND](http://www.digikey.com/products/en?keywords=497-5712-1-ND)
1|IC101|Voltage reg 5V|AMS1117-50|SOT223|[LM1117MP-5.0/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MP-5.0-NOPB/LM1117MP-5.0-NOPBCT-ND/363589)
1|IC102|Voltage reg 3.3V|AMS1117-33|SOT223|[LM1117MPX-3.3/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MPX-3.3-NOPB/LM1117MPX-3.3-NOPBCT-ND/1010516)
1|L101|High Freq Inductor|10uH|1812|[CM453232-100KLCT-ND](https://www.digikey.com/product-detail/en/bourns-inc/CM453232-100KL/CM453232-100KLCT-ND/3437938)
1|LED101, LED201|Red/Green Led|LED3mm|||
1|LED101|Green Led|LED3mm||[516-3191-1-ND](http://www.digikey.com/products/en?keywords=516-3191-1-ND)
1|LED201|Red Led|LED3mm||[516-1750-1-ND](http://www.digikey.com/products/en?keywords=516-1750-1-ND)
2|R101, 201|SMD Resistor|1K|0805|[311-1.0KARCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805JR-071KL/311-1.0KARCT-ND/731165)
1|R202|SMD Resistor|1.5K|0805|[311-1.5KARCT-ND](https://www.digikey.com/product-search/en?keywords=311-1.5KARCT-ND)
2|R203, 204|SMD Resistor|22K|0805|[311-22KARCT-ND](https://www.digikey.com/product-search/en?keywords=311-22KARCT-ND)
2|R203, 204|SMD Resistor|22|0805|[311-22ARCT-ND](https://www.digikey.com/product-search/en?keywords=311-22ARCT-ND)
1|R205|SMD Resistor|100K|0805|[311-100KARCT-ND](https://www.digikey.com/product-search/en?keywords=311-100KARCT-ND)
2|R206, R207|SMD Resistor|10K|0805|[RMCF0805JT10K0CT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT10K0/RMCF0805JT10K0CT-ND/1942577)
1|R301, R305|SMD Resistor|4.7K|0805|[311-4.70KCRCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805FR-074K7L/311-4.70KCRCT-ND/730876)
2|R301, R305|SMD Resistor|4.7K|0805|[311-4.70KCRCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805FR-074K7L/311-4.70KCRCT-ND/730876)
2|R302, R303|SMD Resistor|2.2K|0805|[RMCF0805JT2K20CT-ND ](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT2K20/RMCF0805JT2K20CT-ND/1942563)
1|R304|SMD Resistor|470|0805|[RMCF0805JT470RCT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT470R/RMCF0805JT470RCT-ND/1942551)
1|S201|Hex Switch||4-DIP|[FR01KR16P-W-S-ND](https://www.digikey.com/product-detail/en/nkk-switches/FR01KR16P-W-S/FR01KR16P-W-S-ND/2104098)
1|S201|Hex Switch||DIP|[563-1065-ND](https://www.digikey.com/product-detail/en/copal-electronics-inc/SD-1110/563-1065-ND/948376)
1|S202|Momentary Switch||6mm|[450-1643-ND](https://www.digikey.com/product-detail/en/te-connectivity-alcoswitch-switches/2-1825910-7/450-1642-ND/1632528)
1|IC201|STM32F103CBT6||LQFP48|[STM32F103CBT6](https://www.digikey.com/product-detail/en/stmicroelectronics/STM32F103CBT6/497-6288-ND/1754420)
1|M401|4-in-1 RF Module|||[Banggood 4-in-1 Module](http://www.banggood.com/DIY-2_4G-CC2500-NRF24L01-A7105-CYRF6936-Multi-RF-4-IN-1-Wireless-Module-p-1046308.html)
1|Y201|8mHz Resonator|8mHz||[490-1195-1-ND](https://www.digikey.com/product-detail/en/murata-electronics-north-america/CSTCE8M00G55-R0/490-1195-1-ND/584632)
1|U301|Dual INPUT-XOR|SN74LVC2G86DCTR|SSM8|[296-13274-1-ND](http://www.digikey.com/product-detail/en/texas-instruments/SN74LVC2G86DCTR/296-13274-1-ND/484501)
1|CON401|ANT.conn SMD|||[WM5587CT-ND](https://www.digikey.com/product-detail/en/molex-llc/0734120110/WM5587CT-ND/1894612)
* Diode D101 is only required for the V1.1 board
PCB STM32 V1.0t Schematic
<img src="https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/blob/master/STM32%20PCB/Schematic_Multiprotocol_STM32_MB_v1.0_t.jpg" width="1000" height="500" />
## BOM DIY STM32 PCB - the V0.8
This BOM is for the board that looks like the image below (avialble from OSHpark [here](https://oshpark.com/shared_projects/3IU1JXoN)) - check carefully:
<img src="images/Multi_STM32_V0.8_t_1.png" width="300" height="400"/> <img src="images/Multi_STM32_V0.8_t_2.png" width="300" height="400"/>
Qty|Part|Description|Value|Package|Digikey Part Number
---|----|-----------|-----|-------|-------------------
1|J301|Receptacle|5-pin||[WM3103-ND](http://www.digikey.com/product-search/en?keywords=WM3103-ND)
1|SV201|Jumper|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV202|Pin header|1x4||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV203|Pin header|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|SV204|Pin header|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
3|C101, 102, 103|Cap Tantalum|22uF/16V (Band is +)|1206|[478-8254-1-ND](https://www.digikey.com/product-detail/en/avx-corporation/F931C226MAA/478-8254-1-ND/4005702)
7|C201, 202, 204, 205, 206, 209, 301|Cap Ceramic|0.1uF|0805|[311-1361-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V9BB104/311-1361-1-ND/2103145)
1|C203|Cap Ceramic|4u7|0805|[311-1371-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V6BB475/311-1371-1-ND/2103155)
1|C207|Cap Ceramic|1uF|0805|[311-1365-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805KKX7R7BB105/311-1365-1-ND/2103149)
1|C208|Cap Ceramic|10nF|0805|[311-1085-1-ND](http://www.digikey.com/product-detail/en/yageo/CC0603KRX7R9BB103/311-1085-1-ND/302995)
3|D301, D302, D303|Diode Shottky|BAT48|SOD123|[497-5712-1-ND](http://www.digikey.com/products/en?keywords=497-5712-1-ND)
1|IC101|Voltage reg 5V|AMS1117-50|SOT223|[LM1117MP-5.0/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MP-5.0-NOPB/LM1117MP-5.0-NOPBCT-ND/363589)
1|IC102|Voltage reg 3.3V|AMS1117-33|SOT223|[LM1117MPX-3.3/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MPX-3.3-NOPB/LM1117MPX-3.3-NOPBCT-ND/1010516)
1|L101|High Freq Inductor|10uH|1812|[CM453232-100KLCT-ND](https://www.digikey.com/product-detail/en/bourns-inc/CM453232-100KL/CM453232-100KLCT-ND/3437938)
1|LED101|Green Led|LED3mm||[516-3191-1-ND](http://www.digikey.com/products/en?keywords=516-3191-1-ND)
1|LED201|Red Led|LED3mm||[516-1750-1-ND](http://www.digikey.com/products/en?keywords=516-1750-1-ND)
2|R302, R303|SMD Resistor|2.2K|0805|[RMCF0805JT2K20CT-ND ](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT2K20/RMCF0805JT2K20CT-ND/1942563)
3|R202, R203|SMD Resistor|10K|0805|[RMCF0805JT10K0CT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT10K0/RMCF0805JT10K0CT-ND/1942577)
1|R301, R305|SMD Resistor|4.7K|0805|[311-4.70KCRCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805FR-074K7L/311-4.70KCRCT-ND/730876)
1|R101, 201|SMD Resistor|1K|0805|[311-1.0KARCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805JR-071KL/311-1.0KARCT-ND/731165)
1|R304|SMD Resistor|470|0805|[RMCF0805JT470RCT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT470R/RMCF0805JT470RCT-ND/1942551)
1|S201|Hex Switch||DIP|[563-1065-ND](https://www.digikey.com/product-detail/en/copal-electronics-inc/SD-1110/563-1065-ND/948376)
1|S202|Momentary Switch||6mm|[ 450-1643-ND](https://www.digikey.com/product-detail/en/te-connectivity-alcoswitch-switches/2-1825910-7/450-1642-ND/1632528)
1|IC201|STM32F103CBT6||LQFP48|[STM32F103CBT6](https://www.digikey.com/product-detail/en/stmicroelectronics/STM32F103CBT6/497-6288-ND/1754420)
1|M401|4-in-1 RF Module|||[Banggood 4-in-1 Module](http://www.banggood.com/DIY-2_4G-CC2500-NRF24L01-A7105-CYRF6936-Multi-RF-4-IN-1-Wireless-Module-p-1046308.html)
1|Y201|8mHz Resonator|8mHz||[490-1195-1-ND](https://www.digikey.com/product-detail/en/murata-electronics-north-america/CSTCE8M00G55-R0/490-1195-1-ND/584632)
1|U301|Dual INPUT-XOR|SN74LVC2G00DCTR|SSOP-8|[296-13257-1-ND](https://www.digikey.com/product-detail/en/texas-instruments/SN74LVC2G00DCTR/296-13257-1-ND/484537)
1|CON401|ANT.conn SMD|||[WM5587CT-ND](https://www.digikey.com/product-detail/en/molex-llc/0734120110/WM5587CT-ND/1894612)
1|U301|Dual INPUT-XOR|SN74LVC2G86DCTR|SSM8|[296-13274-1-ND](http://www.digikey.com/product-detail/en/texas-instruments/SN74LVC2G86DCTR/296-13274-1-ND/484501)
1|CON401|SMD ant. conn.|||[WM5587CT-ND](https://www.digikey.com/product-detail/en/molex-llc/0734120110/WM5587CT-ND/1894612)
## BOM DIY STM32 PCB - the first Version
This BOM is for the board that looks like this - check carefully:
<img
src="https://644db4de3505c40a0444-327723bce298e3ff5813fb42baeefbaa.ssl.cf1.rackcdn.com/2026cfd1d0187a770570052590168df1.png" width="300" height="400"/> <img src="https://camo.githubusercontent.com/9b8dc4eb5618583ebe8fc01f03f2da75766080b3/68747470733a2f2f36343464623464653335303563343061303434342d33323737323362636532393865336666353831336662343262616565666261612e73736c2e6366312e7261636b63646e2e636f6d2f66326435393865616364386539656562633338313861646634373737373139392e706e67" width="300" height="400"/>
Qty|Part|Description|Value|Package|Digikey Part Number
---|----|-----------|-----|-------|-------------------
1|3.3VJumper|Jumper|1x2||[3M9467-ND](https://www.digikey.com/product-detail/en/3m/961102-5604-AR/3M9467-ND/2071508)
2|C1,C2|Cap Ceramic|0.1uF|0805|[311-1361-1-ND](https://www.digikey.com/product-detail/en/yageo/CC0805ZRY5V9BB104/311-1361-1-ND/2103145)
3|C3,8,9|Cap Tantalum|22uF/16V (Band is +)|1206|[478-8254-1-ND](https://www.digikey.com/product-detail/en/avx-corporation/F931C226MAA/478-8254-1-ND/4005702)
1|D1|Diode Shottky|1N5819||[1N5819HW-FDICT-ND](https://www.digikey.com/product-detail/en/diodes-incorporated/1N5819HW-7-F/1N5819HW-FDICT-ND/815283)
1|IC1|Voltage reg 3.3V|AMS1117-33|SOT223|[LM1117MPX-3.3/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MPX-3.3-NOPB/LM1117MPX-3.3-NOPBCT-ND/1010516)
1|IC2|Voltage reg 5V|AMS1117-50|SOT223|[LM1117MP-5.0/NOPBCT-ND](https://www.digikey.com/product-detail/en/texas-instruments/LM1117MP-5.0-NOPB/LM1117MP-5.0-NOPBCT-ND/363589)
1|J301|Receptacle|5-pin||[WM3103-ND](http://www.digikey.com/product-search/en?keywords=WM3103-ND)
1|JP1|Pin header|1x3||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|JP2|Pin header|1x4||[S1011EC-40-ND](https://www.digikey.com/product-detail/en/sullins-connector-solutions/PRPC040SAAN-RC/S1011EC-40-ND/2775214)
1|L1|High Freq Inductor|10uH|1812|[CM453232-100KLCT-ND](https://www.digikey.com/product-detail/en/bourns-inc/CM453232-100KL/CM453232-100KLCT-ND/3437938)
1|LED|Red Led|LED3mm||[516-1750-1-ND](http://www.digikey.com/products/en?keywords=516-1750-1-ND)
2|R1,R8|SMD Resistor|2.2K|0805|[RMCF0805JT2K20CT-ND ](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT2K20/RMCF0805JT2K20CT-ND/1942563)
3|R2,R5,R10|SMD Resistor|10K|0805|[RMCF0805JT10K0CT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT10K0/RMCF0805JT10K0CT-ND/1942577)
1|R3|SMD Resistor|4.7K|0805|[311-4.70KCRCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805FR-074K7L/311-4.70KCRCT-ND/730876)
1|R5|SMD Resistor|1K|0805|[311-1.0KARCT-ND](https://www.digikey.com/product-detail/en/yageo/RC0805JR-071KL/311-1.0KARCT-ND/731165)
1|R7|SMD Resistor|470|0805|[RMCF0805JT470RCT-ND](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/RMCF0805JT470R/RMCF0805JT470RCT-ND/1942551)
1|Switch|Hex Switch||DIP|[563-1065-ND](https://www.digikey.com/product-detail/en/copal-electronics-inc/SD-1110/563-1065-ND/948376)
1|Switch|Momentary Switch||6mm|[ 450-1643-ND](https://www.digikey.com/product-detail/en/te-connectivity-alcoswitch-switches/2-1825910-7/450-1642-ND/1632528)
1|MCU|STM32F103CBT6||LQFP48|[STM32F103CBT6](https://www.digikey.com/product-detail/en/stmicroelectronics/STM32F103CBT6/497-6288-ND/1754420)
1|U$1|4-in-1 RF Module|||[Banggood 4-in-1 Module](http://www.banggood.com/DIY-2_4G-CC2500-NRF24L01-A7105-CYRF6936-Multi-RF-4-IN-1-Wireless-Module-p-1046308.html)
1|Y2|8mHz Resonator|8mHz||[490-1195-1-ND](https://www.digikey.com/product-detail/en/murata-electronics-north-america/CSTCE8M00G55-R0/490-1195-1-ND/584632)
1|U301|Dual INPUT-XOR|SN74LVC2G86DCTR|SSM8|[296-13274-1-ND](http://www.digikey.com/product-detail/en/texas-instruments/SN74LVC2G86DCTR/296-13274-1-ND/484501)
1|U.FL|SMD ant. conn.|||[WM5587CT-ND](https://www.digikey.com/product-detail/en/molex-llc/0734120110/WM5587CT-ND/1894612)
PCB STM32 V0.1 Schematic
<img src="https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/blob/master/STM32%20PCB/v0.1/Schematic_Multiprotocol_STM32_MB_v0.1.png" width="1000" height="500" />

View File

@ -1,4 +1,4 @@
#Getting your Bind timing right.
# Getting your Bind timing right.
On many consumer models it it important for the Tx to send a bind signal in a narrow window once the model has powered up.
If the bind signal is not recieved during this window, the bind sequence times out. Try this:

View File

@ -1,199 +1,150 @@
# Compiling and Programming (ATmega 328P)
**If you are Compling for the STM32 version of the Multiprotocol Module please go to the dedicated [Compiling and Programming STM32](Compiling_STM32.md) page.**
Multiprotocol source are compiled using the well known Arduino IDE.
**This page describes the basic Compiling and Programming process. There are some other more advanced processes that have some superior features described under the [Advanced Topics](Advanced_Topics.md) page.** Some options are:
- Using an FTDI cable to upload firmware over the module - Tx pins
The procedure below will guide you through all the steps to upload successfully a customized firmware.
**If you wish to upload one of prepared binary files please see the page [Manually programming and setting fuses](Advanced_Manually_Setting_ATmega328_Fuses.md).**
Multiprotocol source can be compiled using the Arduino IDE.
##Install the Arduino IDE and the Multiprotocol project
1. Download the Arduino IDE. The currently supported Arduino version is 1.6.10. available for [Windows]( https://www.arduino.cc/download_handler.php?f=/arduino-1.6.10-windows.exe) and [Mac OSX](http://arduino.cc/download_handler.php?f=/arduino-1.6.10-macosx.zip)
## Install the Arduino IDE and the Multiprotocol project firmware
1. Download and install the Arduino IDE. The currently supported Arduino version is 1.6.12. available for [Windows]( https://www.arduino.cc/download_handler.php?f=/arduino-1.6.12-windows.exe) and [Mac OSX](https://www.arduino.cc/download_handler.php?f=/arduino-1.6.12-macosx.zip)
1. It is recommended to upgrade Java to the [latest version](https://www.java.com/en/download/)
1. Download the zip file with the Multiprotocol module source code from [here](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/archive/master.zip)
1. Unzip and copy the source code folder **Multiprotocol** to a folder of your choosing
1. Click on the **Multiprotocol.ino** file in the **Multiprotocol** folder and the Arduino environment should appear and the Multiprotocol project will be loaded.
##Prepare the Arduino IDE:
The Arduino IDE must be customized to optimally compile the firmware. The following additions to the environment will remove the Arduino bootloader to free up additional memory for protocols.
###Mac OSX:
1. Using finder navigate to ```Applications``` folder
1. Ctl-Click on the Arduino application and select **Show Package Contents**.
1. Browse to ```Contents/Java/hardware/arduino/avr`` and double click on boards.txt
1. Copy and paste the following text into the end of the file and save it:
## Upload the firmware
```
##############################################################
## Multi 4-in-1 (3.3V, 16 MHz) w/ ATmega328
## --------------------------------------------------
multi.name=Multi 4-in-1
### Material you need to upload the firmware
multi.upload.tool=avrdude
multi.upload.protocol=arduino
1. USBASP programmer supporting 3.3V: <br> <img src="images/USBasp_Programmer.jpeg" width="200" height="200"/> <br> [(example aliexpress link)](https://www.aliexpress.com/item/USBasp-USB-ISP-3-3V-5V-AVR-Programmer-USB-ATMEGA8-ATMEGA128-New-10PIN-Wire-Support/2036402518.html?spm=2114.30010308.8.10.jIbHzs) <br> There are reports that some of the cheap programmers are not safe to use with 3.3V units, usually the black PCB versions are ok. <br>
1. 10pin to 6pin adapter: <br> <img src="images/10pin_2_6pin.JPG" width="150" height="150"/> <br> [(example ebay link)](http://www.ebay.fr/itm/10-Pin-a-6-Pin-Carte-Adaptateur-M-F-pour-AVRISP-USBASP-STK500-Noir-Bleu-WT-/291862396761?hash=item43f45abf59:g:gXsAAOSwMgdXyGnh) <br>
1. 6 pin header like this one: <br> <img src="images/6pin_header.jpg" width="100" height="100"/> <br> [(example Digi-Key link)](http://www.digikey.com/products/en?keywords=3M%20961206-6404-AR) <br>
1. The 6 Pin header needs to be solder on the board like indicated by the red rectangle:
* Banggood readymade 4-in-1 module: <br><img src="images/V2b_ISP.jpeg" width="189" height="200"/> <br>
* DIY Mulitprotocol modules (like the 2.3d board): <br><img src="images/MPTM_PCB_2.3d_ISP.png" width="486" height="201"/> <br>
* Arduino Pro Mini module: <br><img src="images/ProMini_ISP.png" width="195" height="200"/> <br>
multi.bootloader.tool=avrdude
multi.bootloader.unlock_bits=0x3F
multi.bootloader.lock_bits=0x0F
### Connect the programmer
multi.build.board=AVR_PRO
multi.build.core=arduino
multi.build.variant=eightanaloginputs
multi.build.extra_flags=-Wl,--relax
1. Before you connect the programmer make sure that you have selected the 3.3V mode and not 5V. The RF Modules are not 5V tolerant and you will break them with 5V. On most programmers this is done by moving a jumper. <br> <img src="images/USBasp_Programmer_jumper.png" width="200" height="200" />
1. Please re-read item 1. above before going on.
1. Turn the rotary switch on the DIY Multiprotocol module to the 0 position. If you do not have a switch for Serial mode only then it is the same as being in the 0 position. The upload will not work if the switch is in any other position.
1. Connect the 6-pin programming connector to the 6-pin ASP IVR connector on the DIY Multiprotocol board. Be sure to match the ground pin of the programmer connector to the ground pin on the board.
multi.menu.cpu.16MHzatmega328=ATmega328 (3.3V, 16 MHz)
The images below indicates the pin layout and the location of the ground pin on the board:
* Banggood readymade 4-in-1 module: <br> <img src="images/V2b_ISP.jpeg" width="189" height="200" /> <br>
* DIY Mulitprotocol modules (like the 2.3d board): <br> <img src="images/MPTM_PCB_2.3d_ISP.png" width="486" height="201" /> <br>
* Arduino Pro Mini module: <br> <img src="images/ProMini_ISP.png" width="195" height="200" /> <br>
multi.menu.cpu.16MHzatmega328.upload.maximum_size=32768
multi.menu.cpu.16MHzatmega328.upload.maximum_data_size=2048
multi.menu.cpu.16MHzatmega328.upload.speed=57600
You are now ready to plug in the USB programmer to the computer
multi.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF
multi.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xD3
multi.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0xFD
If you are looking for a good working USBASP Windows driver, [use this one](http://www.protostack.com/download/USBasp-win-driver-x86-x64-v3.0.7.zip).
multi.menu.cpu.16MHzatmega328.build.mcu=atmega328p
multi.menu.cpu.16MHzatmega328.build.f_cpu=16000000L
##############################################################
```
Close and reopen the Arduino IDE and load the Multiprotocol project.
### Windows:
Using File Explorer navigate to
```C:\Program Files(x86)\Arduino\hardware\arduino\avr ```
Open ```boards.txt``` in your favourite text editor (Notepad)
Copy and paste the "Multi 4-in-1" text listed above into the end of the file and save it.
Close and reopen the Arduino IDE and load the Multiprotocol project.
## Common process for OSX and Windows
If you have module with an Arduino Pro-Mini then scroll down to [Programming Arduino Pro-Mini Boards](#Programming_Arduino_Pro_Mini)
If you are using one of the DIY Mulitprotocol modules with the ATmega soldered directly to a PCB (like the 3.2d board or the Banggood readymade 4-in-1 module) then follow these instructions.
###Preparing for ATMega328P microcontroller
1. Under the Tools -> Board select the Multi 4-in-1 board
1. Under Tools -> Programmer select your programmer (probably USBASP)
### Configure Arduino IDE for Multiprotocol
1. Under Tools -> Board select the Arduino Pro or Pro Mini
1. Under Tools -> Processor select the ATmega328 (5V, 16MHz)
1. Under Tools -> Programmer select your programmer type (probably USBASP from the shopping list above)
<a name="CustomizeFirmareToYourNeeds"></a>
###Customize the firmware to your hardware and your needs
On all modules with ATMega microprocessors, the memory required for all the protocols exceeds the available 32k of flash memory. You will need to select which protocols you wish to use that will fit into the available memory.
Before customizing your firmware it would be good to review the protocol on the [Protocol Details](../Protocols_Details.md) page and to identify the protocols you would like to support on your module.
At the same time make a note of RF modules required by your protocols. For example, if you do not wish to use the FlySky or the Husan protocols then you do not need to compile support the the A7105 RF Module into your firmware. Similarly, if you have no need to bind with ASSAN RC receivers then you do not need to compile the ASSAN protocol into your firmware.
If you plan to use the PPM communication interface with your transmitter, then you need to perform protocol selection with the 16 position switch on your module. This will limit the available protocols you can usefully include on your firmware to 15. You should make a list of your 15 chosen protocols, sub protocols and options like this:
Switch Position|Protocol|Sub-Protocol|Option|Notes
---------------|--------|------------|------|-----
1.|DSM|DSM2|2|6 channels @ 22ms
2.|DSM|DSMX|6|6 channels @ 11ms
....|...|...|...|...
....|...|...|...|...
15.|FRSKYX|CH_16| |FrSky X receiver 16 chan
With the above information (required RF modules, selected protocols and 16 pos switch mapping) you are ready to customize your firmware.
### Customize the firmware to match your hardware and your needs
All customization is done by editing the ```_Config.h ``` file in the Multiprotocol Arduino project.
In the Arduino IDE and click on the down arrow on the far right of the tab bar to show a list of project files (see the red circle on the screenshot below). Scroll down and select the _Config.h file.
<img src="images/Arduino.png" width="600" height="400" />
In the Arduino IDE, click on the down arrow on the far right of the tab bar to show a list of project files (see the red circle on the screenshot below). Scroll down and select the _Config.h file. <br> <img src="images/Arduino.png" width="600" height="400" />
Comment out any of the RF modules that you do not need by typing ```// ``` at the begining of the line that reads :
```#define <RF Module name>_INSTALLED ``` . The following line shows the CC2500 module removed
The file has different sections which are explained in details. The best is to go through them one by one carefully and apply the configuration which matches your needs.
> ```#define A7105_INSTALLED ```
Most of the default settings should get you started quickly. But on modules with ATMega microcontrollers, the memory required for all the protocols exceeds the available 32KB of flash memory. You therefore need to select which protocols you wish to use in order to fit them into the available memory.
> ```#define CYRF6936_INSTALLED ```
To fill in the "PROTOCOLS TO INCLUDE" section, it would be good to review all the available protocols on the [Protocol Details](../Protocols_Details.md) page and identify which one you would like to add on your module.
> **```//#define CC2500_INSTALLED ```**
To check that the program will compile correctly and fit in the Atmega press the Check mark as shown below. <br> <img src="images/Arduino_check.jpg" width="99" height="130" />
> ```#define NFR24L01_INSTALLED ```
Scroll down to the available protocols and comment out all the protocols you will not require. The following example shows the DEVO protocol commented out.
> ```#ifdef CYRF6936_INSTALLED ```
> **``` // #define DEVO_CYRF6936_INO ```**
> ``` #define DSM_CYRF6936_INO ```
> ``` #define J6PRO_CYRF6936_INO ```
> ``` #endif ```
If you have a Taranis Tx and you plan on using Serial mode with telemetry find and uncomment the INVERT_TELEMETRY line below:
> ```//Uncomment to invert the polarity of the telemetry serial signal.```
> ```//For ER9X and ERSKY9X it must be commented. For OpenTX it must be uncommented.```
> ```#define INVERT_TELEMETRY 1```
Scroll down to the bottom of the file and list your switch mapping to your desired **protocol/sub-protocol/options**. You typically only need to change the three relevant columns. On models that require a rebind on every start-up (like Syma quads) you can change the **```NO_AUTOBIND ```** to **```AUTOBIND ```**.
You can now compile the firmware by clicking on the check mark (Tooltip: Verify) on the menu bar. If everything goes according to plan you should see something like the following line in the lower pane of the window:
> Sketch uses 32,464 bytes (99%) of program storage space. Maximum is 32,768 bytes.
> Global variables use 1,219 bytes (59%) of dynamic memory, leaving 829 bytes for local variables. Maximum is 2,048 bytes.
if you see something like the following, your firmware is still too big and you need to deselect additional protocols:
If you see something like the following, your firmware is still too big and you need to deselect additional protocols:
> Sketch uses 34,096 bytes (104%) of program storage space. Maximum is 32,768 bytes.
> Global variables use 1,236 bytes (60%) of dynamic memory, leaving 812 bytes for local variables. Maximum is 2,048 bytes.
> Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
> Sketch too big.
If there is another error carefully read the error to see the approximate line number where you made a typing error.
If there is another error carefully read it, go to the line number indicated and correct your typo.
### Flash the firmware
###Connecting the programmer
If you are programming the Readymade Banggood 4-in-1 module or any of the DIY ATmega boards you should follow the process below. If you will be programming a module based on an Arduino Pro Mini please see the section below titled "[Programming Arduino Pro Mini](#Programming_Arduino_Pro_Mini)".
To complete this step you need an USBASP programmer like the one shown below and a 10-pin to 6-pin programming cable.
<img src="images/USBasp_Programmer.jpeg" width="200" height="200" />
1. Before you connect the programmer make sure that you have selected the 3.3V mode and not the 5V mode. The RF Modules are not 5V tolerant and you will harm with 5V. On most programmers this is done by moving a jumper on the programmer.
1. Please re-read item 1. above before going on.
1. Turn the rotary switch on the DIY Multiprotocol module to the 0 position. If you do not have a switch (if you are using only Serial mode) then it the same as being in the 0 position. The upload will not work if the switch is in any other position.
1. Connect the 6-pin programming connector to the 6-pin ASP IVR connector on the DIY Multiprotocol board. Be sure to match the ground pin of the programmer connector to the ground pin on the board (see the images below for the pin layout and the location of the ground pin on the board) {insert pictures AVR ISP Pinout.png and images of boards with ground pin marked}
1. You are now ready to plug in the USB programmer to the computer
1. The first step is to flash the fuses of the microprocessor. These correct fuses will do a few things:
- Prevent the EEPROM from being erased each time the firmware is flashed. This will preserve your Tx ID and save you from having to rebind all your models after an update of the firmware
- Configure the clock source of the board - this is very important if you built the board from components. The ATMega328P microprocessor is configured at the factory to use an internal 8Mhz clock. The DIY Multiprotocol boards have a much more accurate 16MHz external crystal and the fuses will tell the MCU to use this clock source. (If you were able to flash the board but after setting the fuses the board no longer responds, it is very likely that you have a problem with your external clock.)
- Set the program counter to point at the right place when the module is powered up. The fuses configure the MCU to use a bootloader or not. If you compiled the firmware without a bootloader then the fuses must be set accordingly.
1. In the Arduino IDE ensure that the **4-in-1 Multi** is selected under **Tools -> Board:** click on **Tools -> Burn Bootloader**. Do not worry if it returns the error that no bootloader was found (in the case of the 4-in-1 board), it has burned the fuses. If you IDE was set to provide verbose compilation and uploading output, you should be able to see the final value of the fuses in the Arduino IDE.
1. If you have a 4in1 Multiprotocol module you can skip this step. If you've just finished to build your DIY Multiprotocol module (like v2.3d), the first step is to flash the fuses of the microcontroller. This needs to be done only once. For this purpose, click on **Tools -> Burn Bootloader**
1. You are now ready to flash the firmware. In the Arduino IDE click **Sketch -> Upload Using Programmer**.
2. If you get an error that indicates a valid microprocessor was not found there is something wrong with:
If the output indicates that the firmware has been uploaded successfully - give yourself a pat on the back. Well done, you have successfully programmed your DIY Multiprotocol module. You can already go to the final step [Setting up your Transmitter](Transmitters.md#compatible-transmitters) and begin to fly!!!! But don't forget to visit the next topic [Advanced settings](#AdvancedSettings) which has some extra steps needed to use your module at his full potential.
**Troubleshooting**
If you get an error that indicates "warning : Can not Set sck period . usbasp please check for firmware update ." just ignore it, everything is fine.
If you get an error that indicates a valid microcontroller was not found there is something wrong with:
- your connections,
- your programmer, or
- your board
- Google around with the specific error message to get suggestions of how to fix it. The most common cause is problems with the connection setup and in some cases problems with the cheap programmers from Chinese sources.
If the output indicates that the fuses have been successfully written and the firmware has been uploaded - give yourself a pat on the back. Well done, you have successfully programmed your DIY Multiprotocol module and you are ready to go on to the final step [Setting up your Transmitter](TransmitterSetup.md) before you can begin to fly!!!!
<a name="AdvancedSettings"></a>
## Advanced settings
<a name="Programming_Arduino_Pro_Mini"></a>
##Programming Arduino Pro-Mini Boards <a name="Programming_Arduino_Pro_Mini"></a>
Use this method only for Arduino Pro Mini boards with bootloader.
So you followed the previous steps and your module is working.
Below are some extra steps which will:
- Prevent the EEPROM from being erased each time the firmware is flashed. This will preserve your Tx ID and save you from having to rebind all your models after an update of the firmware.
- Permit to flash even more protocols (extra 2KB)
1. Use an external FTDI adapter like one of these options:
<img src="images/FTDI_Cable.jpeg" width="200" height="150"> <img src="images/FTDI_Adapter.jpeg" width="150" height="150">
1. The programmer should be set to 3.3V or nothing to not supply any over voltage to the multimodule and avoid any damages.
1. Under the **Tools -> Board:** select the **Arduino Pro-Mini**
1. Under **Tools -> Processor** select the **Atmega328p (5V, 16Mhz)**
1. Under **Tools -> Port** select your the serial port your programmer is connected to (it should appear on the the list)
1. Scroll back to the section [Customize the firmware to your hardware and your needs](#CustomizeFirmareToYourNeeds) above and follow the instructions remembering that you can simply use the Upload button in the Arduino IDE to upload firmware using the Arduino bootloader:
- From the Arduino environment, you can use Upload button which will compile and upload to the module: Sketch->Upload (Ctrl+U)
1. Note that the available flash memory for the firmware reduces by about 2K when you use the bootloader
### Arduino Boards.txt modification
First, we need to append some text to the Arduino file boards.txt.
To change the fuses you will need to use an external programmer (like USBasp mentioned above) and a flash tool that fits over the MCU and connects to the required pins, like this one:
[<img src="http://www.hobbyking.com/hobbyking/store/catalog/27195.jpg" />](http://www.hobbyking.com/hobbyking/store/__27195__Atmel_Atmega_Socket_Firmware_Flashing_Tool.html)
It connects to the USBASP programmer and connects directly to the pins on the microcontroller and it will allow you to set fuses and to program the Pro-Mini like the 4-in-1 boards above, without using the bootloader.
#### On Windows
1. Close the Arduino IDE
1. Search Windows for the application WordPad (DO NOT USE Notepad). <br> Right click on WordPad and select "Run as Administrator": <br> <img src="images/WordPad_Admin.jpg" height="200" /> <br>
1. Open the file ```boards.txt``` located in this folder ```C:\Program Files(x86)\Arduino\hardware\arduino\avr ``` or the equivalent if you have installed Aduino in a different directory.
1. Append the following text into the end of the file and save it:
```
##############################################################
## Multi 4-in-1 (3.3V, 16 MHz) w/ ATmega328
## --------------------------------------------------
multi.name=Multi 4-in-1
multi.upload.tool=avrdude
multi.upload.protocol=arduino
multi.bootloader.tool=avrdude
multi.bootloader.unlock_bits=0x3F
multi.bootloader.lock_bits=0x0F
multi.build.board=AVR_PRO
multi.build.core=arduino
multi.build.variant=eightanaloginputs
multi.build.extra_flags=-Wl,--relax
multi.menu.cpu.16MHzatmega328=ATmega328 (3.3V, 16 MHz)
multi.menu.cpu.16MHzatmega328.upload.maximum_size=32768
multi.menu.cpu.16MHzatmega328.upload.maximum_data_size=2048
multi.menu.cpu.16MHzatmega328.upload.speed=57600
multi.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF
multi.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xD3
multi.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0xFD
multi.menu.cpu.16MHzatmega328.build.mcu=atmega328p
multi.menu.cpu.16MHzatmega328.build.f_cpu=16000000L
##############################################################
```
Follow the instructions in [Advanced Topics - Manually Setting Fuses](Advanced_Manually_Setting_ATmega328_Fuses.md) to set the fuses.
#### On Mac OSX:
1. Close the Arduino IDE
1. Using finder navigate to ```Applications``` folder
1. Ctl-Click on the Arduino application and select **Show Package Contents**.
1. Browse to ```Contents/Java/hardware/arduino/avr``` and double click on boards.txt
1. Copy and paste the "Multi 4-in-1" text listed above into the end of the file and save it.
If building the board from scratch was your chosen strategy we suspect that you would already know how to do this. If not, Google is your friend, try something like “how to flash fuses on Arduino pro-mini”.
### Burn Bootloader
1. Open the Arduino IDE and load the Multiprotocol project.
1. Select under **Tools -> Board** the new entry **Multi 4-in-1**
1. Select under **Tools -> Programmer** the entry **USBasp**
1. Click on **Tools -> Burn Bootloader**. Do not worry it will return an error that no bootloader was found. In fact we are interrested by the first few lines indicating that the fuses were set correctly.
1. At this stage your flash module is empty so it's normal if the status LED does not do anything.
### Flash the firmware
Scroll back to the section [Customize the firmware to your hardware and your needs](#CustomizeFirmareToYourNeeds) above and follow the instructions.
You are done good fly!!!

View File

@ -2,165 +2,108 @@
**If you are Compling for the Arduino ATmega328p version of the Multiprotocol Module please go to the dedicated [Compiling and Programming ATmega328](Compiling.md) page.**
Multiprotocol source can be compiled using the Arduino IDE using STM32 Core (Maple) and Arduino ARM-Cortex-M3 libraries.
## IMPORTANT NOTE:
Multiprotocol source can be compiled using the Arduino IDE using STM32 Core (Maple) and Arduino ARM-Cortex-M3 libraries.
On all modules with STM32F103 microcontroller, the program flash memory on the microcontroller is large enough to accommodate all the protocols. You do not have to make choices on which protocols to upload. Also, it is likely that you used the Banggood 4-in-1 RF module and you will therefore have access to all the RF modules.Now for programmng multimodule with STM32 chip you have 2 options presented below.
###Install the Arduino IDE and the Multiprotocol project
1. Compiling and flashing in Arduino IDE.
1. Flashing precompiled binaries from [here](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/releases)
- If using one of these TX with multimodule like Turnigy 9X,9XR,9X+ the binary file for flashing is **Multiprotocol_V1.X.X_STM32.bin**.
- If using TARANIS TX the binary file is **Multiprotocol_V1.X.X_STM32_INV.bin**
Flashing precompiled **binaries** is done very simple with the cable setup presented below and an utility(GUI) **ST Flash Loader Demonstrator.**
## Compiling source and flashing in Arduino.
### Install the Arduino IDE and the Multiprotocol project
1. Download the Arduino IDE. The currently supported Arduino version is 1.6.11 available for [Windows]( https://www.arduino.cc/download_handler.php?f=/arduino-1.6.12-windows.exe) and [Mac OSX](http://arduino.cc/download_handler.php?f=/arduino-1.6.12-macosx.zip)
1. It is recommended to upgrade Java to the [latest version](https://www.java.com/en/download/)
1. Download the [STM32 Core](https://github.com/rogerclarkmelbourne/Arduino_STM32/archive/master.zip) and copy the Arduino_STM32 folder to:
- OSX: ```Arduino.app/Contents/Java/hardware``` (you can open Arduino.app by Ctl Clicking on Arduino.app and selecting "Show Package Contents")
- Windows: ```C:\Program Files (x86)\Arduino\hardware```
- OSX: ```Arduino.app/Contents/Java/hardware``` (you can open Arduino.app by Ctl Clicking on Arduino.app and selecting "Show Package Contents")
- Windows: ```C:\Program Files (x86)\Arduino\hardware```
- Make sure the folder tree structure is like this .....\hardware\Arduino_STM32\.....and **NOT** ...... \hardware\Arduino_STM32-master\Arduino_STM32-master\......So move the folders /rename accordingly.
1. Download the zip file with the Multiprotocol module source code from [here](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)
1. Unzip and copy the source code folder ```Multiprotocol``` to a folder of your choosing
1. Click on the ```Multiprotocol.ino file``` in the ```Multiprotocol``` folder and the Arduino environment should appear and the Multiprotocol project will be loaded.
###Prepare the Arduino IDE:
### Prepare the Arduino IDE:
1. In order to compile successfully you need also to modify a maple library file. In ```....\hardware\Arduino_STM32\STM32F1\cores\maple\libmaple\usart_f1.c``` comment out the 2 functions as shown below. This is required to have low-level access to the USART interrupt.
> ```//void __irq_usart2(void) { usart_irq(&usart2_rb, USART2_BASE); } ```
> ```//void __irq_usart3(void) { usart_irq(&usart3_rb, USART3_BASE); } ```
1. Run the IDE, and on the **Tools** menu, select **Board** and then **Boards manager**. Click on the Arduino DUE (32 Bits ARM-Cortex M3) from the list of available boards. You must do this step, it installs the arm-none-eabi-g++ toolchain!
1. In order to compile successfully you need also to modify a maple library file. In ```....\hardware\Arduino_STM32\STM32F1\cores\maple\libmaple\usart_f1.c``` comment out the 2 functions as shown below. This is required to have low-level access to the USART interrupt. <br>
```
/* void __irq_usart2(void){
usart_irq(&usart2_rb, USART2_BASE);
}
void __irq_usart3(void) {
usart_irq(&usart3_rb, USART3_BASE);
} */
```
1. Run the IDE, and on the **Tools** menu, select **Board** and then **Boards manager**. <br> Click on the Arduino DUE (32 Bits ARM-Cortex M3) from the list of available boards. You must do this step, it installs the arm-none-eabi-g++ toolchain!
1. Close and reopen the Arduino IDE and load the Multiprotocol project.
1. In arduino IDE under the **Tools** -> **Board:** select the **Generic STM32F103C series** board
1. Click on the **Verify** button to test compile the before you make any changes. If there are errors check the process above and be sure to have the right version of the Arduino IDE.
1. Click on the **Verify** button to test compile the before you make any changes. <br> If there are any errors check the process above and be sure to have the right version of the Arduino IDE.The binary file generated location is presented at the bottom of Arduino IDE compiling window.Now continue with flashing procedure.
## Common process for OSX and Windows
### Flashing the multimodule
###Customize the firmware to your hardware and your needs
On all modules with STM32F103 microcontroller, the program flash memory on the microcontroller is large enough to accommodate all the protocols. You do not have to make choices on which protocols to upload. Also, it is likely that you used the Banggood 4-in-1 RF module and you will therefore have access to all the RF modules. However, you can follow these instructions to select only a subset protocols.
There are three options for flashing the firmware. But We will present here only 2 methods ,the third one is presented in advanced topics.
The first (and strongly recommended) is flashing it while it is plugged into and powered by the transmitter.The second is preparing the board for flashing with a USB cable.
The second method is definitely the easiest in the long-term, but it does require the USB bord and setting up the bootloader on the STM32 MCU.
If you plan to use the PPM mode then you should follow the instructions to customize the protocol selection switch to protocol mapping.
Before customizing your firmware it would be good to review the protocol on the [Protocol Details](../Protocols_Details.md) page and to identify the protocols you would like to support on your module.
At the same time make a note of RF modules required by your protocols. For example, if you do not wish to use the FlySky or the Husan protocols then you do not need to compile support the the A7105 RF Module into your firmware. Similarly, if you have no need to bind with ASSAN RC receivers then you do not need to compile the ASSAN protocol into your firmware.
If you plan to use the PPM communication interface with your transmitter, then you need to perform protocol selection with the 16 position switch on your module. This will limit the available protocols you can usefully access in PPM mode on your module to 15 (this limitation does not apply to Serial mode). You should make a list of your 15 chosen protocols, sub protocols and options like this:
Switch Position|Protocol|Sub-Protocol|Option|Notes
---------------|--------|------------|------|-----
1.|DSM|DSM2|2|6 channels @ 22ms
2.|DSM|DSMX|6|6 channels @ 11ms
....|...|...|...|...
....|...|...|...|...
15.|FRSKYX|CH_16| |FrSky X receiver 16 chan
With the above information (required RF modules, selected protocols and 16 pos switch mapping) you are ready to customize your firmware.
All customization is done by editing the ```_Config.h ``` file in the Multiprotocol Arduino project.
In the Arduino IDE and click on the down arrow on the far right of the tab bar to show a list of project files (see the red circle on the screenshot below). Scroll down and select the _Config.h file.
<img src="images/Arduino.png" width="600" height="400" />
It is unlikely that you would need to do this, but you can comment out any of the RF modules that you do not need by typing ```// ``` at the begining of the line that reads :
```#define <RF Module name>_INSTALLED ``` . The following line shows the CC2500 module removed
> ```#define A7105_INSTALLED ```
> ```#define CYRF6936_INSTALLED ```
> **```//#define CC2500_INSTALLED ```**
> ```#define NFR24L01_INSTALLED ```
Again it is unlikely that you would want to do this, but you can scroll down to the available protocols and comment out all the protocols you will not require. The following example shows the DEVO protocol commented out.
> **```#ifdef CYRF6936_INSTALLED ```
> **``` // #define DEVO_CYRF6936_INO ```**
> ``` #define DSM_CYRF6936_INO ```
> ``` #define J6PRO_CYRF6936_INO ```
> ``` #endif ```**
Look for the line containing ```#define INVERT_TELEMETRY``` and make sure that it is uncommented:
> ```#define INVERT_TELEMETRY ```
Scroll down to the bottom of the file and list your switch mapping to your desired **protocol/sub-protocol/options**. You typically only need to change the three relevant columns. On models that require a rebind on every start-up (like Syma quads) you can change the **```NO_AUTOBIND ```** to **```AUTOBIND ```**.
Finally, if you have not already done so, specify the correct board for the compiler. Under **Tools** -> **Board:** select the **Generic STM32F103C series** board. You can now compile the firmware by clicking on the check mark (Tooltip: Verify) on the menu bar. If everything goes according to plan you should see something like the following line in the lower pane of the window:
> Sketch uses 32,464 bytes (99%) of program storage space. Maximum is 32,768 bytes.
> Global variables use 1,219 bytes (59%) of dynamic memory, leaving 829 bytes for local variables. Maximum is 2,048 bytes.
If you get an error carefully read the error to see the approximate line number where the error occured and correct it.
###Preparing for STM32 microcontroller for firmware flashing
There are three options for flashing the firmware. The first (and strongly recommended) is flashing it while it is plugged into and powered by the transmitter. The second is flashing it out of the transmitter (the power is supplied by the 3.3V FTDI cable). The second option is very risky because if the 3.3V bridge jumper is not removed after flashing it will fry your RF module - **you have been warned**. The third is preparing the board for flashing with a USB cable.
The third method is definitely the easiest in the long-term, but it does require setting up the bootloader on the STM32 MCU.
####Option 1: Flashing with Tx power
#### Option 1: Flashing with Tx power(highly recommended)
1. Put the module in the Tx
1. Place a jumper over the BOOT0 pins
1. Connect your 3.3V/5V FTDI cable (USB - TTL serial) to Multiprotocol serial port. Connect only RX, TX and GND. **Do not connect the 5V or 3.3V between the FTDI cable and the module - the power will be supplied by the transmitter**. Connect the pins as follows:
- Module RX pin to FTDI TX pin
- Module TX pin to FTDI Rx pin
- Module GND to FTDI GND
1. Place a jumper over the BOOT0 pins.Skip this one if you made your own cable for flashing ,see below.
1. Connect your 3.3V/5V FTDI cable (USB - TTL serial) to Multiprotocol serial port. <br> Connect only RX, TX and GND. **Do not connect the 5V or 3.3V between the FTDI cable and the module - the power will be supplied by the transmitter**. Connect the pins as follows:
- Module RX pin to FTDI TX pin
- Module TX pin to FTDI Rx pin
- Module GND to FTDI GND
1. In arduino IDE under the **Tools** -> **Board:** check that you have selected the **Generic STM32F103C series** board
1. Under **Tools** -> **Upload Method:** select **Serial**
1. Click "Upload" and the sketch will be uploaded normally. This is valid for all arduino versions.
1. Once the firmware has uploaded, remove the BOOT0 jumper.
If you have the module inside a box and to be inserted in TX bay, you may build a flashing cable like in the picture below.
You can attach and solder a 5 pin header female and top outside the box.**ALways insert first the USB serial device in USB port , and TX start after.**
####Option 2: Flashing without Tx power
<img src="images/Multi_STM32_ flashing.jpg" />
The key difference of this method is that the 3.3V FTDI cable must also provide power to the 5V circuitry during the flashing process. To do this, a jumper must be enabled connecting the 3.3V VCC to the 5V line.
See below my module for reference
**If the module is powered through the transmitter and this jumper is enabled, then it will feed 5V throughout the 3.3V circuit and this will fry your RF modules. Do not plug the module into the transmitter before removing this jumper!**
<img src="images/Multi_STM32 module.JPG" width="600" height="400" />
1. Remove the module from the transmitter bay
1. Set BOOT0 jumper
1. Set the 3.3V jumper.
1. Connect your 3.3V FTDI cable (USB - TTL serial) to Multiprotocol serial port (RX,TX,GND,5V). Connect the pins as follows:
- Module RX pin to FTDI TX pin
- Module TX pin to FTDI Rx pin
- Module GND to FTDI GND
- Module V to FTDI 3.3V
1. In arduino IDE under the **Tools** -> **Board:** check that you have selected the **Generic STM32F103C series** board
1. Under **Tools** -> **Upload Method:** select **Serial**.
1. Click "Upload" and the sketch will be uploaded normally.
1. Once the firmware has uploaded:
- Remove the 3.3V jumper!!!!
- Remove the BOOT0 jumper
- Check that you removed the 3.3V jumper
1. Insert the module into the transmitter bay
####Option 3: Flashing with USB cable.
#### Option 2: Flashing with USB cable.
This method use USB connector on the STM32 V1.0 board or on the maple clone board.
1. Install first maple USB driver by running the batch file found in Arduino STM32 package folder ```..\hardware\Arduino_STM32\drivers\win\install_drivers.bat```
1. Download the free STM32 flash loader demonstrator from [ST.com](http://www.st.com/en/development-tools/flasher-stm32.html) and using a USB-TTL device (like FTDI cable) flash the STM32duino bootloader available from Roger Clark's great STM32 site [here](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/tree/master/STM32F1/binaries) .Use bootloader **generic_boot20_pa1.bin**
1. Open Arduino IDE,browse to multiprotocol folder,load the sketch multiprotocol.ino.
1. In Arduino IDE under "Upload method" select **STM32duino**-bootloader.Click upload ,wait until upload is complete.
1. Install first maple USB driver by running the batch file found in Arduino STM32 package folder "..\hardware\Arduino_STM32\drivers\win\install_drivers.bat"
1. Download the free STM32 flash loader demonstrator from [ST.com](http://www.st.com/en/development-tools/flasher-stm32.html) and using a USB-TTL device (like FTDI cable) flash the STM32duino bootloader available from Roger Clark's great STM32 site [here](https://github.com/rogerclarkmelbourne/STM32duino-bootloader/tree/master/STM32F1/binaries)
1. In Arduino IDE under "Upload method" select STM32duino-bootloader.
1. After that select the correct serial port and and upload sketches normally in Arduino using USB port
Notes:
- When you use multiSTM32_USB for the first time,the USB drivers are not recognized and port is not open/recognized(arduino IDE port selection is grey/unavailable). After this first time use, any subsequent update of the program, you'll have to select the correct serial port and upload sketches normally in Arduino using USB port.
- If the initial upload fails, make sure you are running the latest [Java version](https://www.java.com/en/download/)
###Flashing binary file:
If you want to flash a pre-compiled binary file (like the Release .bin files) you need specialized software and the FTDI cable.
## Flashing precompiled binaries:
1. Set BOOT0 jumper
1. Connect your 3.3V FTDI cable (USB - TTL serial) to Multiprotocol serial port (RX,TX,GND,5V)
If you want to flash a pre-compiled binary file (like the Release .bin files) you need specialized software and the same FTDI cable setup already posted [here](Compiling_STM32.md#option-1-flashing-with-tx-powerhighly-recommended).
1. Set BOOT0 jumper(skip this step if you aready made your own cable ,see above)
1. Connect your 3.3V FTDI cable (USB - TTL serial) to Multiprotocol serial port (RX,TX,GND pins when flashing with TX power).
1. Insert first FTDI serial to USB port.Start TX (only if using flashing with TX power method)
1. The other steps regarding power supply the same as previous recommandation regarding jumpers
For uploading binaries(.bin files) there is a specialized software you need to install on your computer.
#### Windows:
Download the ST Flash Loader Demonstrator from here: http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html
Download the **ST Flash Loader Demonstrator** from here: http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html
Run the ST Flash Loader program. There are many tutorials on the web on how to use this program.For example
[here](http://www.scienceprog.com/flashing-programs-to-stm32-embedded-bootloader)
Run the ST Flash Loader program. There are many tutorials on the web on how to use this program.For example: [here](http://www.scienceprog.com/flashing-programs-to-stm32-embedded-bootloader)
#### OSX:
To be checked.
###Report issues for the STM32 board
### Report issues for the STM32 board
You can report your problem using the [GitHub issue](https://github.com/midelic/DIY-Multiprotocol-TX-Module/issues) system or go to the [Main thread on RCGROUPS](http://www.rcgroups.com/forums/showthread.php?t=2165676) to ask your question.
Please provide the following information:

View File

@ -1,14 +1,13 @@
#Documentation ToDos
1. Documentation on all the FlySky boards: (MikeB?)
# Documentation ToDos
- [ ] Documentation on all the FlySky boards: (MikeB?)
- SKY board erSky9x
- AR9X board erSky9x
- 9Xtreme board erSky9x
- AR9X UNI board
1. Add to the troubleshooting page
1. Add how to do custom protocol setup on er9x and OpenTx
1. Document the OrangeRx Transmitter module (Mikeb?)
1. enabling Serial on the DIY PCB page
1. lots of pictures mentioned between the {} markers
1. Someone to add the Build the board from scratch if it is still relevant
1. Move to atmega specific and add ftdi to stm32 AVR ISP programmer like the popular USBASP programming dongle that is 3.3V safe - available from many sellers on ebay. There are reports that some of the cheap programmers are not safe to use with 3.3V units (like this unit). Look for USBAsp programmers with the “LC Technologies” label. {Pascal to confirm these reports are true} Also, you will need a 10-pin to 6-pin connector to connect the USBASP to the board.
- [ ] Add to the troubleshooting page
- [ ] Add how to do custom protocol setup on er9x and OpenTx
- [ ] Document the OrangeRx Transmitter module (Mikeb?)
- [ ] enabling Serial on the DIY PCB page
- [ ] lots of pictures mentioned between the {} markers
- [ ] Someone to add the Build the board from scratch if it is still relevant
- [ ] Move to atmega specific and add ftdi to stm32 AVR ISP programmer like the popular USBASP programming dongle that is 3.3V safe - available from many sellers on ebay. There are reports that some of the cheap programmers are not safe to use with 3.3V units (like this unit). Look for USBAsp programmers with the “LC Technologies” label. {Pascal to confirm these reports are true} Also, you will need a 10-pin to 6-pin connector to connect the USBASP to the board.

View File

@ -2,16 +2,17 @@
The choice of **Multiprotocol Transmitter Module (MULTI-Module)** hardware is the single biggest choice you will make. Due to the growing popularity of this project the number of hardware choices is growing almost monthly.
There are currently four common hardware options. They are (click on the pictures for more info):
There are currently four common hardware options. They are (`click on the pictures for more info`):
1. A ready-made MULTI-Module from Banggood.com (see [here](http://www.banggood.com/2_4G-CC2500-A7105-Flysky-Frsky-Devo-DSM2-Multiprotocol-TX-Module-With-Antenna-p-1048377.html)) that integrates the microprocessor with all four supported RF modules and a hardware antenna switcher.
1. A ready-made 4-in-1 MULTI-Module which integrates the microcontroller with all four supported RF modules and a hardware antenna switcher.
[<img src="images/4-in-1_Module_BG.jpeg" width="200" height="200" />](Module_BG_4-in-1.md)
1. A DIY MULTI-Module made using one of the PCBs that are available and soldering on your own components. The picture below shows an example of one before RF modules have been soldered on.
[<img src="images/Multiprotocol_3.2.jpeg" width="150" height="200" />](Module_Build_yourself_PCB.md)
1. A MULTI-Module based on the OrangeRx DSM transmitter module that natively supports the CYRF6936 RF module. This module can be improved with Mulitprotocol firmware:
1. A MULTI-Module based on the OrangeRx DSM transmitter module that natively supports the built in CYRF6936 RF module. This module can be improved with Mulitprotocol firmware in serial mode only:
- Now works with most (all) DSM bind-and-fly models
- Supports the Devo protocols
- Supports the J6Pro protocols
- Supports the Walkera protocols
[<img src="images/OrangeRx_Module.jpg" width="250" height="200" />](Module_OrangeRx.md)
1. A scratchbuilt MULTI-Module using perfboard, an Arduino Pro-Mini and the desired RF modules.
Unless you are handy with a soldering iron and you have access to electronic test equipment (like an oscilloscope) you should consider only Option 1. For a price of about $44 you can get everything you need, neatly assembled

View File

@ -1,19 +1,23 @@
#Model Setup
# Model Setup
This is the page to document model or receiver specific setup instructions.
The Deviation project (on which this project was based) have a useful list of models [here](http://www.deviationtx.com/wiki/supported_models).
#Syma X5C
# Syma X5C
<img src="http://img2.cheapdrone.co.uk/images/upload/2014/12/X5C%203/SKU115108-7.jpg" Width="200" Height="200" />
##Channel Map
## Channel Map
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|FLIP|RATES|PICTURE|VIDEO
##Binding
## Binding
There are no special binding instructions. The model powers up in Autobind mode and expects the bind sequence from the transmitter within the first 4-5 seconds.
##Tx Setup
## Tx Setup
A basic 4-channel setup works perfectly, but some improvements are possible:
###Setting up a switch to Flip
### Setting up a switch to Flip
1. Choose your "Rates" switch - typically the momentary TRN switch
1. In the Mixer create an entry for CH5
@ -21,7 +25,7 @@ A basic 4-channel setup works perfectly, but some improvements are possible:
- er9X: Source: sTRN, Weight 100 (or whatever switch you selected)
- OpenTx: Source: SH, Weight 200 (or whatever switch you selected)
###Setting up a swich for high rates
### Setting up a swich for high rates
1. Choose your "Rates" switch
1. In the Mixer create an entry for CH6
@ -31,7 +35,7 @@ A basic 4-channel setup works perfectly, but some improvements are possible:
When the switch is in the rear position the rates will be standard, when the switch is forward rates will be high. There is no need to move the throttle stick to the full up and full down position as with the standard controller.
###Setting up Idle-up
### Setting up Idle-up
One of the most annoying functions on the Syma X5C is that the motors stop when the throttle is pulled back. This can be fixed by implmenting Idle-up on the transmitter (think of this as a very simple version of the Betaflight "Air Mode"). Idle up will ensure that even when the throttle is all the way down, a minimum command is passed to the motor to keep them spinning and to activate the stabilization.
**To do this**:
@ -41,49 +45,57 @@ One of the most annoying functions on the Syma X5C is that the motors stop when
1. When you want to fly in "idle-up" mode flick the switch and your stabilization will always be active.
1. Remeber to switch off idle-up as soon as the quad lands (or crashes - to avoid damage to the motors)
#Inductrix (Horizon Hobby)
# Inductrix (Horizon Hobby)
<img src="https://s7d5.scene7.com/is/image/horizonhobby/BLH8700_a0" Width="200" Height="200" />
##Binding
## Binding
For telemetry enabled modules, you should just let the remote autodetect the settings. Otherwise choose DSMX 22ms with 6ch or 7ch. To bind the model, keep the transmitter off, power on the Inductrix. Wait until it flashes fast and then power up the Tx and use Bind.
##Tx Setup
## Tx Setup
Remember that 100% on your transmitter using the MULTI-Module corresponds to 125% on the DSM receiver side. On some functions sending 100% will confuse the model. Conversely 80% on your Tx is interpreted to be 100% at the model. Consider this when implementing the suggestions below.
###Throttle
### Throttle
For Inductrix FPV you might need to adjust the lower end of throttle to be a higher than default, otherwise motors will be spinning on minimal throttle. One way to do this is to set the throttle to 80% output (100% of DSM output) and then to enable the **Throttle Idle Trim Only** under the Model Setup menu. See image below:
<img src="images/Inductrix_Throttle_Setup.png" Width="600" Height="200" />
###Acro and Level Mode
### Acro and Level Mode
Setup channel 6 with a momemtary button or switch (e.g. SH on the Taranis) and use that switch to switch between modes. Set the output to somewhere between 40% to 60% for best results.
An addition consideration when flying in Acro mode is to reduce stick sensitivity and to add some expo. The screens below show one way of doing this. Customize to your needs.
####Inputs Screen
#### Inputs Screen
The follwing INPUTS screen shows one potential setup to introduce expo for Acro mode. The activation of the expo on Roll, Pitch and Yaw is when the SG switch is not in the back position. Add to taste.
<img src="images/Inductrix_Inputs.png" Width="600" Height="200" />
####Aileron Rates attached to Switch !SG-up
#### Aileron Rates attached to Switch !SG-up
The next screen shows and example of how the expo (50%) was set up on the stick input and how it is activated by !SG-up:
<img src="images/Inductrix_Aileron_Expo.png" Width="600" Height="200" />
####Mixer Menu
#### Mixer Menu
The next screen shows the mixer menu with the mode change on momentary switch SH and High-Low rates on switch SC:
<img src="images/Inductrix_Mixer.png" Width="600" Height="200" />
# Cheerson CX-20 / Quanum Nova
<img src="http://uaequadcopters.com/images/products/Large/932-cheersoncx20dronquad.jpg" Width="200" Height="155" />
##Channel Map
## Channel Map
CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|MODE|AUX1|AUX2
##Binding
## Binding
The Rx powers up in binding mode so the transmitter should be set to autobind. If the Tx signal is lost due to power-off or going out of range the Rx will not re-bind, and requires power-cycling before it will bind again.
##Tx Setup
## Tx Setup
AETR are simple +100% mixes. Note that the model expects Elevator (CH2) to be reversed, which is handled in the module firmware, so no need to reverse it on the Tx.
###Flight modes
### Flight modes
CH5 is used to transmit the flight mode to the APM flight controller by setting the output to a value in a pre-defined range. The original Tx uses a 3-pos switch (SWA) and a 2-pos switch (SWB) to achieve six different combinations, but only five are used - with SWA at 0, 1500 is sent when SWB is at 0 and 1, leaving flight mode 3 unused. However, in the stock CX-20 flight controller settings, both flight mode 3 and 4 are set to the same flight mode, meaning we can configure our new Tx settings to send a value for mode 3 without changing the standard flight mode behaviour. Afterwards, you can optionally use Mission Planner to assign a new flight mode to mode 3 or mode 4, or reconfigure them altogether.
The values, modes, and switch positions for the stock Tx are:
@ -113,7 +125,7 @@ One easy way to acheive this is to configure six logical switches mapped to two
To simply map the old Tx modes to the new Tx using the same switch positions, use the following configuration. The stock SWA switch is replaced with the ID0/1/2 switch, SWB is replaced with the AIL D/R switch.
####Logical switches:
#### Logical switches:
Switch|Function|V1|V2
---|---|---|---
@ -124,7 +136,7 @@ L. Switch 4|AND|ID0|AIL
L. Switch 5|AND|ID1|AIL
L. Switch 6|AND|ID1|!AIL
####Flight modes (using CX-20 names):
#### light modes (using CX-20 names):
Mode|Name|Switch
---|---|---
@ -135,7 +147,7 @@ Mode|Name|Switch
5|DirLock|L5
6|Stable|L6
####Mixer setup:
#### Mixer setup:
Channel|Weight|Source|Switch|Multiplex
---|---|---|---|---
@ -154,11 +166,11 @@ CH6 and CH7 can be assigned to switches or pots to provide additionaly functiona
Replicating the stock setup of two pots, you would assign:
Channel|Weight|Source|Multiplex
---|---|---|---|---
---|---|---|---
CH6|+100%|P1|ADD
CH7|+100%|P3|ADD
##Full Mixer Setup
## Full Mixer Setup
Channel|Source|Weight|Switch|Multiplex
---|---|---|---|---

View File

@ -1,57 +1,83 @@
#4-in-1 Banggood module
# 4-in-1 module
Currently the form factor of this module is designed for the JR-style module bay. Many of the popular RC transmitters use the JR-style module bay: FrSky Taranis, FlySky Th9x, Turnigy 9X/R/Pro
##What you need
1. The ready-made module is available from Banggood.com [here](http://www.banggood.com/2_4G-CC2500-A7105-Flysky-Frsky-Devo-DSM2-Multiprotocol-TX-Module-With-Antenna-p-1048377.html)
<img src="images/4-in-1_Module_BG.jpeg" width="200" height="200" />
1. A module case that fits your receiver like the one [here](https://www.xtremepowersystems.net/proddetail.php?prod=XPS-J1CASE)
## What you need
A fully assembled module + case available from Banggood.com [here](http://www.banggood.com/CC2500-NRF24L01-A7105-CYRF693-4-In-1-RF-Module-With-Case-For-Futaba-JR-Frsky-Transmitter-p-1116892.html)
<img src="images/4-in-1_Module_Case_BG.jpeg" width="221" height="200" />
Or
The ready-made module available [here](http://www.banggood.com/2_4G-CC2500-A7105-Flysky-Frsky-Devo-DSM2-Multiprotocol-TX-Module-With-Antenna-p-1048377.html) or [here](http://www.gearbest.com/multi-rotor-parts/pp_554427.html)
<img src="images/4-in-1_Module_BG.jpeg" width="200" height="200" />
Plus a module case that fits your module like the one [here](https://www.xtremepowersystems.net/proddetail.php?prod=XPS-J1CASE)
<img src="https://www.xtremepowersystems.net/prodimages/j1case.jpg" width="200" height="180" />
or you can 3D print your own from a selection on Thingiverse ([Example 1](http://www.thingiverse.com/thing:1852868) [Example 2](http://www.thingiverse.com/thing:1661833)).
[<img src="http://thingiverse-production-new.s3.amazonaws.com/renders/55/1c/cb/0a/e4/5d2c2b06be7f3f6f8f0ab4638dd7c6fc_preview_featured.jpg" width="250" height="200" /> ](http://www.thingiverse.com/thing:1852868)
1. 3x2 header pins (to solder onto the board for programming)
1. AVR ISP programmer like the popular USBASP programming dongle that is 3.3V safe - available from many sellers on [ebay.](http://www.ebay.com/sch/i.html?_odkw=usbasp+progammer&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR3.TRC2.A0.H0.Xusbasp+progammer+3.3V.TRS1&_nkw=usbasp+progammer+3.3V&_sacat=0) There are reports that some of the cheap programmers are not safe to use with 3.3V units (like this unit). Look for USBAsp programmers with the “LC Technologies” label. Also, you will need a 10-pin to 6-pin connector to connect the USBASP to the board.
For 9XR/9XR Pro, a new 3D printed module is available which makes use of the built in antenna in the handle. This means nothing is getting out of the radio back! You can find all details of this module case on [Thingiverse](http://www.thingiverse.com/thing:2050717).
##Build instructions
The assembly process is trivial but it does depend on:
- The communication interface between your transmitter and the module, and
- The version of the module you have
<img src="images/9XR_module.jpg" width="113" height="200" /> <img src="images/9XR_module_connector.jpg" width="274" height="200" />
###Common steps
## Different working modes
1. Solder the 3x2 header pins onto the module as shown below {insert picture of module with pins}. These header pins are required to program the microcontroller.
1. Fit the module into the module case. This may require some careful filing or sanding of the module to ensure a nice fit.
### PPM mode
If you are only planning on using the PPM interface with your transmitter, you need to connect it as described:
###PPM interface
If you are only planning on using the PPM interface with transmitter you are ready to program the module as described in Compiling and Programming the module.
<img src="images/PPM.png" width="574" height="340" />
###Enabling Serial and Telemetry interface
If you have a transmitter that can support serial communication with the board then you need to wire up the board appropriately. There are two versions of the module and the steps are slightly different.
Some radios have an open collector output (Futaba, Graupner...), in this case you should add a 4.7K resistor between PPM and BATT.
Check which module you have and based on the pictures below. If you purchased the module after June 2016 then it is likely that you have a V2 type module.
The same plug is available on all versions of the module with the same signal locations.
#### **Version 2 (V2) type modules**
If you wish to add an external device reading the telemetry, you need to enable serial mode as explained in the next topics otherwise you are now ready to go over to [Compiling and Programming](Compiling.md).
### Serial mode
If you have a transmitter that can support serial communication with the board then you need to wire up the board appropriately. There are three versions of the module and the steps are slightly different.
Check which module you have and based on the pictures below. If you purchased the module after June 2016 then it is likely that you have a V1.1 type module. If you have purchased the version with case it is likely that you have a V1.2 type module.
#### **Version 1.2 (V1.2) type modules**
Serial is already enabled and ready to be used.
Written on PCB back JRFM_V1.2
<img src="images/v1.2_ISP.jpg" width="340" height="340" />
You are now ready to go over to [Compiling and Programming](Compiling.md).
#### **Version 1.1 (V1.1) type modules**
Solder two bridges over the pads shown in the pictures below.
V2a
V1.1a
<img src="images/V2a_Serial_Enable.jpeg" width="300" height="340" />
<img src="images/V2a_zoom_Serial_Enable.jpeg" width="450" height="340" />
V2b
V1.1b
Written on PCB back 1.2
<img src="images/V2b_Serial_Enable.jpeg" width="220" height="340" />
V2c
V1.1c
<img src="images/V2c_Serial_Enable.jpeg" width="220" height="340" />
You are now ready to go over to [Compiling and Programming](Compiling.md).
#### **Version 1 (V1) module**
#### **Version 1.0 (V1.0) module**
Solder bridges and resistors as illustrated in the picture below.
<img src="images/V1_Serial_Enable.jpeg" width="500" height="340" />
<img src="images/V1_Serial_Enable.jpeg" width="360" height="340" />
If your module is always/sometime binding at power up without pressing the button replace the BIND led resistor (on the board back) of 1.2K by a 4.7K. Just to be safe it is recommended to do the modification anyway.
It's known that the A7105 of this version is not able to receive telemetry. The only protocol affected so far is AFHDS2A.
You are now ready to go over to [Compiling and Programming](Compiling.md).

View File

@ -1,4 +1,4 @@
#Build from stratch
# Build from stratch
If you can help to fully document this page, or just add additional detail please let us know on the rcgroups [forum](http://www.rcgroups.com/forums/showthread.php?t=2165676).
@ -10,13 +10,13 @@ The Arduino Pro-Mini is available many places online. Check Sparkfun (the origi
A module case that fits your receiver like the one [here](https://www.xtremepowersystems.net/proddetail.php?prod=XPS-J1CASE)
<img src="https://www.xtremepowersystems.net/prodimages/j1case.jpg" width="200" height="180" />
or you can 3D print your own from a selection on Thingiverse ([Example 1](http://www.thingiverse.com/thing:1852868) [Example 2](http://www.thingiverse.com/thing:1661833)).
[<img src="http://thingiverse-production-new.s3.amazonaws.com/renders/55/1c/cb/0a/e4/5d2c2b06be7f3f6f8f0ab4638dd7c6fc_preview_featured.jpg" width="250" height="200" /> ](http://www.thingiverse.com/thing:1852868)
[<img src="http://thingiverse-production-new.s3.amazonaws.com/renders/55/1c/cb/0a/e4/5d2c2b06be7f3f6f8f0ab4638dd7c6fc_preview_featured.jpg" width="250" height="200" /> ](http://www.thingiverse.com/thing:1852868)
For 9XR/9XR Pro, a new 3D printed module is available which makes use of the built in antenna in the handle. This means nothing is getting out of the radio back. You can find all details of this module case on [Thingiverse](http://www.thingiverse.com/thing:2050717).
<img src="images/9XR_module.jpg" width="113" height="200" /> <img src="images/9XR_module_connector.jpg" width="274" height="200" />
You will require a second Arduino or a FTDI (USB to TTL serial) cable to program the Pro-Mini. Like the one [here](https://www.sparkfun.com/products/9717). **Make sure you get only a 3.3V FTDI cable - or you will fry your 3.3V RF modules when you connect it up.**
##Reference Schematic <a name="Schematic"></a>
## Reference Schematic <a name="Schematic"></a>
Here is the schematic you can use to troubleshoot the module
<img src="images/DIY_Mulitprotocol_Module_Schematic.jpeg" width="1000" height="500" />
##Compiling and programming
## Compiling and programming
Follow the instruction on the [Compiling and programming page](Compiling.md)

View File

@ -1,12 +1,13 @@
#DIY MULTI-module by soldering components on a PCB
# DIY MULTI-module by soldering components on a PCB
Currently the form factor of this module is designed for the JR-style module bay. Many of the popular RC transmitters use the JR-style module bay: FrSky Taranis, FlySky Th9x, Turnigy 9X/R/Pro
##What you need
First you must choose the PCB onto which to solder all the components. There are two PCB options:
- ATmega (8-bit) powered PCB V2.3d supporting individual RF modules
- STM32 (32-bit) powered PCB supporting the 4-in-1 RF module
The **ATmega-based board** has been designed to accept individual RF modules. This way you can select just the module or modules you want. The downside is that each module requires its own antenna. It can become cumbersome with 4 antennas protruding from the module. It is possible to soder the 4-in-1 module to the PCB using thin insulated wire. This 4-in-1 module requires only one antenna. Finally, the Atmega board has a 32k flash memory. This is big enough to accommodate more than 15 protocols, but it cannot accommodate all the available protocols.
## What you need
First you must choose the PCB onto which to solder all the components. There are two PCB options:
- ATmega (8-bit) powered PCB V2.3d supporting individual RF modules
- STM32 (32-bit) powered PCB V1.0t supporting the 4-in-1 RF module
The **ATmega-based board** has been designed to accept individual RF modules. This way you can select just the module or modules you want. The downside is that each module requires its own antenna. It can become cumbersome with 4 antennas protruding from the module. It is possible to soder the 4-in-1 module to the PCB using thin insulated wire. This 4-in-1 module requires only one antenna. Finally, the Atmega board has a 32KB flash memory. This is big enough to accommodate more than 15 protocols, but it cannot accommodate all the available protocols.
<img src="images/MPTM_with_RF_modules.jpeg" width="150" height="120" />
@ -14,7 +15,7 @@ The **STM32-based** board has been designed to accept the 4-in-1 RF module with
<img src="images/Board_PCB_STM32.jpeg" width="100" height="125" /> <img src="images/Multi_4-in-1_RF_module.jpg" width="65" height="82" />
###ATmega board V2.3d
### ATmega board V2.3d
1. ATmega (8-bit) powered PCB V2.3d available from OSHPark [here](https://oshpark.com/shared_projects/Ztus1ah8).
2. Individual RF modules The modules are available here:
- [CC2500](http://www.banggood.com/2_4G-500K-CC2500-Long-Range-Wireless-Transceiver-Module-p-1075492.html) for FrSkyV, FrSkyD, FrSkyX and SFHSS
@ -26,48 +27,39 @@ The **STM32-based** board has been designed to accept the 4-in-1 RF module with
The schematic for the board is [here](#V23D_Schematic). Please note that is is the general schematic - there will be some minor differences (like solder jumpers) between this and the board.
###STM32 powered PCB
1. STM32 (32-bit) powered PCB supporting the 4-in-1 RF module available from OSHPark [here](https://oshpark.com/shared_projects/GX51nEoH).
### STM32 powered PCB
1. The latest STM32 (32-bit) powered PCB V1.0t supporting the 4-in-1 RF module available from OSHPark [here](https://oshpark.com/shared_projects/GX51nEoH).
2. The 4-in-1 RF module is available [here](http://www.banggood.com/DIY-2_4G-CC2500-NRF24L01-A7105-CYRF6936-Multi-RF-4-IN-1-Wireless-Module-p-1046308.html)
1. The BOM for this board is available [here](BOM_DIY_STM32.md). The github project page for the STM32 module is [here](https://github.com/midelic/DIY-Multiprotocol-TX-Module).
1. The schematic and BOM for this board V1.0t and older boards are available [here](BOM_DIY_STM32 & Schematic.md).
The schematic for the board is [here](#STM32_Schematic)
###Common parts
1. A module case that fits your receiver like the one [here](https://www.xtremepowersystems.net/proddetail.php?prod=XPS-J1CASE)
<img src="https://www.xtremepowersystems.net/prodimages/j1case.jpg" width="200" height="180" />
or you can 3D print your own from a selection on Thingiverse ([Example 1](http://www.thingiverse.com/thing:1852868) [Example 2](http://www.thingiverse.com/thing:1661833)).
[<img src="http://thingiverse-production-new.s3.amazonaws.com/renders/55/1c/cb/0a/e4/5d2c2b06be7f3f6f8f0ab4638dd7c6fc_preview_featured.jpg" width="250" height="200" /> ](http://www.thingiverse.com/thing:1852868)
### Common parts
1. A module case that fits your module like the one [here](https://www.xtremepowersystems.net/proddetail.php?prod=XPS-J1CASE) <br> <img src="https://www.xtremepowersystems.net/prodimages/j1case.jpg" width="200" height="180" /> <br> or you can 3D print your own from a selection on Thingiverse ([Example 1](http://www.thingiverse.com/thing:1852868) [Example 2](http://www.thingiverse.com/thing:1661833)). <br> [<img src="http://thingiverse-production-new.s3.amazonaws.com/renders/55/1c/cb/0a/e4/5d2c2b06be7f3f6f8f0ab4638dd7c6fc_preview_featured.jpg" width="250" height="200" /> ](http://www.thingiverse.com/thing:1852868) <br> For 9XR/9XR Pro, a new 3D printed module is available which makes use of the built in antenna in the handle. This means nothing is getting out of the radio back! You can find all details of this module case on [Thingiverse](http://www.thingiverse.com/thing:2050717). <br> <img src="images/9XR_module.jpg" width="113" height="200" /> <img src="images/9XR_module_connector.jpg" width="274" height="200" />
1. A 2.4GHz antenna and pigtail
1. AVR ISP programmer like the popular USBASP programming dongle that is 3.3V safe - available from many sellers on [ebay.](http://www.ebay.com/sch/i.html?_odkw=usbasp+progammer&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR3.TRC2.A0.H0.Xusbasp+progammer+3.3V.TRS1&_nkw=usbasp+progammer+3.3V&_sacat=0) There are reports that some of the cheap programmers are not safe to use with 3.3V units (like this unit). Look for USBAsp programmers with the “LC Technologies” label. {Pascal to confirm these reports are true} Also, you will need a 10-pin to 6-pin connector to connect the USBASP to the board.
##Build instructions
## Build instructions
If you got this far you already know what you are doing!!
###Common steps
### Common steps
1. Solder all the parts according to the BOM part numbering and the images for your board (see OSHPARK for the images)
1. Fit the module into the module case. This may require some careful filing or sanding of the module to ensure a nice fit.
###PPM interface
If you are only planning on using the PPM interface with transmitter you are ready to program the module as described in Compiling and Programming the module.
### PPM interface
If you are only planning on using the PPM interface with transmitter you are ready to program the module as described in [Compiling and Programming](Compiling.md) the module.
###Enabling Serial and Telemetry interface
### Enabling Serial and Telemetry interface
If you have a transmitter that can support serial communication with the board then you need to solder some jumpers.
#### **ATmega V2.3d board**
There are four solder type jumpers on the bottom side of the board near the lower left corner when the bottom of the board is facing towards you. The silkscreen shows which jumper is which. These four jumpers enable the board to be configured in several ways as explaned below.
(J-1) Use (PPM V/V) if the incoming PPM signal is at a higher voltage level, leave open if ~~5V.
```
(J-1) Use (PPM V/V) if the incoming PPM signal is at a higher voltage level, leave open if ~~5V.
(J-2) Use (Jumper 2) to connect the incomming PPM signal to the RX pin on the processor
(J-3) Short (TELEM) only if you have done a telemetry mod to your radio, leave open if not needed. When connected, pin 2 of the two pin header (P3) is also connected.
(J-4) Use (MOD) only to connect the transmitter pin 2 to pin 1 of the two pin header (P3).
(J-4) Use (MOD) only to connect the transmitter pin 2 to pin 1 of the two pin header (P3).
```
**It is most likely J-2 will be the only one needing to be shorted for the serial method of sending model protocols. If you plan to use telemetry you will also need to solder J-3**
@ -75,22 +67,15 @@ You are now ready to go over to [Compiling and Programming](Compiling.md).
#### **STM32 board**
You need to solder bridges over jumpers to connect pin 5 from the transmitter to the RX pin on the MCU. Depending on which version of the board you have the jumpers are labled SJ1 or SJ301. Check the images below to determine your board version and the location of the solder jumper.
<img src="https://camo.githubusercontent.com/3573273fdb73ef287df888e708d34a9db3df203f/68747470733a2f2f36343464623464653335303563343061303434342d33323737323362636532393865336666353831336662343262616565666261612e73736c2e6366312e7261636b63646e2e636f6d2f32303236636664316430313837613737303537303035323539303136386466312e706e67" width="250" height="340" /> <img src="https://camo.githubusercontent.com/666a6792bebd76a8edfe389ee4246baf7dbad5bb/68747470733a2f2f36343464623464653335303563343061303434342d33323737323362636532393865336666353831336662343262616565666261612e73736c2e6366312e7261636b63646e2e636f6d2f66386237336232316439633765313537323963386237623839616565353339622e706e67" width="250" height="340" /> <img src="images/STM32_Board_V1.0_Jumper.png" width="250" height="340" />
You are now ready to go over to [Compiling and Programming STM32](Compiling_STM32.md).
#Reference Schematic <a name="Schematic"></a>
# Reference Schematic <a name="Schematic"></a>
Here is the schematic you can use to troubleshoot the module
## <a name="V32D_Schematic"></a> PCB 2.3d Schematic
## <a name="V23D_Schematic"></a> PCB 2.3d Schematic
General module schematic (reference)
<img src="images/DIY_Mulitprotocol_Module_Schematic.jpeg" width="1000" height="500" />
V2.3d Board Schematic
<img src="https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/blob/master/PCB%20v2.3d/Schematic_v2.3d.jpg" width="1000" height="500" />
## <a name="STM32_Schematic"></a> PCB STM32 Schematic
<img src="http://static.rcgroups.net/forums/attachments/4/0/8/5/8/3/a9220887-113-multi-STM32.png" width="1000" height="500" />
<img src="../PCB%20v2.3d/Schematic_v2.3d.jpg" width="1000" height="500" />
## <a name="STM32_Schematic"></a> PCB STM32 V1.0t Schematic
<img src="../STM32%20PCB/Schematic_Multiprotocol_STM32_MB_v1.0_t.jpg" width="1000" height="500" />

View File

@ -1,4 +1,4 @@
#OrangeRx Transmitter module
# OrangeRx Transmitter module
The OrangeRx transmitter module uses an Atmel XMega MCU. This requires a PDI programmer to flash firmware, the USBASP programmers do not work.

View File

@ -1,9 +1,9 @@
#PPM Setup
# PPM Setup
The Multiprotocol Module is compatible with any transmitter that is able to generate a PPM (Pulse Postion Modulation) output. This includes all transmitters with a module bay or a trainer port. It supports up to 16 channels from a PPM frame in the normal or inverted format (sometimes called positive or negative format in some transmitters).
If you want the best performance you can set the number of channels and framerate corresponding to the number of channels of the specific receiver/model.
##PPM Connections
## PPM Connections
If you do not have a module bay, there are only three wires you need to connect to get PPM to work. (The pins are numbered from top to bottom)
- PPM on pin 1
- vbat on pin 3
@ -12,7 +12,7 @@ If you do not have a module bay, there are only three wires you need to connect
Note: vbat should be between 6V and 13V when using the 4-in-1 and 2.3 PCB boards. If you built a module from scratch it depends on the voltage regulator you chose.
##Enabling PPM mode in your transmitter
## Enabling PPM mode in your transmitter
1. Enable the default Tx mode to be AETR. If you do not want to change the default channel order on your Tx you must remember to change the channel order for each new model using the module to AETR under the Model Mixer menu. (**This is really important - this is for all protocols - even for DSM as the MULTI-module firware will change the transmitted channel order according to the protocol.**)
1. The default PPM settings is 8 channels with a frame period of 22.5 ms (sometimes called the frame rate). If you want to optimize performance you should change the channels to the actual number of channels required by your model. The corresponding frame period should be set to (number of channels + 1) * 2.5 ms. For example:
@ -29,7 +29,7 @@ The default mapping of protocols to switch positions can be viewed on the Protoc
The mapping of protocols to protocol selection switch positions can be changed in configuration settings as described on the [Compiling and Programming page](Compiling.md).
##Binding in PPM mode
## Binding in PPM mode
In PPM mode follow the standard transmitter - receiver binding process:
1. Switch off the transmitter
@ -41,17 +41,17 @@ In PPM mode follow the standard transmitter - receiver binding process:
If you are having trouble binding to a consumer quad check the section below on [Getting your Bind Timing right](Bind_Timing.md). For more details on setting up specific receivers or models, check out the [Protocol Details page](Protocol_Details.md).
##Telemetry in PPM mode
## Telemetry in PPM mode
Telemetry is available as a serial stream on the TX pin of the Atmega328p in the FrSky HUB format. The serial parameters are based on the protocol selected by the protocol selection dial.
Protocol|Serial Parameters
--------|-----------------
---|---
Hubsan|9600bps 8n1
FrSkyD|9600bps 8n1
FrSkyX|57,600bps 8n1
DSM2/X|125,000bps 8n1
The serial stream is also available on pin 5 of the Module connector (pins numbered from top to bottom) on the [4-in-1 module]() and the [V2.3d modules]() provided the Tx jumper has been soldered. See the linked module documentation for what this means.
The serial stream is also available on pin 5 of the Module connector (pins numbered from top to bottom) on the [4-in-1 module](Module_BG_4-in-1.md) and the [V2.3d modules](Module_Build_yourself_PCB.md#atmega-board-v23d) provided the Tx jumper has been soldered. See the linked module documentation for what this means.
You can connect it to your TX if it is telemetry enabled or use a bluetooth adapter (HC05/HC06) along with an app on your phone/tablet [(app example)](https://play.google.com/store/apps/details?id=biz.onomato.frskydash&hl=fr) to display telemetry information and setup alerts.

View File

@ -1,4 +1,4 @@
#MULTI-Module Protocol Details
# MULTI-Module Protocol Details
**You'll find below a detailed description of every supported protocols sorted by RF modules.**
Legend:
@ -8,9 +8,9 @@ Legend:
The AETR mentionned here for all protocols depends on the TX settings compilation option set in _Config.h.
***
#A7105 RF Module
# A7105 RF Module
##FLYSKY
## FLYSKY
Extended limits supported
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
@ -19,22 +19,22 @@ A|E|T|R|CH5|CH6|CH7|CH8
Note that the RX ouput will be AETR.
###Sub_protocol V9X9
### Sub_protocol V9X9
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|LIGHT|PICTURE|VIDEO
###Sub_protocol V6X6
### Sub_protocol V6X6
CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---
FLIP|LIGHT|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL
###Sub_protocol V912
### Sub_protocol V912
CH5|CH6
---|---
BTMBTN|TOPBTN
##HUBSAN
## HUBSAN
Models: Hubsan H102D, H107/L/C/D and Hubsan H107P/C+/D+
Autobind protocol
@ -47,10 +47,9 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS
***
#CC2500 RF Module
# CC2500 RF Module
##FRSKYV = FrSky 1 way
## FRSKYV = FrSky 1 way
Models: FrSky receivers V8R4, V8R7 and V8FR.
Extended limits supported
@ -61,7 +60,7 @@ CH1|CH2|CH3|CH4
---|---|---|---
CH1|CH2|CH3|CH4
##FRSKYD
## FRSKYD
Models: FrSky receivers D4R and D8R. DIY RX-F801 and RX-F802 receivers.
Extended limits supported
@ -74,7 +73,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
##FRSKYX
## FRSKYX
Models: FrSky receivers X4R, X6R and X8R.
Extended limits supported
@ -83,17 +82,17 @@ Telemetry enabled for A1 (RxBatt), A2, RSSI, TSSI and Hub
Option=fine frequency tuning. This value is different for each board. To determine the option value, find the two limits where the RX loses connection then set the option value to half way between them. If you have a 4in1 V2 board the value is around 40.
###Sub_protocol CH_16
### Sub_protocol CH_16
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
---|---|---|---|---|---|---|---|---|----|----|----|----|----|----|----
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
###Sub_protocol CH_8
### Sub_protocol CH_8
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
##SFHSS
## SFHSS
Models: Futaba RXs and XK models.
Option=fine frequency tuning. This value is different for each board. To determine the option value, find the two limits where the RX loses connection then set the option value to half way between them. If you have a 4in1 V2 board the value is around 40.
@ -102,10 +101,9 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|CH5|CH6|CH7|CH8
***
#CYRF6936 RF Module
# CYRF6936 RF Module
##DEVO
## DEVO
Extended limits supported
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
@ -135,7 +133,7 @@ Bind procedure using PPM:
- To verify that the TX is in fixed mode: power cycle the TX, the module LED should be solid ON (no blink).
- Note: Autobind/fixed ID mode is linked to the dial number. Which means that you can have multiple dial numbers set to the same protocol DEVO with different RX_Num and have different bind modes at the same time. It enables PPM users to get model match under DEVO.
##DSM
## DSM
Extended limits supported
Telemetry enabled for TSSI and plugins
@ -150,31 +148,34 @@ Notes:
- model/type/number of channels indicated on the RX can be different from what the RX is in fact wanting to see. So don't hesitate to test different combinations until you have something working. Using Auto is the best way to find these settings.
- RX ouput will always be TAER independently of the input AETR, RETA...
###Sub_protocol DSM2_22
### Sub_protocol DSM2_22
DSM2, Resolution 1024, refresh rate 22ms
###Sub_protocol DSM2_11
### Sub_protocol DSM2_11
DSM2, Resolution 2048, refresh rate 11ms
###Sub_protocol DSMX_22
### Sub_protocol DSMX_22
DSMX, Resolution 2048, refresh rate 22ms
###Sub_protocol DSMX_11
### Sub_protocol DSMX_11
DSMX, Resolution 2048, refresh rate 11ms
###Sub_protocol AUTO
### Sub_protocol AUTO
The "AUTO" feature enables the TX to automatically choose what are the best settings for your DSM RX and update your model protocol settings accordingly.
The current radio firmware which are able to use the "AUTO" feature are ersky9x (9XR Pro, 9Xtreme, Taranis, ...) and er9x for M128 (9XR) and M2561.
For these firmwares, you must have a telemetry enabled TX and you have to make sure you set the Telemetry "Usr proto" to "DSMx".
Also on er9x you will need to be sure to match the polarity of the telemetry serial (normal or inverted by bitbashing), while on ersky9x you can set "Invert COM1" accordinlgy.
##J6Pro
## J6Pro
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---|---|----|----|----
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
***
#NRF24L01 RF Module
# NRF24L01 RF Module
##ASSAN
## ASSAN
Extended limits supported
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
@ -183,7 +184,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
The transmitter must be close to the receiver while binding.
##BAYANG
## BAYANG
Models: EAchine H8(C) mini, BayangToys X6/X7/X9, JJRC JJ850, Floureon H101 ...
Autobind protocol
@ -192,7 +193,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
---|---|---|---|---|---|---|---|---|----
A|E|T|R|FLIP|RTH|PICTURE|VIDEO|HEADLESS|INVERTED
##CG023
## CG023
Models: EAchine CG023/CG031/3D X4
Autobind protocol
@ -201,14 +202,14 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS
###Sub_protocol YD829
### Sub_protocol YD829
Models: Attop YD-822/YD-829/YD-829C ...
CH5|CH6|CH7|CH8|CH9
---|---|---|---|---
FLIP||PICTURE|VIDEO|HEADLESS
###Sub_protocol H8_3D
### Sub_protocol H8_3D
Models: EAchine H8 mini 3D, JJRC H20/H22
CH5|CH6|CH7|CH8|CH9
@ -223,7 +224,7 @@ H8 3D: OPT1=RTH then press a direction to enter headless mode (like stock TX), O
CAL: calibrate accelerometers
##CX10
## CX10
Extended limits supported
Autobind protocol
@ -234,12 +235,12 @@ A|E|T|R|FLIP|RATE
Rate: -100%=rate 1, 0%=rate 2, +100%=rate 3
###Sub_protocol GREEN
### Sub_protocol GREEN
Models: Cheerson CX-10 green pcb
Same channels assignement as above.
###Sub_protocol BLUE
### Sub_protocol BLUE
Models: Cheerson CX-10 blue pcb & some newer red pcb, CX-10A, CX-10C, CX11, CX12, Floureon FX10, JJRC DHD D1
CH5|CH6|CH7|CH8
@ -248,13 +249,13 @@ FLIP|RATE|PICTURE|VIDEO
Rate: -100%=rate 1, 0%=rate 2, +100%=rate 3 or headless for CX-10A
###Sub_protocol DM007
### Sub_protocol DM007
CH5|CH6|CH7|CH8|CH9
---|---|---|---|---
FLIP|MODE|PICTURE|VIDEO|HEADLESS
###Sub_protocol Q282 and Q242
### Sub_protocol Q282 and Q242
CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---
@ -262,120 +263,129 @@ FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|XCAL|YCAL
Model: JXD 509 is using Q282 with CH12=Start/Stop motors
###Sub_protocol JC3015_1
### Sub_protocol JC3015_1
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|MODE|PICTURE|VIDEO
###Sub_protocol JC3015_2
### Sub_protocol JC3015_2
CH5|CH6|CH7|CH8
---|---|---|---
FLIP|MODE|LED|DFLIP
###Sub_protocol MK33041
### Sub_protocol MK33041
CH5|CH6|CH7|CH8|CH9|CH10
---|---|---|---|---|---
FLIP|MODE|PICTURE|VIDEO|HEADLESS|RTH
##ESKY
## ESKY
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|GYRO|PITCH
##FY326
## FY326
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|RTH|HEADLESS|EXPERT|CALIBRATE
##FQ777
## FQ777
Model: FQ777-124
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|FLIP|RTH|HEADLESS|EXPERT
##HISKY
## HISKY
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|GEAR|PITCH|GYRO|CH8
GYRO: -100%=6G, +100%=3G
###HK310
### HK310
Models: RX HK-3000, HK3100 and XY3000 (TX are HK-300, HK-310 and TL-3C)
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
|||T|R|AUX|T_FSAFE|R_FSAFE|AUX_FSAFE
##KN
## KN
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|----|----
A|E|T|R|DR|THOLD|IDLEUP|GYRO|Ttrim|Atrim|Etrim
Dual Rate: +100%=full range, Throttle Hold: +100%=hold, Idle Up: +100%=3D, GYRO: -100%=6G, +100%=3G
###Sub_protocol WLTOYS
###Sub_protocol FEILUN
### Sub_protocol WLTOYS
### Sub_protocol FEILUN
Same channels assignement as above.
##HONTAI
## HONTAI
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|----|----
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|CAL
###Sub_protocol HONTAI
###Sub_protocol JJRCX1
### Sub_protocol HONTAI
### Sub_protocol JJRCX1
CH6|
---|
ARM|
###Sub_protocol X5C1 clone
### Sub_protocol X5C1 clone
##MJXQ
## MJXQ
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13
---|---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|RTH|AUTOFLIP|PAN|TILT
###Sub_protocol WLH08
###Sub_protocol X600
Only 3 TX IDs available, change RX_Num value 0..2 to cycle through them
###Sub_protocol X800
Only 3 TX IDs available, change RX_Num value 0..2 to cycle through them
###Sub_protocol H26D
###Sub_protocol E010
### Sub_protocol WLH08
##MT99XX
### Sub_protocol X600
Only 3 TX IDs available, change RX_Num value 0..2 to cycle through them
### Sub_protocol X800
Only 3 TX IDs available, change RX_Num value 0..2 to cycle through them
### Sub_protocol H26D
### Sub_protocol E010
## MT99XX
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS
###Sub_protocol MT
### Sub_protocol MT
Models: MT99xx
###Sub_protocol H7
### Sub_protocol H7
Models: Eachine H7, Cheerson CX023
###Sub_protocol YZ
### Sub_protocol YZ
Model: Yi Zhan i6S
Only one model can be flown at the same time since the ID is hardcoded.
###Sub_protocol LS
### Sub_protocol LS
Models: LS114, 124, 215
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|INVERT|PICTURE|VIDEO|HEADLESS
##Shenqi
## Shenqi
Autobind protocol
Model: Shenqiwei 1/20 Mini Motorcycle
@ -386,27 +396,27 @@ CH1|CH2|CH3|CH4
Throttle +100%=full forward,0%=stop,-100%=full backward.
##SLT
## SLT
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|GEAR|PITCH
##Symax
## Symax
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP||PICTURE|VIDEO|HEADLESS
###Sub_protocol SYMAX
### Sub_protocol SYMAX
Models: Syma X5C-1/X11/X11C/X12
###Sub_protocol SYMAX5C
### Sub_protocol SYMAX5C
Model: Syma X5C (original) and X2
##V2X2
## V2X2
Models: WLToys V202/252/272, JXD 385/388, JJRC H6C, Yizhan Tarantula X6 ...
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
@ -417,17 +427,21 @@ PICTURE: also automatic Missile Launcher and Hoist in one direction
VIDEO: also Sprayer, Bubbler, Missile Launcher(1), and Hoist in the other dir
##YD717
## YD717
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LIGHT|PICTURE|VIDEO|HEADLESS
###Sub_protocol YD717
###Sub_protocol SKYWLKR
###Sub_protocol SYMAX4
###Sub_protocol XINXUN
###Sub_protocol NIHUI
### Sub_protocol YD717
### Sub_protocol SKYWLKR
### Sub_protocol SYMAX4
### Sub_protocol XINXUN
### Sub_protocol NIHUI
Same channels assignement as above.

View File

@ -10,21 +10,21 @@ The source code is partly based on the Deviation TX project, thanks to all the d
**To download the latest compiled version (hex file), click on [Release](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/releases) on the top menu.**
##Contents
## Contents
[Compatible TX](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module#compatible-tx)
[Compatible TX](README-old.md#compatible-tx)
[Protocols](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module#protocols)
[Protocols](README-old.md#protocols)
[Hardware](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module#hardware)
[Hardware](README-old.md#hardware)
[Compilation and programmation](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module#compilation-and-programmation)
[Compilation and programmation](README-old.md#compilation-and-programmation)
[Troubleshooting](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module#troubleshooting)
[Troubleshooting](README-old.md#troubleshooting)
##Compatible TX
## Compatible TX
###Using standard PPM output (trainer port)
### Using standard PPM output (trainer port)
The multiprotocol TX module can be used on any TX with a trainer port.
Channels order is AETR by default but can be changed in the _Config.h.
@ -44,7 +44,7 @@ Settings per selection are located in _Config.h:
- Option: -127..+127 allowing to set specific protocol options. Like for Hubsan to set the video frequency.
- Autobind: Yes or No. At the model selection (or power applied to the TX) a bind sequence will be initiated
###Using a serial output
### Using a serial output
The multiprotocol TX module takes full advantage of being used on a Turnigy 9X, 9XR, 9XR Pro, Taranis, 9Xtreme, AR9X, ... running [er9x](http://openrcforums.com/forum/viewtopic.php?f=5&t=4598) or [ersky9X](http://openrcforums.com/forum/viewtopic.php?f=7&t=4676). An OpenTX version for Taranis is available [here](http://plaisthos.de/opentx/).
This enables full integration using the radio GUI to setup models with all the available protocols options.
@ -65,7 +65,7 @@ Notes:
- There are 2 versions of serial protocol either 8 or 16 channels. 16 channels is the latest and only available version going forward. Make sure to use the right version based on your version of er9x/ersky9x.
- Channels order is AETR by default but can be changed in _Config.h.
###Telemetry
### Telemetry
There are 4 protocols supporting telemetry: Hubsan, DSM, FrSkyD and FrSkyX.
@ -94,9 +94,9 @@ Enabling telemetry on a 9XR PRO and may be other TXs does not require any hardwa
Once the TX is telemetry enabled, it just needs to be configured on the model (see er9x/ersky9x documentation).
##Protocols
## Protocols
###TX ID
### TX ID
The multiprotocol TX module is using a 32bits ID generated randomly at first power up. This global ID is used by nearly all protocols.
There are little chances to get a duplicated ID.
@ -104,7 +104,7 @@ For DSM2/X and Devo the CYRF6936 unique manufacturer ID is used.
It's possible to generate a new ID using bind button on the Hubsan protocol during power up.
###Bind
### Bind
To bind a model in PPM Mode press the physical bind button, apply power and then release.
In Serial Mode you have 2 options:
@ -115,9 +115,9 @@ Notes:
- the physical bind button is only effective at power up. Pressing the button later has no effects.
- a bind in progress is indicated by the LED fast blinking. Make sure to bind during this period.
###Protocol selection
### Protocol selection
####Using the dial for PPM input
#### Using the dial for PPM input
PPM is only allowing access to a subset of existing protocols.
The protocols, subprotocols and all other settings can be personalized by modifying the **_Config.h** file.
@ -145,10 +145,10 @@ Dial|Protocol|Sub_protocol|RX Num|Power|Auto Bind|Option|RF Module
Note:
- The dial selection must be done before the power is applied.
####Using serial input with er9x/ersky9x
#### Using serial input with er9x/ersky9x
Serial is allowing access to all existing protocols & sub_protocols listed below.
#####A7105 RF module
##### A7105 RF module
Protocol|Sub_protocol
--------|------------
Flysky|
@ -158,7 +158,7 @@ Flysky|
|V912
Hubsan|
#####CC2500 RF module
##### CC2500 RF module
Protocol|Sub_protocol
--------|------------
FrSkyV|
@ -168,7 +168,7 @@ FrSkyX|
|CH_8
SFHSS|
#####CYRF6936 RF module
##### CYRF6936 RF module
Protocol|Sub_protocol
--------|------------
DSM|
@ -177,7 +177,7 @@ DSM|
Devo|
J6Pro|
#####NRF24L01 RF module
##### NRF24L01 RF module
Protocol|Sub_protocol
--------|------------
Hisky|
@ -235,12 +235,12 @@ HONTAI|
Note:
- The dial should be set to 0 for serial. Which means all protocol selection pins should be left unconnected.
###Protocols details
### Protocols details
**Check the [Protocols_Details.md](./Protocols_Details.md) file for a detailed description of every protocols with channels assignements.**
##Hardware
## Hardware
###RF modules
### RF modules
Up to 4 RF modules can be installed:
- [A7105](http://www.banggood.com/XL7105-D03-A7105-Modification-Module-Support-Deviation-Galee-Flysky-p-922603.html) for Flysky, Hubsan
- [CC2500](http://www.banggood.com/CC2500-PA-LNA-Romote-Wireless-Module-CC2500-SI4432-NRF24L01-p-922595.html) for FrSkyV, FrSkyD, FrSkyX and SFHSS
@ -251,21 +251,21 @@ RF modules can be installed for protocols need only. Example: if you only need t
You also need some [antennas](http://www.banggood.com/2_4GHz-3dBi-RP-SMA-Connector-Booster-Wireless-Antenna-Modem-Router-p-979407.html) and [cables](http://www.banggood.com/10cm-PCI-UFL-IPX-to-RPSMA-Female-Jack-Pigtail-Cable-p-924933.html).
###Board
### Board
The main program is running on an ATMEGA328p running @16MHz and 3.3V.
An [Arduino pro mini 16Mhz/5V](http://www.banggood.com/Wholesale-New-Ver-Pro-Mini-ATMEGA328-328p-5V-16MHz-Arduino-Compatible-Nano-Size-p-68534.html) powered at 3.3V (yes it works) can be used to build your own Multimodule. An Arduino Mini based on Atmega328p can also be used.
####Using stripboard:
#### Using stripboard:
![Screenshot](http://static.rcgroups.net/forums/attachments/4/0/8/5/8/3/t8214655-87-thumb-uploadfromtaptalk1405598143749.jpg?d=1441459923)
![Screenshot](http://static.rcgroups.net/forums/attachments/4/0/8/5/8/3/t8214656-102-thumb-uploadfromtaptalk1405598152484.jpg?d=1441459924)
####Using a [home made PCB](http://www.rcgroups.com/forums/showpost.php?p=32645328&postcount=1621):
#### Using a [home made PCB](http://www.rcgroups.com/forums/showpost.php?p=32645328&postcount=1621):
![Screenshot](http://static.rcgroups.net/forums/attachments/1/1/5/4/3/7/t8226720-197-thumb-IMG_20150715_230603155.jpg?d=1441816457)
![Screenshot](http://static.rcgroups.net/forums/attachments/1/1/5/4/3/7/t8226719-72-thumb-IMG_20150715_230024065.jpg?d=1441816456)
####Build your own board using [SMD components](http://www.rcgroups.com/forums/showpost.php?p=31064232&postcount=1020) and an [associated PCB v2.3c](https://oshpark.com/shared_projects/MaGYDg0y):
#### Build your own board using [SMD components](http://www.rcgroups.com/forums/showpost.php?p=31064232&postcount=1020) and an [associated PCB v2.3c](https://oshpark.com/shared_projects/MaGYDg0y):
![Screenshot](http://static.rcgroups.net/forums/attachments/4/0/8/5/8/3/t7566755-3-thumb-i.png?d=1423810885)
![Screenshot](http://static.rcgroups.net/forums/attachments/4/0/8/5/8/3/t7952726-108-thumb-image-62c29cf2.jpg?d=1433909893)
@ -284,7 +284,7 @@ lines through them.
[OSH Park link](https://oshpark.com/shared_projects/Ztus1ah8) if you want to order.
####Buy a ready to use and complete Multi module
#### Buy a ready to use and complete Multi module
![Screenshot](http://img.banggood.com/thumb/view/oaupload/banggood/images/1D/EB/19bb6434-4616-411e-b8fa-a4c21d9dca24.jpg)
This module can be purchased [here](http://www.banggood.com/2_4G-CC2500-A7105-Flysky-Frsky-Devo-DSM2-Multiprotocol-TX-Module-With-Antenna-p-1048377.html). All the 4 RF modules are already implemented A7105, NRF24L01, CC2500 and CYRF6936. The board is also equiped with an antenna switcher which means only one antenna for all.
@ -293,20 +293,18 @@ This module can be purchased [here](http://www.banggood.com/2_4G-CC2500-A7105-Fl
If you want to enable serial mode for er9x/ersky9x/Taranis/... and depending on your board revision, you have to do one of these modifications:
- 1st revision, add 2 resistors as shown here: ![Screenshot](http://static.rcgroups.net/forums/attachments/4/0/8/5/8/3/a8895038-170-4in1%20module.jpg)
- 2nd revision, solder pads together as shown:
<img src="http://static.rcgroups.net/forums/attachments/4/8/3/5/8/4/a9206217-177-IMG_5790.jpg" width="350">
- 2nd revision, solder pads together as shown: <br> <img src="http://static.rcgroups.net/forums/attachments/4/8/3/5/8/4/a9206217-177-IMG_5790.jpg" width="350">
Note: if you have the 1st board revision (check pictures above), sometime bind occures at power up even without pressing the bind button or not having an autobind protocol. To solve this issue, replacing the BIND led resistor (on the board back) of 1.2K by a 4.7K.
###Schematic
### Schematic
![Screenshot](http://static.rcgroups.net/forums/attachments/4/0/8/5/8/3/a8443844-119-multiprotocol_diagram_rotary_serial_2.jpg)
Notes:
- Attention: All modules are 3.3V only, never power them with 5V.
- For serial, the dial switch is not needed and the bind button optionnal
###Radio integration
### Radio integration
If you build your own version of the board you can 3D print this case (details [here](http://www.rcgroups.com/forums/showpost.php?p=33294140&postcount=2034)):
![Screenshot](http://static.rcgroups.net/forums/attachments/1/1/5/4/3/7/t8462144-54-thumb-Multi_case_9XR.jpg?d=1448575289)
@ -318,9 +316,9 @@ If you have the Banggood ready to use board you can 3D print this case (details
<img src="http://static.rcgroups.net/forums/attachments/4/8/3/5/8/4/a9206411-90-IMG_5793.jpeg" width="200">
<img src="http://static.rcgroups.net/forums/attachments/4/8/3/5/8/4/a9206445-131-IMG_5796.jpeg" width="200">
##Compilation and programmation
## Compilation and programmation
###Toolchain
### Toolchain
Multiprotocol source can be compiled using the Arduino IDE.
The currently supported Arduino version is [1.6.10](https://www.arduino.cc/download_handler.php?f=/arduino-1.6.10-windows.exe).
@ -335,7 +333,7 @@ Notes:
- Compilation of the code posted here works. So if it doesn't for you this is a problem with your setup, please double check everything before asking.
- If you want to reduce the code size even further, you can modify the file platform.txt located in "C:\Program Files (x86)\Arduino\hardware\arduino\avr". Set the line "compiler.c.elf.extra_flags=" to "compiler.c.elf.extra_flags=-Wl,--relax".
###Upload the code using ISP (In System Programming)
### Upload the code using ISP (In System Programming)
It is recommended to use an external programmer like [USBASP](http://www.banggood.com/USBASP-USBISP-3_3-5V-AVR-Downloader-Programmer-With-ATMEGA8-ATMEGA128-p-934425.html) to upload the code in the Atmega328. The programmer should be set to 3.3V or nothing to not supply any over voltage to the multimodule and avoid any damages.
The dial must be set to 0 before flashing!
@ -344,7 +342,7 @@ From the Arduino environment, you can use this shortcut to compile and upload to
To flash the latest provided hex file under [Release](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/releases), you can use a tool like [AVR Burn-O-Mat](http://avr8-burn-o-mat.aaabbb.de/), set the microcontroller to m328p and flash it.
###Upload the code using FTDI (USB serial to TTL)
### Upload the code using FTDI (USB serial to TTL)
Use this method only for Arduino Pro Mini boards with bootloader.
Use an external FTDI adapter like [this one](http://www.banggood.com/FT232RL-FTDI-USB-To-TTL-Serial-Converter-Adapter-Module-For-Arduino-p-917226.html).
@ -355,7 +353,7 @@ From the Arduino environment, you can use Upload button which will compile and u
To upload the latest provided hex file under [Release](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/releases), you can use a tool like [XLoader](http://russemotto.com/xloader/), set the microcontroller to Atmega328 and upload it.
###Set fuses
### Set fuses
Use a tool like [AVR Burn-O-Mat](http://avr8-burn-o-mat.aaabbb.de/) to set the fuses of the Atmega328 to:
- Extended Fuse 0x05 (or 0xFD which is the same)
- High Fuse 0xD2
@ -363,25 +361,25 @@ Use a tool like [AVR Burn-O-Mat](http://avr8-burn-o-mat.aaabbb.de/) to set the f
This will make sure your ATMEGA328 is well configured and the global TX ID is not erased at each updates.
##Troubleshooting
## Troubleshooting
###LED status
### LED status
- off: program not running or a protocol selected with the associated module not installed.
- flash(on=0.1s,off=1s): invalid protocol selected (excluded from compilation or invalid protocol number)
- slow blink(on=0.5s,off=0.5s): serial has been selected but no valid signal has been seen on the RX pin.
- fast blink(on=0.1s,off=0.1s): bind in progress.
- on: normal operation.
###Protocol selection
####Input Mode - PPM
### Protocol selection
#### Input Mode - PPM
- The protocol/mode selection must be done before the power is applied.
- Connect 1 to 4 of the selection protocol pins to GND.
####Input Mode - Serial
#### Input Mode - Serial
- Make sure you have done the mods to the v2.3c PCB by adding the 2.2k and 470 ohm resistors as indicated in the [Board section] (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module#board).
- Leave all 4 selection pins unconnected.
###Bind
### Bind
Make sure to follow this procedure: press the bind button, apply power and then release it after 1sec. The LED should be blinking fast indicating a bind status and then fixed on when the bind period is over. It's normal that the LED turns off when you press the bind button, this behavior is not controlled by the Atmega328.
For serial, the preffered method is to bind via the GUI protocol page.
@ -389,7 +387,7 @@ If your module is always/sometime binding at power up without pressing the butto
- Arduino Pro Mini with an external status LED: to work around this issue connect a 10K resistor between D13 and 3.3V.
- 4in1 module V1 (check 4in1 pictures): to solve this issue, replacing the BIND led resistor (on the board back) of 1.2K by a 4.7K.
###Report issues
### Report issues
You can report your problem using the [GitHub issue](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/issues) system or go to the [Main thread on RCGROUPS](http://www.rcgroups.com/forums/showthread.php?t=2165676) to ask your question.
Please provide the following information:
- Multiprotocol code version

View File

@ -1,19 +1,20 @@
# Compatible Transmitters
There are two different options for the interface between the MULTI-Module and the transmitter: PPM and Serial. The considerations are different for each.
There are two different modes to interface the MULTI-Module and the transmitter: PPM and Serial. The considerations are different for each.
- **PPM** is more generic, easy to implement and will work with most transmitters.
- **Serial** requires custom firmware on the transmitter but brings added functionality including protocol selection through the Tx interface and the option of telemetry (with the right transmitter firmware).
Any Tx that provides a PPM output (like a trainer port, or a transmitter with a RF module bay) is compatible with the MULTI-module. In practice, most of the documentation on this site is focused on building modules that slip into your transmitters module bay.
Any Tx providing a PPM output (like a trainer port, or a transmitter with a RF module bay) is compatible with the MULTI-module.
##PPM
## PPM
The DIY Mulitprotocol module supports industry standard PPM interface that works with all transmitters with either a module bay, and/or a trainer port. Even the older 72MHz FM radios support this standard.
When using the standard PPM Tx output, the protocol selection is achieved through a 16 position rotary switch on the module. This enables 15 protocol/sub-protocol/options combinations to be selected. Binding is achieved by pressing a bind button on the back of the module (see picture below)
<img src="images/PPM.png" width="338" height="200" />
<img src="images/4-in-1_Module_PPM_Controls.jpg" width="150" height="180" />
The same module plug is available on all versions of the module with the same signal locations. Some radios have an open collector output (Futaba, Graupner...), in this case you should add a 4.7K resistor between PPM and BATT.
When using the standard PPM Tx output, the protocol selection is achieved through a 16 position rotary switch on the module. This enables 15 (0=serial) protocol/sub-protocol/options combinations to be selected. Binding is achieved by pressing a bind button on the back of the module (see picture below)
Since the module supports literally hundreds of protocol/sub-protocol/options combinations, you must select which of these will map to the 15 positions on the switch. Refer to the [Compiling and Programming](Compiling.md) page for information on how to do his.
@ -21,7 +22,7 @@ Even in PPM mode it may still be possible to access telemetry information from s
For transmitter setup using the PPM protocol go to the [PPM Setup page](PPM_Setup.md)
##Serial
## Serial
Transmitters that run er9X, erSky9X or OpenTx firmwares (like the FrSky Taranis, FlySky TH9X and Turnigy 9X family of transmitters) have the option of using a fast serial communication protocol between the Tx and the DIY Multiprotocol module. Using this serial communication protocol has some significant advantages:
1. selecting the specific radio protocol (e.g. DSM) and the sub protocol (e.g. DSMX22) is done directly in the menu system of the Tx (see the picture below)
@ -36,10 +37,11 @@ This serial protocol does not require any hardware modifications, but **will** r
Transmitter|Firmware Options|Telemetry Enabled
:----------|:---------------|:----------------
[FrSky Taranis/Plus/9XE](Tx-Taranis.md)| erSky9x, OpenTx 2.1.8 Multi|Yes - native
[Turnigy 9X/9xR](Tx-FlyskyTH9X.md)|er9x|[Mod required](#Telemetry_Mod), No DSM telem
[FrSky Taranis X9D/X9D+/9XE](Tx-Taranis.md)| erSky9x, OpenTx 2.1.9 Multi, OpenTX 2.2 (multimodule option)|Yes - native
[Frsky Taranis Q X7/Horus](Tx-Taranis.md)| OpenTX 2.2 (multimodule option)| Yes - native
[Turnigy 9X/9xR](Tx-FlyskyTH9X.md)|er9x|[Mod required](#Telemetry_Mod)
[Turnigy 9XR-Pro](Tx-erSky9X.md)|erSky9x|Yes - native
[FrSky TH9x](Tx-FlyskyTH9X.md)|er9x|[Mod required](#Telemetry_Mod), No DSM telem
[FlySky TH9x](Tx-FlyskyTH9X.md)|er9x|[Mod required](#Telemetry_Mod)
[SKY board](Tx-erSky9X.md)|erSky9x|Yes - native
[AR9X board](Tx-erSky9X.md)|erSky9x|Yes - native
[9Xtreme board](Tx-erSky9X.md)|erSky9x|Yes - native
@ -48,7 +50,7 @@ Transmitter|Firmware Options|Telemetry Enabled
Click on your transmitter above to view specific setup instructions.
##Telemetry
## Telemetry
To enable serial telemetry you need one of the radios and firmwares listed in the table above and **may** require modifications to your Tx. See the table above. Before attempting telemetry check the following:
@ -57,7 +59,7 @@ To enable serial telemetry you need one of the radios and firmwares listed in th
1. Your transmitter hardware is telemetry enabled, or you have done the required mods. Check the table above.
<a name="Telemetry_Mod"></a>
##Optional Telemetry mod for 9X/R TH9X transmitters
## Optional Telemetry mod for 9X/R TH9X transmitters
The telemetry mod for these transmitters has evolved. The original and popular "FrSky Telemetry Mod" requires 2 pins on the transmitter module board to be modified (RX on pin 5 and TX on pin 2). All the recent MULTI-Module hardware options supports serial transmission on pin 1 (the same pin as the PPM signal) so, in this case, only the mod on pin 5 is required.
A good tutorial to follow is Oscar Liang's [here](http://blog.oscarliang.net/turnigy-9x-advance-mod/) but when you get to wiring up the Tx Module bay pins, you only need to perform the steps relevant for Pin 5.
@ -65,16 +67,11 @@ A good tutorial to follow is Oscar Liang's [here](http://blog.oscarliang.net/tur
You can see Midelic's original instructions [here](http://www.rcgroups.com/forums/showpost.php?p=28359305&postcount=2)
##Other Notes:
- er9X and erSky9X firmware already supports Multiprotocol Module as a standard feature. At time of writing it looks like that the next major release of OpenTx - OpenTx 2.2 - will have DIY Mulitprotocol support as a standard feature.
## Other Notes:
- er9X and erSky9X firmware already supports Multiprotocol Module as a standard feature. The next major release of OpenTx - OpenTx 2.2 - will have DIY Mulitprotocol support as a standard feature.
- Owners of Walkera Devo transmitters should look at the [Deviation-Tx](http://www.deviationtx.com) project for how to achieve the same end goal with your transmitters.
- To enable telemetry on a Turnigy 9X or 9XR you need to modify your TX [read this.](#Telemetry_Mod).
- DSM telemetry is not available on er9x due to a lack of flash space.
- Enabling telemetry on a 9XR PRO and may be other TXs does not require any hardware modifications. The additional required serial pin is already available on the TX back module pins.
- Once the TX is telemetry enabled, it just needs to be configured on the model (see er9x/ersky9x documentation).

View File

@ -1,30 +1,39 @@
# Troubleshooting
##LED status
###Green LED
- Off: no power to the module
- On: module is powered up
## LED status
###Red LED (bind LED)
- Off: program not running or a protocol selected with the associated module not installed
- Flash(on=0.1s,off=1s): invalid protocol selected (excluded from compilation or invalid protocol number)
- Fast blink(on=0.1s,off=0.1s): bind in progress
- Slow blink(on=0.5s,off=0.5s): serial has been selected but no valid signal is being seen on the RX pin.
- Slower blink(on=1s,off=1s): PPM has been selected but no valid signal is being seen on the PPM pin.
- On: Module is in normal operation mode (transmitting control signals).
### Green LED
- **_Off_**: no power to the module
- **_On_**: module is powered up
### Red LED (bind LED)
- **_Off_**: program not running or a protocol selected with the associated module not installed
- **_Flash(on=0.05s,off=1s)_**: invalid protocol selected (excluded from compilation or invalid protocol number)
- **_Inverted Flash(on=1s,off=0.1s)_**: module is waiting for a bind event (Bind from channel or Bind in radio GUI) to launch the protocol in bind mode
- **_Fast blink(on=0.1s,off=0.1s)_**: bind in progress
- **_Slow blink(on=0.5s,off=0.5s)_**: serial has been selected but no valid signal is being seen on the RX pin.
- **_Slower blink(on=1s,off=1s)_**: PPM has been selected but no valid signal is being seen on the PPM pin.
- **_On_**: Module is in normal operation mode (transmitting control signals).
## Protocol selection
### Input Mode - PPM
##Protocol selection
###Input Mode - PPM
- The protocol/mode selection must be done before the power is applied to the module
- Often the signal is not sent to the module until the transmitter has performed safety checks (like switch and throttle position settings)
- Check that at least one of the protocol selection pins is connected to GND.
- Some radios have an open collector output (Futaba, Graupner...), in this case add a 4.7K resistor between PPM and BATT.
### Input Mode - Serial
###Input Mode - Serial
- Make sure you have done the serial mods as indicated in the [hardware page for your board] (Hardware.md).
- Protocol selection dial must be in the 0 position or leave all 4 selection pins unconnected.
- Often the signal is not sent to the module until the transmitter has performed safety checks (like switch and throttle position settings)
##Bind
## Bind
Make sure to follow this procedure: press the bind button, apply power and then release after the red LED starts flashing. The LED should be blinking fast indicating a bind status and then fixed on when the bind period is over. It's normal that the LED turns off when you press the bind button, this behavior is not controlled by the Atmega328.
For serial, the preffered method is to bind via the GUI protocol page.
@ -32,7 +41,13 @@ If your module is always/sometime binding at power up without pressing the butto
- Arduino Pro Mini with an external status LED: to work around this issue connect a 10K resistor between D13 and 3.3V.
- 4in1 module V1 (check 4in1 pictures): to solve this issue, replacing the BIND led resistor (on the board back) of 1.2K by a 4.7K.
##Report issues
FrSky & SFHSS bind issues are ususally due to Option=fine frequency tuning not set properly. This value is different for each Module. To determine this value:
- find a value where the RX accepts to bind. A good start is to use one of these values -40, 0 and 40.
- find the values min/max where the RX loses connection. In serial mode you can change the value and see the effect live.
- set the value to half way between min and max.
## Report issues
You can report your problem using the [GitHub issue](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/issues) system or go to the [Main thread on RCGROUPS](http://www.rcgroups.com/forums/showthread.php?t=2165676) to ask your question.
Please provide the following information:
- Multiprotocol code version

View File

@ -1,4 +1,4 @@
#Flysky TH9X family of transmitters
# Flysky TH9X family of transmitters
This page is relevant to the following transmitters:
* FlySky TH9X
* Turnigy 9X, Turnigy 9XR
@ -19,21 +19,21 @@ Serial mode is only supported by the er9X firmware. Loading this firmware is be
er9X is very well documented, see [here](http://openrcforums.com/forum/viewtopic.php?f=5&t=6473#p90349)
###Enabling Serial Mode
### Enabling Serial Mode
1. Confirm that the MULTI-Module has the required physical connections between the pins on the back of the Tx and the ATMega328 microprocessor. This may require some soldering and depends on which version of the MULTI-Module you have. Check out your modules hardware page under the section **Enabling your MULTI-Module for Serial** for details. Click here for the [hardware](Hardware.md) pages.
1. Plug in your DIY Multiprotocol module into the transmitter module bay. If you have a rotary protocol selection switch, turn the switch to position 0 to put the unit into Serial mode.
1. Ensure throttle is down and all switches are in the start position and power up the Tx. The red LED on the DIY Multiprotocol module should be flashing with a period of about 1 second indicating that it has not established a valid serial link with the Tx. This is expected as we have not set up the Tx yet.
1. Create a new model and confirm that the channel order is set to AETR (**This is really important - this is for all protocols - even for DSM as the MULTI-module firware will change the transmitted channel order according to the protocol.**
1. Create a new model and confirm that the channel order is set to AETR (**This is really important - this is for all protocols - even for DSM as the MULTI-module firware will change the transmitted channel order according to the protocol.**
1. In the Model Settings menu scroll down to change the RF settings to MULTI {mikeb - can you write this line }
1. The red LED on the MULTI-Module should briefly flash and then go off. This confirms that the MULTI-Module has established serial communication with the Tx. If the red LED on the module continues to flash at a period of about 1 seconds then it signals that serial communication has not been established. Check your settings under the model menu as described above and check that the protocol selection switch on the module is at 0 (enable Serial mode). If there is still no communication, power down and power up the Tx. Finally check that you have correctly enabled your module for serial as described on the hardware page for your module under the heading "Enabling your module for Serial". Click here to access the [hardware](Hardware.md) and then click on the picture of your module.
###Protocol Selection in Serial mode
### Protocol Selection in Serial mode
To select the protocol:
1. In the Model Setting menu, scroll through the available options under the MULTI option {mikeb to confirm}.
1. Depending on which protocol you have selected you may be required to select a sup-protocol and options. For example, the FrSky protocol has three sub-protocols FrSky_V, FrSky_D and FrSky_X. In some cases the sub-protocols have options that could specify the number of channels, packet frame rate or fine frequency tuning. Check out the [Protocol Details](Protocol_Details.md) page for detailed information and suggestions regarding the sub-protocols and options. The picture below shows the settings in the erSky Model Setup menu for FrSkyX subprotocol with {mike to insert} options:
1. Depending on which protocol you have selected you may be required to select a sup-protocol and options. For example, the FrSky protocol has three sub-protocols FrSky_V, FrSky_D and FrSky_X. In some cases the sub-protocols have options that could specify the number of channels, packet frame rate or fine frequency tuning. Check out the [Protocol Details](../Protocols_Details.md) page for detailed information and suggestions regarding the sub-protocols and options. The picture below shows the settings in the erSky Model Setup menu for FrSkyX subprotocol with {mike to insert} options:
{mikeb to send simple picture}
###Binding in Serial mode
### Binding in Serial mode
1. Switch on the model or put the receiver into bind mode
1. On the transmitter go to the Model Settings menu and scroll down to the [Bind] menu option and press Enter.
1. Press Enter again to exit Bind mode

View File

@ -1,29 +1,29 @@
# FrSky Taranis/Horus Setup
This page contains setup instructions for the FrSky family of transmitters. These include the Trananis X9D, Taranis X9D Plus, Taranis X9E and Horus X12S. It may also be relevant to the following transmitters: Turnigy 9XR Pro, Sky board-based, AR9X board-based, 9Xtreme board-based and AR9X Uni board-based.
This page contains setup instructions for the FrSky family of transmitters. These include the Trananis X9D, Taranis X9D Plus, Taranis X9E and Horus X12S. It may also be relevant to the following transmitters: Turnigy 9XR Pro, Sky board-based, AR9X board-based, 9Xtreme board-based and AR9X Uni board-based, for these the OpenTX is implemented but currently untested.
<img src="http://www.frsky-rc.com/product/images/pic/1456723548.jpg" width="300" height="200" />
<img src="http://www.frsky-rc.com/product/images/pic/1456723588.jpg" width="300" height="200" />
<img src="http://www.frsky-rc.com/product/images/pic/1471248674.jpg" width="300" height="200" />
<img src="http://www.frsky-rc.com/product/images/pic/1483518722.jpg" width="300" height="200" />
The instructions below are relevant to the following firmwares:
1. Taranis with erSky9X available [here](http://www.er9x.com)
1. Taranis with OpenTx available [here](http://plaisthos.de/opentx/)
1. Taranis/Horus with OpenTX 2.2 and multimodule option enabled [here](http://www.open-tx.org/)
1. Taranis with OpenTx available [here](http://plaisthos.de/opentx/), outdated use OpenTX 2.2
If you use OpenTX Version 2.2 RC9 or later is strongly recommended as earlier version had a bug that scaled -100;100% output to -125%;125% output.
The MULTI-module can be used with all transmitters and firmwares in PPM mode. Taranis transmitters running erSky9X or OpenTX (Version 2.1.9 Multi or Version 2.2) fully support Serial mode.
## PPM Mode
Please refer to the [PPM Setup](PPM_Setup.md) page.
##Serial mode
###Enabling Serial Mode
## Serial mode
### Enabling Serial Mode
To operate in serial mode, you need one of these firmwares:
1. erSky9x
1. OpenTx supporting the MULTI-Module (Version 2.18 Multi or later)
Check and upload a supported firmware. The latest available version at time of writing are:
- erSky9x Revision 218 or later - the hex files are available [here](http://www.er9x.com) (Mike's latests test versions are available [here](http://openrcforums.com/forum/viewtopic.php?f=7&t=4676)).
- OpenTx 2.1.8 Multi or later - the hex files are available [here](http://plaisthos.de/opentx/)
1. erSky9x Revision 218 or later - the hex files are available [here](http://www.er9x.com) (Mike's latests test versions are available [here](http://openrcforums.com/forum/viewtopic.php?f=7&t=4676)).
1. OpenTx supporting the MULTI-Module (Version 2.1.8 Multi or later, 2.2 recommended). Check and upload a supported firmware. The latest available version at time of writing are:
- OpenTx 2.2RC16 or later [www.open-tx.org](http://www.open-tx.org/)
- Please make sure that the "multimodule" option in OpenTX Companion is checked: <br> <img src="images/opentx-config-multi.png"> <br>
Tutorials for uploading new firmware using the SD Card are available [here](http://www.dronetrest.com/t/how-to-upgrade-firmware-for-frsky-taranis-x9d/959) or the CompanionTx or eepe software (recommended) are available [here](http://open-txu.org/home/undergraduate-courses/fund-of-opentx/part-2-flashing-opentx/).
@ -31,22 +31,22 @@ Tutorials for uploading new firmware using the SD Card are available [here](http
First, confirm that the MULTI-Module has the required physical connections between the pins on the back of the Tx and the ATMega328 microprocessor. This may require some soldering and depends on which version of the DIY Multiprotocol module you have. Check out the specific pages for your module hardware (under the section "Enabling Serial") linked [here](Hardware.md) for details.
1. Plug in your MULTI-Module into the transmitter's module bay.
2. If you have a rotary protocol selection switch, turn the switch to position 0 to put the unit into Serial mode.
2. Ensure throttle is down and all switches are in the start position and power up the Transmitter. The red LED on the MULTI-Module should be flashing with a period of about 1s indicating that it has not established a valid serial link with the Tx. This is expected as we have not set up the Tx yet.
3. Create a new model (make sure channel order is AETR - **This is really important - this is for all protocols - even for DSM as the MULTI-module firware will change the transmitted channel order according to the protocol.**) and on the first Model Settings page scroll down to disable the internal RF and enable the external RF by selecting MULTI as the external RF. Your Transmitter settings should look like this:
<img src="images/settings-horus.png" /> or <img src="images/settings-taranis.png" />
1. Plug in your MULTI-Module into the transmitter's module bay.
1. If you have a rotary protocol selection switch, turn the switch to position 0 to put the unit into Serial mode.
1. Ensure throttle is down and all switches are in the start position and power up the Transmitter. The red LED on the MULTI-Module should be flashing with a period of about 1s indicating that it has not established a valid serial link with the Tx. This is expected as we have not set up the Tx yet.
1. Create a new model (make sure channel order is AETR - **This is really important - this is for all protocols - even for DSM as the MULTI-module firware will change the transmitted channel order according to the protocol.**) and on the first Model Settings page scroll down to disable the internal RF and enable the external RF by selecting MULTI as the external RF. Your Transmitter settings should look like this: <br> <img src="images/settings-horus.png" /> <br> or <br> <img src="images/settings-taranis.png" /> <br> The Red LED on the MULTI-Module should briefly flash and then stay on. This confirms that the MULTI-Module module has established serial communication with the Tx.
1. If the red LED on the module continues to flash at a period of about 1s then it signals that serial communication has not been established. Check your settings under the model menu as described above and check that the protocol selection switch on the module is at 0 (zero). If there is still no communication, power down and power up the Tx. Finally check that you have correctly enabled your module for serial as described in specific pages for your module hardware (under the section "Enabling Serial") linked [here](Hardware.md)
The Red LED on the MULTI-Module should briefly flash and then stay on. This confirms that the MULTI-Module module has established serial communication with the Tx.
4. If the red LED on the module continues to flash at a period of about 1s then it signals that serial communication has not been established. Check your settings under the model menu as described above and check that the protocol selection switch on the module is at 0 (zero). If there is still no communication, power down and power up the Tx. Finally check that you have correctly enabled your module for serial as described in specific pages for your module hardware (under the section "Enabling Serial") linked [here](Hardware.md)
###Protocol Selection in Serial mode
### Protocol Selection in Serial mode
To select the protocol, scroll through the available options under the Model Settings menu. Depending on which protocol you have selected you may be required to select a sup-protocol and options. For example, the FrSky protocol has three sub-protocols FrSkyV, FrSkyD and FrSkyX. Each of the sub-protocols may have options that specify the number of channels and the packet frame rate, etc.
The following picture shows DSM DSMX Option 6 (6 channels and 11ms frame rate). Check out the [Protocol Details](Protocol_Details.md) page for detailed information and suggestions regarding the sub-protocols and options.
###Binding in Serial mode
### Protcol Status in Serial mode (OpenTX)
If you see ```NO MULTI_TELEMETRY``` or no ```NO TELEMETRY``` in the setup screen of the external module, like this: <br> <img width="594" height="213" src="images/X7-no-telemetry.png" /> <br> you are missing the ```MULTI_TELEMETRY``` and/or ```INVERT_TELEMTRY``` option in your ```_Config.h``` and/or [you need to hardware modifications to enable telemetry](Hardware.md). OpenTX also shows the ```NO TELEMETRY``` message if no module status has been received in the last 2s which can indicate a non working module if the telemetry status worked before. With the option enabled, the right telemetry type is automatically detected and you will see the status of the module: <br> <img width="580" height="210" src="images/X7-protocol-invalid.png"> <br> (Selected protocol is not available, most probably mssing from ```_Config.h```) <br> <img width="576" height="209" src="images/X7-bind.png"> <br> (Module is currently binding and code on the module is running V1.1.6.10)
### Binding in Serial mode
1. Switch on the model or put the receiver into bind mode
1. On the transmitter go to the Model Settings menu and scroll down to the [Bind] menu option and press Enter.
1. Press Enter again to exit Bind mode

View File

@ -1,4 +1,4 @@
#erSky9X family of transmitters
# erSky9X family of transmitters
This page is relevant to the following transmitters:
- Taranis running erSky9X (for the Taranis running OpenTx see [here](Tx-Taranis.md))
- Turnigy 9XR Pro (for Turnigy 9X see [here](Tx-FlyskyTH9X.md))
@ -21,7 +21,7 @@ Serial mode is only supported by the erSky9X firmware. Loading this firmware is
erSky9X is well documented, the slightly outdated erSky9X documentation is [here](http://openrcforums.com/forum/viewtopic.php?f=5&t=6473#p90349). You may find the new Er9x manual very helpful in understanding Ersky9x as the two firmwares are very closely related. It provides more detailed explanations and numerous relevant programming examples and is available [here](http://openrcforums.com/forum/viewtopic.php?f=5&t=6473#p90349).
###Enabling Serial Mode
### Enabling Serial Mode
1. Confirm that the MULTI-Module has the required physical connections between the pins on the back of the Tx and the ATMega328 microprocessor. This may require some soldering and depends on which version of the MULTI-Module you have. Check out your modules hardware page under the section **Enabling your module for Serial** for details. Click on the image that corresponds to your MULTI-Module on the [hardware](Hardware.md) page.
1. Plug in your MULTI-Module into the transmitter module bay. If you have a rotary protocol selection switch, turn the switch to position 0 to put the unit into Serial mode.
1. Ensure throttle is down and all switches are in the start position and power up the Tx. The red LED on the MULTI-Module should be flashing with a period of about 1 second indicating that it has not established a valid serial link with the Tx. This is expected as we have not set up the Tx yet.
@ -29,13 +29,13 @@ erSky9X is well documented, the slightly outdated erSky9X documentation is [here
1. In the Model Setup menu scroll down to the **Protocol** submenu and change the RF settings to MULTI. This should reveal a set of additional options (like Protocol and Options)
1. The red LED on the MULTI-Module should briefly flash and then remain solid. This confirms that the MULTI-Module has established serial communication with the Tx. If the red LED on the module continues to flash at a period of about 1 seconds then it signals that serial communication has not been established. Check your settings under the model menu as described above and check that the protocol selection switch on the module is at 0 (enable Serial mode). If there is still no communication, power down and power up the Tx. Finally check that you have correctly enabled your module for serial as described on the hardware page for your module under the heading "Enabling your module for Serial". Click here to access the [hardware](Hardware.md) and then click on the picture of your module.
###Protocol Selection in Serial mode
### Protocol Selection in Serial mode
To select the protocol:
1. In the Model Setting menu, scroll through the available options under the MULTI protocol
1. Depending on which protocol you have selected you may be required to select a sup-protocol and options. For example, there are three protocols that correspond to FrSky recievers: FrSky_V, FrSky_D and FrSky_X. In some cases the sub-protocols have options that could specify the number of channels, packet frame rate or fine frequency tuning. Check out the [Protocol Details](Protocol_Details.md) page for detailed information and suggestions regarding the sub-protocols and options. The picture below shows the settings in the erSky Model Setup menu for FrSkyX subprotocol with {mike to insert} options:
1. Depending on which protocol you have selected you may be required to select a sup-protocol and options. For example, there are three protocols that correspond to FrSky recievers: FrSky_V, FrSky_D and FrSky_X. In some cases the sub-protocols have options that could specify the number of channels, packet frame rate or fine frequency tuning. Check out the [Protocol Details](../Protocols_Details.md) page for detailed information and suggestions regarding the sub-protocols and options. The picture below shows the settings in the erSky Model Setup menu for FrSkyX subprotocol with {mike to insert} options:
{mikeb to send simple picture}
###Binding in Serial mode
### Binding in Serial mode
1. Switch on the model or put the receiver into bind mode
1. On the transmitter go to the Model Settings menu and scroll down to the [Bind] menu option and press Enter.
1. Press Enter again to exit Bind mode

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
docs/images/6pin_header.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
docs/images/9XR_module.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
docs/images/ISP_header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
docs/images/PPM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

BIN
docs/images/ProMini_ISP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 78 KiB

BIN
docs/images/V2b_ISP.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
docs/images/X7-bind.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Some files were not shown because too many files have changed in this diff Show More