Thread Tools
This thread is privately moderated by midelic, who may elect to delete unwanted replies.
Sep 30, 2019, 09:18 AM
Registered User
midelic's Avatar
Thread OP
Mini-HowTo

DIY FrSky X(D16) receiver


Hi guys,

After almost 2years of RC "sabbatical" leave I was able to finalize my DIY FrskyX receiver.
I had problems with finding a suitable RF module.I was not able to find until now.So here we start.

Today we start a new project(as title already mentioned) a DIY compatible FrSky "X" receiver (also known as D16).

To keep story short see below some characteristics.

Characteristics:

*Hardware*
- MCU STM32F103CBT6 .
- CC2500 transceiver module dual Antenna(diversity) with PA/LNA chip.

1.16 channels receiver compatible with FrskyX(D16) protocol working with Taranis all versions,Turnigy 9x pro(ersky9x) with XJT module or multi module,Devo TX(deviation firmware).
2.8 channels servo PWM(with channels selection output for 1-8 or 9-16 channels .See "Note") output.
3. SBUS 16 channels output (not inverted).
4.Full telemetry with SMARTPORT protocol telemetry(only for X protocol).
5.Antenna diversity with LED's on each antenna control line.This way is easy to debug if you have faulty antennas.
6.Analog ports 4 channels A1,A2,A3,A4.(Max 3.3V on each analog channel)
7.Programable failsafe from RX or TX(screen).
8.Power supply(5-8V)2S lipo max.
9.Range > 1Km(tested 1.5Km).


Thanks to Joao that helped me with testing this receiver he managed to get easily 1.5km range test on the ground level.
So it has plenty "punch".

Note:
This receiver features protocol/modes selection:

1) Jumper CH1-CH3 at start change receiver mode to X(D16)protocol channels 1-8 output PWM.
2) Jumper CH2-CH4 at start change receiver mode to X(D16)protocol channels 1-8 output PWM with no telemetry.
3) Jumper CH3-CH5 at start change receiver mode to X(D16)protocol channels 9-16 output PWM.
4)Jumper CH4-CH6 at start change receiver mode to X(D16)protocol channels 9-16 output PWM with no telemetry.
5)Jumper CH6-CH8 at start change receiver mode to D(D8)protocol (with Hub telemetry).

To do:
6)Jumper CH5-CH7 at start change receiver mode to LBT protocol.

After flashing first time or after global erase the default mode/protocol is "X"(D16) with channels 1-8 servo PWM output.
These modes are somehow different from Frsky modes, I like to think better as allow receivers to be used independently(not binding all the time mode/protocol is changed as it is now with originals).

Construction DIY:
PCB is made very cheap at jlcpcb
https://jlcpcb.com/quote#/
I payed 3.35 euro shipping included (for 5 boards).Joao payed 1.8 eur (shipping included) at first order at Jlcpcb.

It will be 3 versions of schematic,for people to choose from.All will share the same code.
************************************************** **********************
Version 1.1 no separate eeprom chip(it will use mcu chip flash as emulated eeprom) with reverse polarity protection(with P channel MOSFET) and have SMD pads (span 2.54mm pinout) for serial pins.
Version 1.2 with separate eeprom chip (serial eeprom 24C02/04)and reverse polarity protection(with P channel MOSFET)with soldering SMD pads(span 2.54mm ) for flashing and serial ports.
Version 1.3 with separate eeprom chip(serial eeprom 24C02/04) and reverse polarity protection(shottky diodes) and a separate connector(molex1.5mm) for serial ports.
Version 1.4 with separate eeprom chip(serial eeprom 24C02/04) and reverse polarity protection with no Servo PWM breakouts (only SBUS/SPORT/VCC pins) -smaller board.
************************************************** *********************

I added an eeprom 1 wire serial(I2C) chip on 2 versions.
STM32 F103 has no eeprom memory ,coders use a hack on the last pages of flash to emulate eeprom.The original Frsky RX have this eeprom chip for storing bind data.So I added it as an option.
Note:
I suggest using a setup with eeprom chip.
Even in the case of not using it(sodering it) is better to have a reserved place(footprint) for future development.
Moreover while the flash can be used as eeprom the number of writing cycles is limited, according with manufacturer is 10000 compared with a dedicated eeprom chip that has 1000000.
You will not reach 10000 flashing/re-flashing of the mcu,in your life time but some people may come worried

If you have some customization let me know and post here .I would love to see how other people customized this project

As long as they follow the same pinout and connection to the RF module, with the schematics provided anybody can customize and make their own design with more or less components follow what is best for them.

****************************************
-See below the BOM file
-See also electronic schematics attached.
-see gerber files below
I designed the pcb in EasyEDaA,the online pcb designer.
For people that want to design their own boards.I think they will find the libraries all there.
-below you can see also the prototype.

Shopping:
STM32F103CBT6 (or STM32F103C8T6) - LQFP48 chip ,I recommend though CBT6(it has 128K flash versus 64 k on C8T6)
- any electronic parts supplier digikey, mouser, farnell, ebay,aliexpress wherever you can find this chip cheaper.I used 0603 size foe passive components.
try use google search.


CC2500 module:
we found one CC2500 dual antenna(diversity)on aliexpress
https://www.aliexpress.com/item/3294...36dc8beeaf2a26


- passive components(resistors,caps pin headers.I used 0603 size.
- diodes,regulator.
again any supplier digikey,mouser farnell, ebay, aliexpress, google is your friend.


Important note:

Please leave the RF module at the end for soldering.Solder the mcu first ,regulator(power supply) and all the associated parts.
Before soldering the last part which is the RF module ,test the mcu see if it is functional . For that upload a blink program to it see if the LED on the board is blinking,
I will post below the blink program adapted for this board.To use remove the .txt extension.



Flashing firmware:
1.For flashing you need an USB serial(can be FTDI) device connected to corresponding
TX, RX and GND pins(FTDI-)Tx pin to Rx pin and FTDI-Rx to Rx -Tx pin,FTDI-GND to Rx-GND.
2.Jumper(bridge) BOOT0 pins and power on Rx.
3.Flash Rx using STM Flash loader demonstrator program.See below info.

STM32 Flash loader demonstrator utility you can download here
http://www.st.com/en/development-too...her-stm32.html
Tutorial use STM loader
https://scienceprog.com/flashing-pro...ed-bootloader/


**WARNING!**
**MUST READ!**
Please be aware that the Rx firmware binary attached below has somewhat limited functionality..
The receiver is set to bind with TX only 2 times.The third time you try to bind(that means bind mode TX and RX in bind mode with bind button)
with different TX or same TX, the RX will be locked and you will be unable to connect to TX.
However you will be able to unlock and make it work again by re-flashing firmware again using "Global Erase" selection in STM loader program before flashing.


Summary:
As long as you don't rebind 2 times you can use this RX indefinitely. To remove the bind lock and regaining functionality you have to re-flash the RX.
If you locked RX you can still re-flash and use it again until you rebind.
I know this can be very annoying thing for some users and others will not be bothered too much as they can bind with one TX, install it on their plane or quad and forget about it.
I adopted this new approach to limit the possibility of this project being copied and used commercially without my approval.
I hope people will understand.

**END**

Enjoy!

Thanks to:
- Joao for testing this receiver in various conditions.
- David for testing sport telemetry.

DISCLAIMER:
THIS IS A DIY PROJECT AND THE CODE AND SETUP PRESENTED HERE IS AS IS.
USE IT ON YOUR OWN RISK.I DON'T TAKE ANY RESPONSIBILITY OF THE PROBLEMS WHICH MAY ARISE USING IT.

Testing:
see below the video Joao testing the prototype at 1.4-1.5Km.
DIY FrskyX RX Range Test 2 (2 min 24 sec)
Last edited by midelic; Oct 14, 2019 at 03:23 PM. Reason: addded important notes regarding soldering and blink program for test the mcu
Sign up now
to remove ads between posts
Sep 30, 2019, 09:19 AM
Registered User
midelic's Avatar
Thread OP
reserved
Sep 30, 2019, 09:45 PM
Registered User
Quote:
Originally Posted by midelic
I know this can be very annoying thing for some users and others will not be bothered too much as they can bind with one TX, install it on their plane or quad and forget about it.
I adopted this new approach to limit the possibility of this project being copied and used commercially without my approval.
I hope people will understand.
I don't think re-flashing the receiver (if needed) is annoying. But it would certainly deter the copy-cats from selling these.
Oct 01, 2019, 01:21 AM
Registered User
midelic's Avatar
Thread OP
Yes I was told before that nothing can be done and if you release the binaries it will be easier for them.Well, I want to introduce in premiere this type of restriction that for a DIY-er will not cause so much problems.This way will limit copying and selling.
Oct 01, 2019, 02:12 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Yep, many people that buy won't be able to flash a receiver anyway.
And if they are stupid enough to produce a two bind receiver we won't give any support here. Any product support post should be deleted.
I am not being mean, but I do know how much work is put into developing such a project. Every day, sometimes all day, for months. In this case, Midelic is on this project for 2 years, and I have been following it since the beginning.
I do understand why he doesn't want this thing produced, specially when he wants to promote DIY, which is something that unfortunately we don't see much in RC anymore
I can only say THANK YOU.

Joćo
Oct 01, 2019, 04:11 AM
Don“t grow up, it“s a trap
aMax's Avatar
Quote:
Originally Posted by jhsa
.....cut
.....DIY, which is something that unfortunately we don't see much in RC anymore


Joćo
Well , nowadays young people mostly dont have the patience for those projects and some people, beyond the age of Bruce Simson, have to deal
with rising restrictions.

But back to topic.
Nice to see that already one line for an I2C port is broken out. Is there any consideration for the use of such port in the software, e.g for a baro ,...like
FRSKY“ did on the G-RX8?
Oct 01, 2019, 04:23 AM
Don“t grow up, it“s a trap
aMax's Avatar
Woooh thats great!

https://static.rcgroups.net/forums/a...ersion_1.3.png
Oct 01, 2019, 04:24 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Is that not done using S.Port?

Joćo

Sent from my BLN-L21 using Tapatalk
Oct 01, 2019, 04:28 AM
Registered User
midelic's Avatar
Thread OP
I see G-RX8 has integrated baro sensor.But even now in this setup you can connect a OXS baro sensor(DIY) to SPORT port.In fact I think we tested already altitude with small DIY OXS sensors connected on SPORT.I have one DIY small at home.If you want I can provide schematics.
Oct 01, 2019, 04:30 AM
Registered User
midelic's Avatar
Thread OP
It will be 3 versions of schematic,for people to choose from.All will share the same code.
*********************************
Version 1.1 no separate eeprom chip(it will use mcu chip flash as emulated eeprom) with polarity protection(with P channel MOSFET) and have pads (2.54mm pinout) for serial pins.
Version 1.2 with separate eeprom chip (serial eeprom 24C02/04)and reverse polarity protection(with P channel MOSFET)with soldering pads(2.54mm pinout) for flashing
Version 1.3 with separate eeprom chip(serial eeprom 24C02/04) and reverse polarity protection(shottky diodes) and a separate connector(molex1.5mm) for serial pins and added one more VCCsupply line(to uses FTDI power for flashing) .

I added an eeprom 1 wire serial(I2C) chip on 2 versions.
If you have some preference for customization let me know I will add here.
STM32 F103 has no eeprom memory ,coders use a hack on the last pages of flash to emulate eeprom.The original Frsky RX have this eeprom chip for storing bind data.So I added it as an option.

If you choose boards that has the eeprom chip foot print in and not install it(soldering) on the board, the code with use automatically flash to store bind data.
Last edited by midelic; Oct 01, 2019 at 04:48 AM.
Oct 01, 2019, 04:33 AM
Don“t grow up, it“s a trap
aMax's Avatar
Quote:
Originally Posted by jhsa
Is that not done using S.Port?

Joćo

Sent from my BLN-L21 using Tapatalk
...only if you are using the FRSKY Baro module, not a simple module that only outputs data on the I2C bus.
Oct 01, 2019, 04:37 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Yes, but if you don't have a radio that uses that data, it is the same as not having it. What midelic could perhaps do is an option to use the TX and RX port as I2c, if possible. But then you will lose SBUS.
Oct 01, 2019, 04:51 AM
Don“t grow up, it“s a trap
aMax's Avatar
Quote:
Originally Posted by jhsa
Yes, but if you don't have a radio that uses that data, it is the same as not having it. What midelic could perhaps do is an option to use the TX and RX port as I2c, if possible. But then you will lose SBUS.
On a simple glider I make no use of the sbus, all pwm servos. But with the new coming restriction rules, especially for none club flyer.. it would
be great to get the height.
On my ASW 28 ( Matek405) I have all I need, but there are some vintage gliders on the shelf. On my old Carrera ASW17, I use an old F1 FC only to get voltage
and height over the D8 telemetry.
Oct 01, 2019, 04:51 AM
Registered User
midelic's Avatar
Thread OP
Maybe it is good idea for the future to take out 2 pads of I2C.Idk yet.
Last edited by midelic; Oct 01, 2019 at 05:04 AM.
Oct 01, 2019, 05:10 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Quote:
Originally Posted by aMax
On a simple glider I make no use of the sbus, all pwm servos. But with the new coming restriction rules, especially for none club flyer.. it would
be great to get the height.
On my ASW 28 ( Matek405) I have all I need, but there are some vintage gliders on the shelf. On my old Carrera ASW17, I use an old F1 FC only to get voltage
and height over the D8 telemetry.
But you have S.Port.. I don't know of any radio that uses i2C data, do you??
also, I also fly gliders sometimes, and there is a DIY project called OpenXsensor (oXs), that can be many sensors, including a vario, and it uses an ACC, so it is very accurate. This is all DIY, with an arduino pro mini. It supports frsky D16 and D8 protocols, and I think some others..
With this project you can also have, how is it called?? compensated vario?? It uses an airpeed sensor together with the barometer, and the ACC.

Joćo


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
New Product Frsky XM+ Micro D16 SBUS Full Range Receiver Up to 16CH kremerFPV Radios 101 Aug 07, 2019 06:02 AM
Help! frsky X8r no way to bind in D16 mode bax.91 Radios 3 May 21, 2019 02:22 PM
Discussion FrSky D16 protocol (X series TX/RX compatible) jry DIY Electronics 226 Jan 11, 2019 07:42 AM
Discussion Is the FrSky DHT DIY conversion kit compatible with x series receivers? uyqah Radios 1 Sep 10, 2015 09:36 AM