FrSky V8 transmitter module using Arduino and CC2500

Any old or new electronic projects on the go
AndyS
Posts: 42
Joined: 12 Oct 2018, 19:03
Location: Biggleswade

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by AndyS »

I am not sure if I have the modified code correct.

LED is on all the time and the scope sees nothing on pin 13.

Sketch attached.
Attachments
Frsky-PPMTest.zip
(3.37 KiB) Downloaded 182 times
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by Martin »

Sorry that I wasted your time Andy, but also thanks! You found a bug in my library. :lol:

Okay, first a bug in the test program. I stupidly said use the LED pin (13), but that won't work when we're using regular SPI because pin 13 is also SCK, and used by the library for communicating with the CC2500. Change the 13 in the pinMode and digitalWrite to some unused pin, 8 maybe.

Here's a snap of what I saw once I'd fixed the library bug (see below) and swapped to pin 8. Incoming (6-channel CPPM signal from my little Orange R617XL receiver) in yellow, and the output signal from pin 8 in sky blue.

ppmTest.jpg
The more serious bug was in the library, and affected the library's micros() function when running on a 16MHz Arduino. Since I accidentally introduced that bug, I've been mainly testing with an 8MHz Arduino, and the bug only affected the cppm sketch so I'd not seen it. :oops:

Here's the fix. Put the three files in the attached zip into your Arduino\libraries\FrSkyV8Tx folder, overwriting the files already there (you probably don't have the .S file which is a recent addition).

Recompile your sketch and upload it again, and it should spring into life.

That's a temporary fix for you and anyone else currently trying the code. It won't be needed once I've updated the files attached to the 1st post of this thread so that they have the same date as this post (or newer).

Edit: I've now removed the .zip file from this post. I've updated the attachments in the opening post of the thread, so the .zip that was attached here is now outdated.
Last edited by Martin on 11 Nov 2020, 13:34, edited 1 time in total.
AndyS
Posts: 42
Joined: 12 Oct 2018, 19:03
Location: Biggleswade

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by AndyS »

Yes - cppm sketch working OK now. :D

Many Thanks Martin.
AndyS
Posts: 42
Joined: 12 Oct 2018, 19:03
Location: Biggleswade

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by AndyS »

I made a version that is a bit tidier. Still a bit on the large side for a practical modification of a transmitter. But the idea of this build was to enable any of the Arduino, RF Module or 3.3v supply to be swapped. Can be a lot smaller, just a Pro mini and the CC2500 back to back.

Another option could be an Arduino based encoder with the addition of the Frsky protocol code, thus reducing to a single arduino and rf module.

Both low and LNA+PA version work very well with my Frsky V8FR-II receivers. I would recommend this project to anyone looking for a Frysky compatible RF module for their transmitter project.

Once again many thanks to Martin for making this a reality for me. :D
4DF4968C-AEF4-403D-A6D7-73C1589BD1FC.jpg
0229CCB0-60CF-4CFC-92AB-2CD6B34D49DA.jpg
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by Martin »



Attachments
coronaFrSkyV8.zip
Sketch for corona module. Could be used on most common Arduinos - see comments in source for connection details. If you're making your own hardware and you connect up the PA and LNA lines as recommended in the Library version, you can ignore pins 2, 3, 5, 6, 7, 9.
(7.04 KiB) Downloaded 182 times
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by Martin »

I've updated the library, and documentation attached to the opening post.
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by Martin »

Phil_G wrote: 11 Nov 2020, 20:04 An idea (though probably too late!) Martin - why not tune using the throttle stick, you know, read the channel from PPM and set the tuning across the throttle stick throw? Start at low throttle & its out of tune, slowly increase it till it links, carry on opening the throttle till it drops the link, set the throttle halfway between and press/release the module button to lock it in?
No, not too late, and a good idea! Easy enough to code, but I've thought of a couple of practical snags:
  • The Futaba (and I assume, Hitec) module will be expecting throttle on channel 3, but if the same code is loaded into a JR-style module, then throttle would normally be on channel 1. Actually, in the sketch these would be channels 2 and 0 respectively - but you know what I mean.
  • I'm considering the situation where a user is trying to fine-tune, with the receiver already in a model - and the user hasn't thought to remove the propeller or otherwise make the model safe when it suddenly starts receiving the commanded throttle-stick position whenever the transmitter comes into the working tuning range. Of course, the transmitter could just transmit 'throttle low' all the time when tuning, and only use the stick to alter the tune - but you still need to consider what happens when they press the button to store the value, and how to safely get back to a normal transmitting mode.
  • Actually, tuning should only need to be a one-time, on-the-bench thing. Once the module is tuned it should stay in tune forever, and the same tune should work for all receivers. But users being users, I'm sure some of them will be tempted to tune on every outing - just for the hell of it! :lol:
I suppose we could get around both problems by using channel 4 (3) for tuning? That would be the rudder function for both systems - awkward though, because the user would be trying to hold the rudder stick steady against spring centring. We could use the rudder as a kind of three position switch - like a reeds transmitter - to nudge the tuning up or down, one step at a time, or keep it steady when the rudder is anywhere near centre?

Maybe we can think of another solution? :?
User avatar
Wayne_H
Posts: 808
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by Wayne_H »

Martin,

when I opened the FrSkyV8Tx.pdf file attached to your first post, it only contains 1 page with one line of text
content of FrSkyV8Tx.pdf.JPG
which doesn't seem to match the description:
Library documentation, updated 2020-11-11 Now includes more detailed API descriptions of all
the available library functions.

(8.31 KiB) Downloaded 3 times

Would you please check & reload if necessary. Many thanks,
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by Martin »

Thanks Wayne.

I don't really understood how that happened. I edited the document using LibreOffice Writer and then did "Export as PDF..." It looks like it exported just a selection rather than the whole thing, but I don't remember ever having selected just the "frsky.micros();" part. :?

Anyway, I've just done it again and reloaded it. Hopefully now fixed.
User avatar
Wayne_H
Posts: 808
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: FrSky V8 transmitter module using Arduino and CC2500

Post by Wayne_H »

Martin wrote: 12 Nov 2020, 10:07 .....Anyway, I've just done it again and reloaded it. Hopefully now fixed.
Thanks Martin - the pdf now appears complete (7 pages) & I note also that the zip file is larger, so I replaced the previous version of it as well. Fabulous :D :D
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
Post Reply