HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Mar 14, 2014, 06:40 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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.

Pinout:
XL2500(any setup with CC2500 chip); 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."
************************************************** ****************************

To do:
Integration on multi protocol module(Flysky,Hubsan,Frsky..aso).
Telemetry.
Finish 1 way code.
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
RCG Plus Member
Last edited by midelic; Oct 22, 2014 at 10:43 AM. Reason: added important info
Reply With Quote
Sign up now
to remove ads between posts
Old Mar 14, 2014, 06:42 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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.For the DIY rx to be tunned to Frsky Tx module base freq,I implemented a small auto-tunning routine in the code.
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,nano,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)
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.
Atm there is no telemetry involved.
Fuses: FuseL=0xEF, FuseH= 0xC9 ....for M8 -16Mhz Xtal
Fuses: FuseL=0xBF;FuseH=0xCC( for M8- using external 8Mhz X-Tal)
For 8/16 Mhz version with hex files on M168/328 chip you can change fuses using the recommendations below.
http://www.codingwithcody.com/2011/0...fuse-settings/
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.


22.06.2014
Fixed a bug in ppm code(ppm out mode was not implemented properly)
Added also a small failsafe routine...throttle on channel 3.
See file:
"FrskyRx_2way_M328_16Mhz_FS.hex"
28.07.2014
Fixed bug in RX code problem in binding mode.Uploaded new hex.
Last version " FrskyRx_2way_M328_16Mhz_2.hex"
31.07.2014
Fixed bug in servo initialization code.
Update file "FrskyRx_2way_M328_16Mhz_3.hex"

22.10.2014
Fixed some bugs.......when TX switched off and on again.... rx may cause jitter on some servos.
Fixed bug also for channel 8(inactive).
See file "FrskyRx_2way_M328_16Mhz_4.hex"


NOTE:
Failsafe on Throtle -CHANNEL3
Program your TX with any channel order which have throttle in channel 3

Shopping:
http://www.aliexpress.com/item/1-pcs...566632579.html
http://www.ebay.com/itm/1-8-3-6V-CC2...item41698f4a84
http://www.ebay.com/itm/REYAX-CC2500...item2a228f1bec
Sources:
http://www.rcgroups.com/forums/showthread.php?t=1667453
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Oct 22, 2014 at 10:20 AM.
Reply With Quote
Old Mar 14, 2014, 06:42 PM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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.
Warning:
Ensure PPM signal not going over 3.3-3.9V.Insert a 1-2K resistor in series with PPM signal for better protection.

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)
22.10.2014
Fixed bug causing jitter on some servo.
See file "frsky_arduino_rx_ppm_Attiny85_2.hex"

NOTE:
Failsafe on Throtle -CHANNEL3
Program your TX with any channel order which have throttle in channel 3
midelic is online now Find More Posts by midelic
RCG Plus Member
Last edited by midelic; Oct 22, 2014 at 08:02 AM.
Reply With Quote
Old Mar 14, 2014, 09:16 PM
Registered User
Joined Jun 2013
491 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
RCG Plus Member
Old Mar 15, 2014, 01:09 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Mar 15, 2014, 01:59 AM
Registered User
Austria
Joined Jan 2004
7,999 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 08:40 AM.
Reply With Quote
Old Mar 15, 2014, 02:06 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Mar 15, 2014, 02:19 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Mar 15, 2014, 02:22 AM
Registered User
Austria
Joined Jan 2004
7,999 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, 02:25 AM
Registered User
Austria
Joined Jan 2004
7,999 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, 02:25 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Mar 15, 2014, 02:28 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Mar 15, 2014, 05:02 AM
Registered User
Austria
Joined Jan 2004
7,999 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, 05:15 AM
Registered User
midelic's Avatar
Joined Apr 2012
3,869 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
RCG Plus Member
Latest blog entry: DIY Multiprotocol TX Module
Reply With Quote
Old Mar 15, 2014, 06:27 AM
Registered User
Austria
Joined Jan 2004
7,999 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
Reply


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 04:57 PM
Question 9rx with Frsky module .. should I upgrade to DIY Frsky Tx? CyberCrash Radios 5 Jul 07, 2013 03:59 AM
Sold Frsky diy module v8ht + frsky 8ch rx v8fr vewdew Aircraft - General - Radio Equipment (FS/W) 5 Mar 15, 2012 12:29 PM
Discussion Anyone know how to convert DX7 to FrSky 2.4Ghz using the DIY module from FrSky?? roberted5 DIY Electronics 6 Sep 09, 2011 11:43 AM
Discussion FrSky 2.4G DIY RF Module into JR XP 7202 kriss poppe DIY Electronics 5 Jun 04, 2011 09:39 PM