Merge remote-tracking branch 'refs/remotes/pascallanger/master' into benlye-multi-new

This commit is contained in:
Ben Lye 2017-11-20 21:54:49 +00:00
commit b779becf8c
10 changed files with 51 additions and 9 deletions

View File

@ -0,0 +1,2 @@
[Source for the StmMultiUSB=STM32duino-bootloader](https://github.com/rogerclarkmelbourne/STM32duino-bootloader)
If you want the latest version, you should look for the file generic_boot20_pa1.bin.

Binary file not shown.

View File

@ -53,7 +53,11 @@ void ASSAN_send_packet()
uint16_t temp; uint16_t temp;
for(uint8_t i=0;i<8;i++) for(uint8_t i=0;i<8;i++)
{ {
temp=Servo_data[i]<<3; if(mode_select != MODE_SERIAL) // If in PPM mode extend the output to 1000...2000µs
temp=convert_channel_16b_nolim(i,1000,2000);
else
temp=Servo_data[i];
temp<<=3;
packet[2*i]=temp>>8; packet[2*i]=temp>>8;
packet[2*i+1]=temp; packet[2*i+1]=temp;
} }

View File

@ -133,7 +133,7 @@ static void __attribute__((unused)) flysky_build_packet(uint8_t init)
{ {
uint8_t i; uint8_t i;
//servodata timing range for flysky. //servodata timing range for flysky.
////-100% =~ 0x03e8//=1000us(min) //-100% =~ 0x03e8//=1000us(min)
//+100% =~ 0x07ca//=1994us(max) //+100% =~ 0x07ca//=1994us(max)
//Center = 0x5d9//=1497us(center) //Center = 0x5d9//=1497us(center)
//channel order AIL;ELE;THR;RUD;AUX1;AUX2;AUX3;AUX4 //channel order AIL;ELE;THR;RUD;AUX1;AUX2;AUX3;AUX4
@ -147,6 +147,8 @@ static void __attribute__((unused)) flysky_build_packet(uint8_t init)
uint16_t temp=Servo_data[CH_AETR[i]]; uint16_t temp=Servo_data[CH_AETR[i]];
if(sub_protocol == CX20 && CH_AETR[i] == ELEVATOR) if(sub_protocol == CX20 && CH_AETR[i] == ELEVATOR)
temp=servo_mid-temp; //reverse channel temp=servo_mid-temp; //reverse channel
if(mode_select != MODE_SERIAL) //if in PPM mode extend the output to 1000...2000µs
temp=map(temp,servo_min_100,servo_max_100,1000,2000);
packet[5 + i*2]=temp&0xFF; //low byte of servo timing(1000-2000us) packet[5 + i*2]=temp&0xFF; //low byte of servo timing(1000-2000us)
packet[6 + i*2]=(temp>>8)&0xFF; //high byte of servo timing(1000-2000us) packet[6 + i*2]=(temp>>8)&0xFF; //high byte of servo timing(1000-2000us)
} }

View File

@ -18,7 +18,7 @@
18,MJXq,WLH08,X600,X800,H26D,E010,H26WH 18,MJXq,WLH08,X600,X800,H26D,E010,H26WH
19,Shenqi 19,Shenqi
20,FY326,FY326,FY319 20,FY326,FY326,FY319
21,SFHSS 21,SFHSS,XK,T8J,T10J,TM-FH
22,J6PRO 22,J6PRO
23,FQ777 23,FQ777
24,ASSAN 24,ASSAN

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 1 #define VERSION_MINOR 1
#define VERSION_REVISION 6 #define VERSION_REVISION 6
#define VERSION_PATCH_LEVEL 23 #define VERSION_PATCH_LEVEL 24
//****************** //******************
// Protocols // Protocols
//****************** //******************
@ -196,6 +196,13 @@ enum Q303
CX10D = 2, CX10D = 2,
CX10WD = 3, CX10WD = 3,
}; };
enum SFHSS
{
XK = 0,
T10J = 1,
T8J = 2,
TM_FH = 3,
};
#define NONE 0 #define NONE 0
#define P_HIGH 1 #define P_HIGH 1
@ -585,6 +592,11 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
CX35 1 CX35 1
CX10D 2 CX10D 2
CX10WD 3 CX10WD 3
sub_protocol==SFHSS
XK 0
T10J 1
T8J 2
TM_FH 3
Power value => 0x80 0=High/1=Low Power value => 0x80 0=High/1=Low
Stream[3] = option_protocol; Stream[3] = option_protocol;

View File

@ -155,17 +155,24 @@ static void __attribute__((unused)) SFHSS_build_data_packet()
// Values grow down and to the right. // Values grow down and to the right.
static void __attribute__((unused)) SFHSS_build_data_packet() static void __attribute__((unused)) SFHSS_build_data_packet()
{ {
const uint8_t SFHSS_ident[4][3]={
{ 0x81, 0x00, 0x00}, //XK
{ 0x81, 0x42, 0x07}, //T8J
{ 0x81, 0x0F, 0x09}, //T10J
{ 0x82, 0x9A, 0x06} //TM-FH
};
uint8_t ch_offset = phase == SFHSS_DATA1 ? 0 : 4; 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 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 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 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); 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[0] = SFHSS_ident[sub_protocol][0]; // can be 80 or 81 for Orange
packet[1] = rx_tx_addr[0]; packet[1] = rx_tx_addr[0];
packet[2] = rx_tx_addr[1]; packet[2] = rx_tx_addr[1];
packet[3] = 0x0f; //10J packet[3] = SFHSS_ident[sub_protocol][1];
packet[4] = 0x09; //10J packet[4] = SFHSS_ident[sub_protocol][2];
packet[5] = (rf_ch_num << 3) | ((ch1 >> 9) & 0x07); packet[5] = (rf_ch_num << 3) | ((ch1 >> 9) & 0x07);
packet[6] = (ch1 >> 1); packet[6] = (ch1 >> 1);
packet[7] = (ch1 << 7) | ((ch2 >> 5) & 0x7F ); packet[7] = (ch1 << 7) | ((ch2 >> 5) & 0x7F );

View File

@ -368,7 +368,10 @@ const PPM_Parameters PPM_prot[15]= {
FY326 FY326
FY319 FY319
MODE_SFHSS MODE_SFHSS
NONE XK
T10J
T8J
TM_FH
MODE_J6PRO MODE_J6PRO
NONE NONE
MODE_FQ777 MODE_FQ777

View File

@ -209,6 +209,18 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|--- ---|---|---|---|---|---|---|---
A|E|T|R|CH5|CH6|CH7|CH8 A|E|T|R|CH5|CH6|CH7|CH8
### Sub_protocol XK - *0*
XK transmitter
### Sub_protocol T8J - *1*
Futaba T8J transmitter
### Sub_protocol T10J - *2*
Futaba T10J transmitter
### Sub_protocol TM-FH - *3*
Futaba TM-FH transmitter
*** ***
# CYRF6936 RF Module # CYRF6936 RF Module

View File

@ -77,7 +77,7 @@ See below my module for reference
This method use USB connector on the STM32 V1.0 board or on the maple clone board. 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. 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. Download the free STM32 flash loader demonstrator from [ST.com](http://www.st.com/en/development-tools/flasher-stm32.html) and use a USB-TTL device (like FTDI cable) to flash the [StmMultiUSB.bin](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/raw/master/BootLoaders/StmMultiUSB/StmMultiUSB.bin) bootloader.
1. Open Arduino IDE,browse to multiprotocol folder,load the sketch multiprotocol.ino.Select the serial COM port(see notes below) 1. Open Arduino IDE,browse to multiprotocol folder,load the sketch multiprotocol.ino.Select the serial COM port(see notes below)
1. In Arduino IDE under "Upload method" select **STM32duino**-bootloader.Click upload ,wait until upload is complete. 1. In Arduino IDE under "Upload method" select **STM32duino**-bootloader.Click upload ,wait until upload is complete.