/DIY-Multiprotocol-TX-Module

DIY Multiprotocol TX Module

Primary LanguageC++GNU General Public License v3.0GPL-3.0

DIY-Multiprotocol-TX-Module

Multiprotocol is a 2.4GHz transmitter which enables any TX to control lot of different models available on the market.

The source code is partly based on the Deviation TX project, thanks to all the developpers for their great job on protocols.

Forum link on RCGROUPS for additional information or requesting a new protocol integration.

To download the latest compiled version (.bin file), click on Release on the top menu.

##Contents

Compatible TX

Protocols

Hardware

Compilation and programmation

Troubleshooting

##Compatible TX

###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.

The protocol selection is done via a dip switch, rotary dip switch or scsi ID selector.

Screenshot Screenshot Screenshot

You can access to up to 15 different protocols and associated settings.

Settings per selection are located in _Config.h:

  • Protocol and type: many main protocols have variants
  • RX Num: number your different RXs and make sure only one model will react to the commands
  • Power: High or low, enables to lower the power setting of your TX (indoor for example).
  • 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 The multiprotocol TX module takes full advantage of being used on a Turnigy 9X, 9XR, 9XR Pro, Taranis, 9Xtreme, AR9X, ... running er9x or ersky9X. An OpenTX version for Taranis is available here.

This enables full integration using the radio GUI to setup models with all the available protocols options.

Screenshot

Options are:

  • Protocol and type: many main protocols have variants
  • RX Num: number your different RXs and make sure only one model will react to the commands
  • Power: High or low, enables to lower the power setting of your TX (indoor for example).
  • Option: -127..+127 allowing to set specific protocol options. Like for Hubsan to set the video frequency.
  • Bind: bind a RX/model
  • Autobind: Yes or No. At the model selection (or power applied to the TX) a bind sequence will be initiated
  • Range: test range by setting the transmission power to the lowest value

Notes:

  • Using this solution does not need any modification of the TX since it uses the TX module slot PPM pin for serial transfer.
  • 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

There are 4 protocols supporting telemetry: Hubsan, DSM, FrSkyD and FrSkyX.

Hubsan displays the battery voltage and TX RSSI.

DSM displays TX RSSI and full telemetry.

FrSky displays full telemetry (A0, A1, RX RSSI, TX RSSI and Hub).

FrSkyX displays full telemetry (A1, A2, RX RSSI, TX RSSI and SPORT).

If used in PPM mode

Telemetry is available as a serial 9600 8 n 1 output on the TX pin of the STM32 chip using the FRSky hub format for Hubsan, FrSkyD, FrSkyX and DSM format for DSM2/X.

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) to display telemetry information and setup alerts.

If used in Serial mode

Telemetry is built in for er9x and ersky9x TXs.

To enable telemetry on a Turnigy 9X or 9XR you need to modify your TX following one of the Frsky mod like this one.

Note: 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).

##Protocols

###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.

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 To bind a model in PPM Mode press the physical bind button, apply power and then release.

In Serial Mode you have 2 options:

  • use the GUI, access the model protocol page and long press on Bind. This operation can be done at anytime.
  • press the physical bind button, apply power and then release. It will request a bind of the first loaded model protocol.

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

####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.

The default association dial position / protocol in every release is listed below.

Dial Protocol Sub_protocol RX Num Power Auto Bind Option RF Module
0 Select serial
1 FLYSKY Flysky 0 High No 0 A7105
2 HUBSAN - 0 High No 0 A7105
3 FRSKY - 0 High No -41 CC2500
4 HISKY Hisky 0 High No 0 NRF24L01
5 V2X2 - 0 High No 0 NRF24L01
6 DSM2 DSM2 0 High No 6 CYRF6936
7 DEVO - 0 High No 0 CYRF6936
8 YD717 YD717 0 High No 0 NRF24L01
9 KN WLTOYS 0 High No 0 NRF24L01
10 SYMAX SYMAX 0 High No 0 NRF24L01
11 SLT - 0 High No 0 NRF24L01
12 CX10 BLUE 0 High No 0 NRF24L01
13 CG023 CG023 0 High No 0 NRF24L01
14 BAYANG - 0 High No 0 NRF24L01
15 SYMAX SYMAX5C 0 High No 0 NRF24L01

Note:

  • The dial selection must be done before the power is applied.

####Using serial input with er9x/ersky9x Serial is allowing access to all existing protocols & sub_protocols listed below.

#####A7105 RF module

Protocol Sub_protocol
Flysky
Flysky
V9x9
V6x6
V912
Hubsan

#####CC2500 RF module

Protocol Sub_protocol
FrskyV
FrSkyD
FrSkyX
CH_16
CH_8
SFHSS

#####CYRF6936 RF module

Protocol Sub_protocol
DSM2
DSM2
DSMX
Devo
J6Pro

#####NRF24L01 RF module

Protocol Sub_protocol
Hisky
Hisky
HK310
V2x2
YD717
YD717
SKYWLKR
SYMAX4
XINXUN
NIHUI
KN
WLTOYS
FEILUN
SymaX
SYMAX
SYMAX5C
SLT
CX10
GREEN
BLUE
DM007
Q282
JC3015_1
JC3015_2
MK33041
Q242
CG023
CG023
YD829
H8_3D
Bayang
ESky
MT99XX
MT
H7
YZ
LS
MJXQ
WLH08
X600
X800
H26D
EO10
Shenqi
FY326
FQ777
ASSAN
HONTAI
HONTAI
JJRCX1
X5C1

Note:

  • The dial should be set to 0 for serial. Which means all protocol selection pins should be left unconnected.

###Protocols details Check the Protocols_Details.md file for a detailed description of every protocols with channels assignements.

##Hardware

You also need some antennas and cables.

###Board The main program is running on an STM32F103CBT6 chip running @8MHz X-tal and 3.3V power supply.

####My board (original design)

Screenshot Screenshot

OSH Park link if you want to order.

###New board design The new board was designed by M.Bloos and is pinout compatible with previous board.It has aditionally more spi pins for new RF module,better arrangement for inverter secondary input and a neater design.

Screenshot Screenshot

OSH Park link if you want to order.

Parts list here

###USB version

Screenshot Screenshot

Parts list here

OSH Park link

All boom list are also attached at the top.

####Buy a 4 in 1 tuner to be used with new STM32 multimodule board

This module(4 in 1 tuner) can be purchased here. 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.

To update the firmware of this module you have to solder a 5 pin header(bottom ) and use an USB-serial like FTDI

Serial mode is already enabled by default so no need any resistor soldering.

###Schematic and Parts list

The original design

The Part list is here.

Screenshot

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.
  • SJ1 jumper should be used only if you don't have the inverter chip installed.If you install the inverter, SJ1 is not bridged.

###Radio integration You can 3D print your box (details here):

Screenshot Screenshot

##Compilation and programmation

###Toolchain Multiprotocol source can be compiled using the Arduino IDE.This code is using maple library(libmaple) not CMSIS and STM32 Standard Peripheral Library.

  • New update: Tested succesfully with version 1.6.12.

  • You need to download and install aditionally STM32 core ,in Arduino_STM32 folder in ...../Arduino/hardware/ folder (note. if the hardware folder doesn't exist you will need to create it).

In order to compile suscesfully you need also to modify a maple library file.

  • In ....\hardware\Arduino_STM32\STM32F1\cores\maple\libmaple\usart_f1.c Comment the 2 function as shown below.This is required to have acces to low level of USART intrerupt.

//void __irq_usart2(void) { usart_irq(&usart2_rb, USART2_BASE); }

//void __irq_usart3(void) { usart_irq(&usart3_rb, USART3_BASE); }

Then run the IDE, and on the Tools menu, select the Boards manager, and install the Arduino DUE(ARM-Cortex M3) from the list of available boards. You must do this step, it installs the arm-none-eabi-g++ toolchain!

Download the zip file of this repository, unzip it in a folder, navigate to the Multiprotocol directory and then click on Multiprotocol.ino. The Arduino environment will appear and the Multiprotocol project will be loaded.Then you can use "Upload" button which will compile and upload to the module: Skecth->Upload (Ctrl+U).

Notes:

  • Make sure to select in arduino IDE the "Generic STM32F103C series" before compiling.
  • Before uploading select from Tools, Upload Method: "Serial".
  • 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.

###Upload the code using FTDI (USB serial to TTL)

Use an external FTDI adapter like this one. or other USB serial-TTL dongle.The device can work with both 5V and 3.3V. When in 3.3V selection there are some precautions to be taken ,you can read below.

###Method 1:

Don't flash new firmware with the TX switched on !!!!!

If using 3.3V USB-TTL device it is required to use a jumper on "3.3V jumper" on top of the board.After flashing it is imperative to be removed.

Before uploading any new firmware use a jumper on BOOT0.After flashing new firmware remove also the BOOT0 jumper,or move it to oposite pin.

###Warning!!!

After flashing new firmware it is mandatory to remove the 3.3V jumper if installed.If not when starting the module and micro you may fry them as 5V is supplied directly on the RF module and micro.Extreme care ,do not flash with 5V setting on USB-SERIAL and 3.3V jumper attached.If in doubt measure the serial device output with a multimeter.

###Method 2.

Uploading new firmware with TX switched on.

For this method DON'T TOUCH THE 3.3V JUMPER(NO JUMPER)!!! This method is less prone to mistakes.The module is inside the TX bay.Move/set the jumper on BOOT0. Connect the USB-serial device only TX ,RX,and GND lines to coresponding RX,TX GND pins on the multimodule. Plug the USB -serial device on computer USB port.Start TX(switched on) ,open arduino IDE, select the COM port,find multiprotocol.ino file,open the file in arduino IDE ,press "UPLOAD" the sketch will be uploded to the multimodule normally like any other arduino sketch. At the end of uploading remove the BOOT0 jumper.Start normally.

###Important: Flashing:

###Method1:

For uploading already precompiled binaries(.bin Release files ) there is a specialized software you need to install on your computer.Using the same USB-serial device set the BOOT0 jumper, follow the same precautions regading voltage used and run the program.

STM32 Flash loader demonstrator http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html

There are many tutorials on the net on how to use this program.Like this one.

here

###Method2:

There an utility on arduino folder......\hardware\Arduino_STM32\tools.The file is stm32flash.exe.From command prompt navigate to the folder and execute command:

stm32flash -w Multiprotocol_STM32_1.X.X.bin YOUR-COM-PORT

Use the multi current version(complete path to multi file) and your com port.

You will find in the same folder stm32flash file for MACOSX and LINUX.

.....\hardware\Arduino_STM32\tools\macosx\stm32flash ......\hardware\Arduino_STM32\tools\linux\stm32flash

###Method 3.

This method use USB connector(on the future board or)on the maple clone board. Install first maple USB driver found in Arduino STM32 package folder "..........\hardware\Arduino_STM32\drivers\win\install_drivers.bat". run the batch file will install maple USB drivers. After with STM32 flash loader demonstrator and USB-TTL device flsh the STM32duino bootloader. from

https://github.com/rogerclarkmelbour...M32F1/binaries

When in Arduino IDE under "Upload method" select STM32duino-bootloader. The com port will be set after uploading one simple sketch(blink). After that you can connect(com port) and and upload sketches normally in Arduino using USB port

##Troubleshooting

###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

  • The protocol/mode selection must be done before the power is applied.

####Input Mode - Serial Put dial switch on "zero" activates serial mode on multi.If you want to use permanetly serial mode there is no need of the dial switch installation.

###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. For serial, the preffered method is to bind via the GUI protocol page.

###Report issues You can report your problem using the GitHub issue system or go to the Main thread on RCGROUPS to ask your question. Please provide the following information:

  • Multiprotocol code version
  • TX type
  • Using PPM or Serial, if using er9x or ersky9x the version in use
  • Different led status (multimodule and model)
  • Explanation of the behavior and reproduction steps