Thread Tools
Old Mar 14, 2014, 05:40 PM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
Mini-HowTo
DIY FrSky TX/RX Modules

DIY FrSky TX(RF)Module

Thanks to Phracturedblue work on deviation firmware..I manage to port his deviation code for a DIY Frsky module in arduino.
Thanks also to Kyrre Aalerud(Kreature) and Simon Chamber for helping reverse engineering the Frsky Protocol.
The scope of this thread is to build a Frsky TX module.. ..a Frsky 2way module for the moment.
With this hardware posted below and this code I think it is possible for anybody to build his own Frsky Tx module.
This code is provided for free under GPL3 licence...
all credits to Phracturedblue and its deviation firmare.

Now:
Hardware:
1.XL2500-D03 module..medium to long range 1500m
2.Promini 8/16Mhz or any setup with Atmega 8/168/328 - 8Mhz /16Mhz clock
3.Power supply 3.3v from any LDO 3.3V
for example LM1117MP- 3.3v
5.LED

Warnings:
1.Do not exceed 3.3V -3.6 Max for XL2500.
2.Do not use CC2500 with pcb antenna as a TX ,the range is very poor.

Pinout:
XL2500); M8/168/328-8-16Mhz,arduino,Promini,nano,aso
SI ; D5
SO; D6
SCLK ; D4
CS ; D2
PPM(TX) ; D3
LED ; C3(A3 promini)
Vcc ; VCC 3.3v +0.1uF cap between VCC and Gnd
Gnd ; Gnd

Clarifications:
I don't now the range of this module.I did not make any test for range.
For test I used a Frsky VD5M rx in 2 way mode.,,on a promini 16Mhz board.
Atm there is no telemetry involved.The telemetry code is not ready for test yet.
If using arduino board,,avr fuses are already set and no need to change them.
I using standalone avr chip ask on the thread for fuse settings.
For the moment the module is with autobind so no need any switch for binding.
This code may work or not in this configuration on your setup.
I found that there are different CC2500 modules ,made work with Frsky gear ,having different configuration for base frequency(with Xtal having a slightly frequency offset).
So in case the current setup is not working with your CC2500 module,the frequency configuration can be changed in software,and I will help you do that.
Basically the CC2500 base freq has to be tunned to frsky Rx base freq ...this is not so complicated if I can help.
************************************************** ***********************************
IMPORTANT
Atm code is using fixed id.This may cause problems of interference with other users using the same code (tx id)
.So in order to avoid interference..personalize your fixed_id in the code as follows:
fixed_id = 0x3e19;// this is the actual one in the code you can change here the txid(fixed_id)...
any 16 bits number(from 256-65535) should be ok
//fixed_id = 0x2DD7;//examples
//fixed_id = 0x1EE9;//examples of fixed_id
//fixed_id = your personal txid
//************************************************** *******************************

The code is provides as is, and without any liability or warranty involved.
DISCLAIMER:
THIS CODE IS STILL IN TESTING.IF YOU FEEL UNEASY WITH THAT, DON'T USE IT!
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.




Attached are the hex file ,the source files and the diagram connection.
edit:Updated diagram with LED.

Shopping:
http://www.ebay.com/itm/CC2500-PA-LN...item19d726245b
http://www.ebay.com/itm/Wireless-RF-...item41698d1405
http://www.banggood.com/CC2500-PCBA-...-p-922598.html


20.05.2014
For people have trouble binding with Frsky 2-way RX/
Minor update of the code...introduce a variable for tweaking easier the CC2500base frequency..along with a better explanation.
"FrSky_TX_02"
************************************************** ******************************
"static uint8_t fine = 0xd7;//* 215*//give values from 0 to 255 for freq offset
//values from 0-127 offset increase frequency ,
//values from 255 to 127 decrease base frequency
//this is useful for tunning TX base frequency to frsky RX freq."
************************************************** ****************************
Note:
The code below is superseded by multiprotocol code.It will no more be updated.The new Frskyx TX code including telemetry is embedded in mutiprotocol code.
See link:
http://www.rcgroups.com/forums/showthread.php?t=2165676


Sources:
https://bitbucket.org/PhracturedBlue/deviation/src
http://www.rcgroups.com/forums/showthread.php?t=1667453
Useful links:
http://www.rcgroups.com/forums/showthread.php?t=1921870
http://www.rcgroups.com/forums/showthread.php?t=1954078
midelic is online now Find More Posts by midelic
Last edited by midelic; Dec 18, 2015 at 04:44 AM. Reason: added important info
Reply With Quote
Sign up now
to remove ads between posts
Old Mar 14, 2014, 05:42 PM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
DIY FrSky RX module(2 way)
The code is an arduino adaptation from Kyrre Aalerud(aka Kreature)..frsky rx demo.
I tried his demo code as it was but unfortunately I couldn't make it work ,so I rewrote some parts of it..and added some more.Now It is complete with 8 channels servo PWM and PPM out signal,auto tunning routine for base channel offset...As I said before,,I found some cc2500 board detuned...base channel shifted. so it did some software adjustments in order to work.
Now:
Hardware:
1.CC2500 module.
2. Any setup with Atmega 8/48/88/168/328 - 8Mhz /16Mhz clock
3.Power supply 3.3v from any LDO 3.3V
4.LED

Pinout:
CC2500(any setup with CC2500 chip); M8/88/168/328-8-16Mhz,arduino/Promini ,aso
SI ; D5
SO; D6
SCLK ; D4
CS ; D2
GDO0;D3
***************************
Servo1_OUT 7 //Servo1(D7)
Servo2_OUT 8 //Servo2(B0)
Servo3_OUT 9 //Servo3(B1)
Servo4_OUT 10 //Servo4(B2)//PPM pin
Servo5_OUT 11 //Servo5(B3)//RSSI PWM only on PPM mode
Servo6_OUT 12 //Servo6(B4)
Servo7_OUT 13 //Servo7(B5)
Servo8_OUT A0 //Servo8(C0)//bind plug
************************************
LED ; C3(A3 promini)
Vcc ; VCC 3.3v
Gnd ; Gnd

Warnings:
1.Do not exceed 3.3V -3.6 Max for CC2500.

Binding procedure:
Its is like binding with frsky VD5M RX.
Bind plug to gnd(Servo8)...Rx led comes solid.Start Tx in binding mode.....when binding complete Rx led flashing slowly.Stop tx disconnect the tx ,disconnect Rx bind plug,,,,start again Rx ..start Tx in normal mode....Rx led on when connection complete.When no signal rx led flashing slowly.

Clarifications:
I don't now the range of this module.I did not make any test for range.
Fuses: FuseL=0xEF, FuseH= 0xC9 ....for M8 -16Mhz Xtal
Fuses: FuseL=0xBF;FuseH=0xCC( for M8- using external 8Mhz X-Tal)
************************************************** ***************************
For 16 Mhz version with hex files on M328 chip you can change fuses using the recommendations below.

Low Fuse 0xFF
High Fuse 0xDA
Extended Fuse 0x05

************************************************** ****************************
Atm the code is tested on a promini(M328) 16Mhz board....
If your setup is using different chip than M328(like M8/M88/M168) ask here in this thread for your chip hex file.
************************************************** *************
For PPM mode ..jumper between servo 1 and servo 3.
************************************************** **********
Attached are the hex file ,and the diagram connection.
DISCLAIMER:
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.


Note:
Erased previous hex files and updates.
Reason=obsolete.


NOTE:
Failsafe on Throtle -CHANNEL3
Program your TX with any channel order which have throttle in channel 3
*****************************
Failsafe working like that:
when signal is lost after ~1sec the throttle is zero(1000 ,......or in new code changed to 960) and all other channels to neutral(1500).
If you think on different better failsafe sequence please ask on the thread and I will modify firmware.
Binding procedure:
F801-F802
Press the bind button at start(keep pressed) or insert a bind plug on channel 8(ch8-GND)..... watch the RX LED to be ON (important).Start the TX in bind mode...and wait for rx blinking slowly. If so binding is complete.Remove bind plug/bind button back to normal.Restart rx and tx in normal mode.
************************************************** **********************************
ADDING PFS(PROGRAMMABLE FAILSAFE)For Code with PFS
How it is set:
When in binding mode with bind plug attached RX LED is ON. Start TX in binding mode and the RX LED comes off.
Switch only the TX off(NOT THE RX).
Arrange your TX sticks,pots,mixer,to any failsafe settings you want to be set.
Switch TX on again ,,,,,and the RX start blinking slowly ...binding /FS settings complete.
Switch RX/TX off.... remove bind plug....start normally.


ADDING RSSI TELEMETRY AND VOLTAGE TELEMETRY TO F801
requires flashing new code.
The new firmware will allow 7 channels PWM/8Channels PPM and the 8-th ch being used for A1/A2 telemetry.
However for people who wants back all 8 channels PWM (without telemetry) they can still re flash the rx with the normal firmware.See below the links to the last firmware.
The voltage sensor will be connected to channel 8(replaced).So on telemetry version no channel 8 PWM(only 7 PWM ),
But it will still be available all 8 in PPM mode.
see below:

ADDING VOLTAGE SENSOR TO F801
The better way
Much simpler and better solution for adding voltage sensor to RX.
1.using existing RX pads(for one resistor 100K) and
2.better protection for Rx/lipo using 300/100k divider.
3.No enter bind automatically(because you have now 100k between the bind pin and gnd).
MAX voltage 13.2V(3S lipo)
see this link below:
http://www.rcgroups.com/forums/showp...&postcount=968
For 4S lipo(16.8V)
http://www.rcgroups.com/forums/showp...&postcount=971


ADDING SBUS OUT FOR F802 and F801.
SBUS output is a serial protocol which normally output 16 channels.
In our case will output only 8 channels.
For that it needs installing a bridge plug between CH5 and CH7.
The SBUS out put pin is on TX pin.See below links with photos.

http://www.rcgroups.com/forums/showp...postcount=1217
http://www.rcgroups.com/forums/showp...postcount=1218
http://www.rcgroups.com/forums/showp...&postcount=999

Regarding updating firmware on F801 and F802
Note:
FOR FLASHING NEW FIRMWARE USE 3.3V PROGRAMMER ONLY.DON:T USE 5 V PROGRAMMER
It can be 3.3V USBASP programmer.
I recommend "betemcu.cn" programmer type black pcb.
For 3.3V use it is mandatory to remove the ' 0'ohm bridge resistor on the back where is 5V/3.3V selector.Whitout that the USBASP will work at 5V.

links:
http://www.banggood.com/USBASP-USBIS...853166201410QG
http://www.ebay.com/itm/USBasp-USBIS...0AAMXQTT9RyEjT
http://www.ebay.com/itm/USBASP-USBIS...gAAOSwVL1WAghn
http://www.ebay.com/itm/USBASP-Downl...EAAOSwzrxUvcmn

Info regarding flashing firmware how to:
links:
http://www.rcgroups.com/forums/showp...&postcount=796
http://www.rcgroups.com/forums/showp...&postcount=864

NEW.
FLASHING FIRMWARE USING 1 WIRE BOOTLOADER INTEFACE
See below how to:
http://www.rcgroups.com/forums/showp...postcount=1782


Latest codes for F801 and F802

The firmware may be updated without notice so please check these links periodically or when you have problems.
links:
Below codes with PFS and SBUS activated features.
And version with RSSI on channel 9(SBUS&PPM)
You can test and post feedback,
http://www.rcgroups.com/forums/showp...postcount=1147


ADDING HUB TELEMETRY
Still in testing.
http://www.rcgroups.com/forums/showp...postcount=1541
http://www.rcgroups.com/forums/showp...postcount=1543
http://www.rcgroups.com/forums/showp...postcount=1556

************************************************** ************************
NOTE
Both F801/F801 are using 2 way protocol not 1 way(different protocol).So when binding please set you TX module accordingly.
If somebody have problems binding with DJT module(or other) please post your problem on this thread.
on F801 &F802.
Instead of bind button for binding it can be used bind plug between Channel 8 and GND.
************************************************** *********************
Shopping:
Full RX :
F801 and F802
http://www.banggood.com/DIY-FRSKY-8C...-p-987247.html
http://www.banggood.com/DIY-RX-F802-...-p-989610.html
http://www.superior-hobby.com/rxf802...8r-p-1112.html
http://www.superior-hobby.com/oneway...le-p-1114.html
For DIY RF modules:
http://www.aliexpress.com/item/1-pcs...566632579.html
http://de.aliexpress.com/item/CC2500...rchweb201560_9

Long range module
http://www.banggood.com/CC2500-PCBA-...-p-922598.html
Sources:
http://www.rcgroups.com/forums/showthread.php?t=1667453

Note:
The diagram below showing CC2500 module is a general one.
Please check the pins arrangement of your existing CC2500 module.
midelic is online now Find More Posts by midelic
Last edited by midelic; Apr 27, 2016 at 04:05 PM. Reason: edit diagrams
Reply With Quote
Old Mar 14, 2014, 05:42 PM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
FrskyRX-2way 8ch. on Attiny 85


Binding......PPM and Gnd(bind plug)...LED between CSN and Vcc.When binding complete led will flash slowly.If not having led,.... wait for 10 sec.
Need working more on led code ..but is not really necessary,,can be used whitout led.
The weight of this Frsky rx can be 0.5-1 gram.

Fuses: as for8Mhz internal clock
low_fuses=0xE2
high_fuses=0xD7
extended_fuses=0xFF

20.10.2014
Updated diagram matching exact pinout with ebay Frsky module(VCC and GND swapped)

08.05.2015
Updated last version of FrsktAttiny.Fixes regarding jitters and Taranis TX binding.
"frsky_arduino_rx_ppm_Attiny85_8.hex"

04.06.2015
Version NO failsafe(no classic failsafe) cut PPM signal after 450ms signal lost.



30.03.2016

Updated diagram with LED and voltage regulator.

05.04.2016
Added version with PFS.
Settings PFS is the same as for F801/F802.Read second post


NOTE:
For version with FS
Failsafe on Throtle -CHANNEL3
Failsafe working like that:
when signal is lost after ~1sec the throttle is zero(960) and all other channels to neutral(1500)
Program your TX with any channel order which have throttle in channel 3

With PFS(programmable FS) you can use any channel arrangement.
****************************
midelic is online now Find More Posts by midelic
Last edited by midelic; Apr 05, 2016 at 10:13 AM. Reason: cleaning/update diagram
Reply With Quote
Old Mar 14, 2014, 08:16 PM
John michel is offline
Find More Posts by John michel
Registered User
Joined Jun 2013
558 Posts
Hey medelic

+1 for you

You can put RX at this thread ? i want to see your RX
John michel is offline Find More Posts by John michel
Reply With Quote
Old Mar 15, 2014, 12:09 AM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
Rx is not tested with an original..Frsky Tx module...... only with my DIY module.As soon as I get confirmation working with an original module I'll post it here.
midelic is online now Find More Posts by midelic
Reply With Quote
Old Mar 15, 2014, 12:59 AM
e_lm_70 is offline
Find More Posts by e_lm_70
Registered User
Austria
Joined Jan 2004
8,842 Posts
Are the PIN reconfigurable?

With different cc2500 it may help to connect in a different way

e_lm_70 is offline Find More Posts by e_lm_70
Last edited by e_lm_70; Mar 15, 2014 at 07:40 AM.
Reply With Quote
Old Mar 15, 2014, 01:06 AM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
Of course...I alway do it,.... to be easy reconfiguring pinout.I selected the pins to match the ones from Flysky/Hubsan for easy compatibility when I'll make the universal module.
You can reconfigure the pins on :
#if defined(SPIBB)
..your pinout
#endif


I provided also pinout for HW spi just in case...missing only SPI routines.If somebody ask I can attach also the HW spi routines.
I think with the selected RF module you can have a good range.
@e
What I want from you is testing the RX code..It will spare me buying and waiting for the original Frsky Tx module.
midelic is online now Find More Posts by midelic
Reply With Quote
Old Mar 15, 2014, 01:19 AM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
I'm thinking in the future we can improve the telemetry reading from a module. FrSky uses inverted serial levels and thus inverters may be needed to convert the serial signal.I think this can be simplified.......on DIY module and make connection easier with a TX.
midelic is online now Find More Posts by midelic
Reply With Quote
Old Mar 15, 2014, 01:22 AM
e_lm_70 is offline
Find More Posts by e_lm_70
Registered User
Austria
Joined Jan 2004
8,842 Posts
Quote:
Originally Posted by midelic View Post
Of course...I alway do it,.... to be easy reconfiguring pinout.I selected the pins to match the ones from Flysky/Hubsan for easy compatibility when I'll make the universal module.
You can reconfigure the pins on :
#if defined(SPIBB)
..your pinout
#endif


I provided also pinout for HW spi just in case...missing only SPI routines.If somebody ask I can attach also the HW spi routines.
I think with the selected RF module you can have a good range.
@e
What I want from you is testing the RX code..It will spare me buying and waiting for the original Frsky Tx module.
Does your code require manual freq calibration , or you have it automatic ?

Send me your official RX code by email ... this weekend I will find time to test it

I did had some 1.27mm adapter, build it over a si4432 module on it ... very nice clean and solid connection, no nano soldering technology needed ... my cheap cc2500 have 1.27 pin spacing too

e_lm_70 is offline Find More Posts by e_lm_70
Reply With Quote
Old Mar 15, 2014, 01:25 AM
e_lm_70 is offline
Find More Posts by e_lm_70
Registered User
Austria
Joined Jan 2004
8,842 Posts
Quote:
Originally Posted by midelic View Post
I'm thinking in the future we can improve the telemetry reading from a module. FrSky uses inverted serial levels and thus inverters may be needed to convert the serial signal.I think this can be simplified.......on DIY module and make connection easier with a TX.
You need to integrate a LCD on tx, or make an external serial to LCD module ... more or less ... cloning the FrSky products
e_lm_70 is offline Find More Posts by e_lm_70
Reply With Quote
Old Mar 15, 2014, 01:25 AM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
No I didnt change it is ,....manual.I explained before how you do it..is not complicated.The one you have is the official for the moment.If working I'll add all the other features...one step at the time.
midelic is online now Find More Posts by midelic
Reply With Quote
Old Mar 15, 2014, 01:28 AM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
If you attach the model to a 9x clone or Tarranis..they have already LCD...Idk I'm thinking other solution...will see.

Quote:
Originally Posted by e_lm_70 View Post
You need to integrate a LCD on tx, or make an external serial to LCD module ... more or less ... cloning the FrSky products
midelic is online now Find More Posts by midelic
Reply With Quote
Old Mar 15, 2014, 04:02 AM
e_lm_70 is offline
Find More Posts by e_lm_70
Registered User
Austria
Joined Jan 2004
8,842 Posts
Quote:
Originally Posted by midelic View Post
....
@e
What I want from you is testing the RX code..It will spare me buying and waiting for the original Frsky Tx module.
Waiting for your latest and more blinking RX source code

Here weather sucks ... yesterday I did crash my micro Y4 that was my portable video maker in the last weeks ... so ...

e_lm_70 is offline Find More Posts by e_lm_70
Reply With Quote
Old Mar 15, 2014, 04:15 AM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
5,965 Posts
@e
Test that one for the moment.....with my module it works...
I'm still working on that auto tunning routine...it will take some time...I have also other commitments.
midelic is online now Find More Posts by midelic
Reply With Quote
Old Mar 15, 2014, 05:27 AM
e_lm_70 is offline
Find More Posts by e_lm_70
Registered User
Austria
Joined Jan 2004
8,842 Posts
Quote:
Originally Posted by midelic View Post
@e
Test that one for the moment.....with my module it works...
I'm still working on that auto tunning routine...it will take some time...I have also other commitments.
post #1 has only tx code ... not sure your old but latest rx code was sent by email in the past ...
e_lm_70 is offline Find More Posts by e_lm_70
Reply With Quote


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Wanted WTB: FrSky DHT-DIY Telemetry module svjerk Aircraft - General - Radio Equipment (FS/W) 0 Jan 16, 2014 03:57 PM
Question 9rx with Frsky module .. should I upgrade to DIY Frsky Tx? CyberCrash Radios 5 Jul 07, 2013 02:59 AM
Sold Frsky diy module v8ht + frsky 8ch rx v8fr vewdew Aircraft - General - Radio Equipment (FS/W) 5 Mar 15, 2012 11:29 AM
Discussion Anyone know how to convert DX7 to FrSky 2.4Ghz using the DIY module from FrSky?? roberted5 DIY Electronics 6 Sep 09, 2011 10:43 AM
Discussion FrSky 2.4G DIY RF Module into JR XP 7202 kriss poppe DIY Electronics 5 Jun 04, 2011 08:39 PM