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.
all credits to Phracturedblue and its deviation firmare.
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.
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.
The code is provides as is, and without any liability or warranty involved.
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.
Minor update of the code...introduce a variable for tweaking easier the CC2500base frequency..along with a better explanation.
//this is useful for tunning TX base frequency to frsky RX freq."
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.
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.
1.Do not exceed 3.3V -3.6 Max for CC2500.
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.
For 16 Mhz version with hex files on M328 chip you can change fuses using the recommendations below.
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.
Erased previous hex files and updates.
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.
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.
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.
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.
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.
But it will still be available all 8 in PPM mode.
Much simpler and better solution for adding voltage sensor to RX.
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).
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.
It can be 3.3V USBASP programmer.
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.
The firmware may be updated without notice so please check these links periodically or when you have problems.
Below codes with PFS and SBUS activated features.
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.
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.
Instead of bind button for binding it can be used bind plug between Channel 8 and GND.
The diagram below showing CC2500 module is a general one.
Please check the pins arrangement of your existing CC2500 module.
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.
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.
2.Tiny 8ch FRSKY ACCST Compatible Receiver SBUS/PPM output--from HobbyKing.
If other clones will come up or have more info I will update the list.
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.
Updated last version of FrsktAttiny.Fixes regarding jitters and Taranis TX binding.
Version NO failsafe(no classic failsafe) cut PPM signal after 450ms signal lost.
Updated diagram with LED and voltage regulator.
New version with PFS .It supposed to fix range issues.
added code to fix "close encounter" bug make the code SRAM lighter.Please test and feedback.
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.
With PFS(programmable FS) you can use any channel arrangement.
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.
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.
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.
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.
Does your code require manual freq calibration , or you have it automatic ?
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.
If you attach the model to a 9x clone or Tarranis..they have already LCD...Idk I'm thinking other solution...will see.
I'm still working on that auto tunning routine...it will take some time...I have also other commitments.