|
|
|
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: https://www.rcgroups.com/forums/show....php?t=2165676 Sources: https://bitbucket.org/PhracturedBlue/deviation/src https://www.rcgroups.com/forums/show....php?t=1667453 Useful links: https://www.rcgroups.com/forums/show....php?t=1921870 https://www.rcgroups.com/forums/show....php?t=1954078 |
|
Last edited by midelic; Dec 18, 2015 at 05:44 AM.
Reason: added important info
|
|
|
|
|
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 -/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-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 watch the RX start blinking slowly ...now binding /FS settings complete. Warning : The binding with PFS is complete when the RX LED is flashing slowly, not when is off.Don;t stop the binding procedure in the middle. 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: https://www.rcgroups.com/forums/show...&postcount=968 For 4S lipo(16.8V) https://www.rcgroups.com/forums/show...&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. https://www.rcgroups.com/forums/show...postcount=1217 https://www.rcgroups.com/forums/show...postcount=1218 https://www.rcgroups.com/forums/show...&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. WARNING: I recommend "betemcu.cn" programmer type black pcb.There are existing on the market fake 3.3V USBASP programmer ,blue pcb color.Don't buy these as there is highly risk of burning your RX.Buy only the recommended programmer using below links.You have been warned. 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: https://www.rcgroups.com/forums/show...&postcount=796 https://www.rcgroups.com/forums/show...&postcount=864 NEW. FLASHING FIRMWARE USING 1 WIRE BOOTLOADER INTERFACE See below how to: https://www.rcgroups.com/forums/show...postcount=1782 ************************************************** ************************** ************************************************** ************************** Latest codes for F801 and F802 post 1147 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, https://www.rcgroups.com/forums/show...postcount=1147 ************************************************** ************************** ************************************************** ************************** ADDING HUB TELEMETRY HUB serial active pin is RX pin ,on F802 pin is marked "RX".Connect the Hub sensor on RX pin(RX,VCC,GND-3 pins required).Below is connection RX pin on F801. https://www.rcgroups.com/forums/show...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.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: https://www.rcgroups.com/forums/show....php?t=1667453 Note: The diagram below showing CC2500 module is a general one. Please check the pins arrangement of your existing CC2500 module. IMPORTANT NOTICE LIST OF RECOMMENDED RX I see lately a lot of Rx clones that using my code posted invaded the market.In order to avoid confusions,I post below a list of the RX tested tested and supported by me. Please buy RX that are recommended here,If you buy the clones I cannot give full support. 1.F801 / F802 -DIY FRsky compatible RX from BG and other retailer. 2.AC410/AC810 from HK. CLONES I don't recommend buying these RX below list because cannot safely be upgraded with my firmware and that the lack of information makes it impossible to me to provide any kind of support. On top of that these RX below manufacturers/retailers use the RX design and the code presented here without my permission or give credits to my work. 1.SRP8 from Superior Hobby. 2.Tiny 8ch FRSKY ACCST Compatible Receiver SBUS/PPM output--from HobbyKing. 3.Clone from TAOBAO- https://world.taobao.com/item/537264...23640.8.mlvnH3 4.Another clone from TAOBAO- https://world.taobao.com/item/538066...3640.14.D42P78 5.IRANGE X RX800 from BG 6.IRANGEX RS802 from BG. 7.DasMikro FrSky ACCST 0.45g 8CH PPM Receiver from http://m.geekbuying.com/item/DasMikr...er-371241.html 8.Eachine Tiny QX90 QX80 Quadcopter Parts Frsky 8CH PPM SBUS Receiver Compatible Frsky X9D PLUS X9E DJT DFT from BG 9.Furious Mini RX for Frsky -http://furiousfpv.com/product_info.php?cPath=29&products_id=50 If other clones will come up or have more info I will update the list. Donations: If you like this project and you feel like to contribute with a donation you can do at midelic@gmail.com |
|
Last edited by midelic; Oct 07, 2017 at 09:29 PM.
Reason: added diversity diagram
|
|
|
|
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=0xD6 extended_fuses=0xFE//SELFPRGEN enabled for tsb bootloader 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 13.08.2016 New version with PFS .It supposed to fix range issues. 24.08.2016 added code to fix "close encounter" bug make the code SRAM lighter.Please test and feedback. 05.01.2017 Added version bug fix binding with old DJT modules. It will work with all modules. ****Somebody made very nice AttinyRX with ceramic antenna . I have some and I uploaded code with SBUS output and RSSI telemetry. They have low weight(0.6 grams) and use them on my tinywhoop. https://www.rcgroups.com/forums/show...postcount=3222 https://www.rcgroups.com/forums/show...7#post37041332 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. **************************** FilesView all Files in thread
|
|
Last edited by midelic; Mar 30, 2017 at 05:11 AM.
Reason: cleaning/update diagram
|
|
|
|
Hey medelic
+1 for you You can put RX at this thread ? i want to see your RX |
|
|
|
|
|
Are the PIN reconfigurable?
With different cc2500 it may help to connect in a different way |
|
Last edited by e_lm_70; Mar 15, 2014 at 07:40 AM.
|
|
|
|
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. |
|
|
|
|
|
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.
|
|
|
|
||
|
Quote:
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 |
|
|
||
|
|
|
You need to integrate a LCD on tx, or make an external serial to LCD module ... more or less ... cloning the FrSky products
|
|
|
|
|
|
|
|
|
|
||
|
Quote:
Here weather sucks ... yesterday I did crash my micro Y4 that was my portable video maker in the last weeks ... so ... |
|
|
||
|
|
|
post #1 has only tx code ... not sure your old but latest rx code was sent by email in the past ...
|
|
|