PPM to USB Dongle

Projects that are not for RC, but are cool and worthy of development.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

PPM to USB Dongle

Post by jhsa »

Hey guys.. Why not build your own PPM to USB dongle?
I know, you can just buy one very cheap from China.. But I think it will give you even more pleasure building your own.. My 3 year old son doesn't let me fly on the simulator anymore so I decided to get another dongle so we can fly, eeerrrr... crash together :mrgreen:
But then i did remember i saw this project and decided to give it a go.
it is based on a virtual USB port for AVR microcontrollers. you can find all about it here.. Veeeery nice stuff

http://www.obdev.at/products/vusb/index.html

And below is the link for the PPM to USB project.. There are a couple more projects like this one on the V-USB site.
It uses very few components.. I built it with an atmega 8 but would like to port it to an Attiny 45 or 85 if possible as I feel that using the m8 I'm wasting a lot of pins..
The project runs at 12Mhz
I would like some help if possible to port the FW to the attiny as I don't know much about it.. Don't even know if it is possible..
It would also make the project smaller ;)
so, any help would be appreciated and i thank you in advance for it..

http://thomaspfeifer.net/ppm2usb_adapter_en.htm

Here is a little video I made from it working on the bread board ;)

[BBvideo 425,350]http://www.youtube.com/watch?v=SB-9hS8L ... e=youtu.be[/BBvideo]

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

It would be cool to refactor the above mentioned code so that it would run on usbasp hardware. Hard to get much cheaper than that. the pinouts would have to be redone. usbasp use PB0(ICP) for the usb side and this project uses that pin for the ppm input side. the usbasp does use the v-usb code though.

Wow and for an advanced project. modify the er9x/opentx firmware to output the ppm on one of the pins used to reflash the 9xr ( I cant remember if any of them arent used as switch inputs during normal Tx operation) . then you could reflash a usbasp with a modified version of this code, plug yourusbasp PPM dongle into the programming port and interact with the simulator. this is probably too much work for the small use case though. Just a mental exercise :)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

A couple pictures of it.. Nice little project.. ;)

João
Attachments
020820132577.jpg
020820132576.jpg
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

Looks good
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

You can't see it but there are SMD (1206) caps and resistors on the other side of the board..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

I watched you flying the simulator. You made it look easy. I dont fly very well.

Did you use zener diodes ? The glass type? I notice some of the usbasb are moving away from the glass type.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

yes i did. Surface mount ones.
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

jhsa wrote:yes i did. Surface mount ones.
Stiupid me, I meant to say through hole ones.. Only saw the mistake now :( sorry
I was at work and had some drunk people wanting to play my guitar at the same time I was posting :)
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

I wish I had my guitar at work. Drunks we got . Guitars not so much :)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

In my case, the guitar is a tool I use for work :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

Yea
Cant let people mess with your tools
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

Just tested this circuit with my 9x sending 8ch.. No problem at all.. It's amazing that it works so well :)
The one I bought doesn't accept more than 6 channels..

I wonder if I can send more than 8.. I guess we will have to find out? ;)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

Actually the dongle seems to work with more than 8 Channels.. Shame that the simulator doesn't :( :mrgreen:
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

Hi
I modified a usbasp to allow this code to run. Had to cut one trace and solder one jumper wire. Last night I got as far as plugging it into the computer and it was recognized as a 'HID joystick' or something like that. I'd like to test it tonight.

What simulator did you use ?
Do you know of a free simulator that will work with the dongle ?
How about anything that will run in linux ? Native or wine?

A guy at work got me started on rc simulator on my android tablet. Now I'd like to do it at home through my 9x or even an old dx4e that i stripped the rf module out of.

Thanks
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

FMS is free and it should work with it ;)

I use aerofly..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
gohsthb
Posts: 1412
Joined: Wed Dec 28, 2011 2:32 pm
Country: -
Location: Naperville, IL

Re: PPM to USB Dongle

Post by gohsthb »

The attiny45 and 85 lack a hardware input capture that the code is using. So it seems that is out as an option :(.
-Gohst
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

Thanks for inspiring me :)
I got it built and tested it with the linux program 'jstest-gtk'. Havent tried it with a simulator yet.
I had already cannibalized the 1/8" PPM out plug so I had to hardwire it. I am using USB power for the TX. It only pulls about 50ma. The RF section was used for my DSM mod for my 9X.

I put a few pictures here
https://plus.google.com/u/0/10209286602 ... cJEYm7vBVq

and along the lines of 'license police' I like this guys code -BUT- He uses V-USB with is GPL, NOT LGPL. However this guy releases his code with a NON COM clause. Pretty sure, not 100%, but pretty sure, that is a NO NO. Then again, he could have paid V-USB for a com license, but then he wouldnt be releasing his code at all , I dont think. OK I'm done.

gohsthb is right about the ICP. That is the line I had to cut as USBASP uses that on the USB D- pin. I think the code could be completely rewritten using a 'pin change interrupt', but that is beyond my reach at this time. I just used his binary and hacked the usbasp hardware to match his pin utilization.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

jhsa wrote:Actually the dongle seems to work with more than 8 Channels.. Shame that the simulator doesn't :( :mrgreen:
I was wanting to reduce the number of channels as the dx4e uses 6 ( i think.) I was having a glitchy channel 4. I looked at the code and realized there are 2 files that needed to be changed. My glitch ended up going away when I recalibrated the joystick in linux. I reduced the size of the dead zone in the middle of the stick. dont know why that helped but it did.

I dont know if this git diff will apply as a patch or not. I dont git around much :)
This reduced the number of ppm channels read AND the number of usb channels outputed.

Code: Select all

diff --git a/firmware/main.c b/firmware/main.c
index 8401cd9..38f176b 100755
--- a/firmware/main.c
+++ b/firmware/main.c
@@ -65,7 +65,7 @@ PROGMEM char usbHidReportDescriptor[50] = { /* USB report descriptor, size must
 };


-static uchar reportBuffer[8];
+static uchar reportBuffer[4];
 static uchar idleRate;  /* repeat rate for keyboards, never used for mice */


diff --git a/firmware/ppm.c b/firmware/ppm.c
index 6766d50..8a156a3 100755
--- a/firmware/ppm.c
+++ b/firmware/ppm.c
@@ -27,7 +27,7 @@
 ^M
 #define PPM_TCNT TCNT1^M
 ^M
-#define CHANNELS (8)^M
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

lol in my case I built thios dongle cos I wanted to use the 8 9x channels.. the chinese one only accepts maximum 6.. will check the glitch thing..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
NI0X
Posts: 67
Joined: Thu Mar 07, 2013 3:19 pm
Country: -

Re: PPM to USB Dongle

Post by NI0X »

rperkins wrote:Hi
I modified a usbasp to allow this code to run. Had to cut one trace and solder one jumper wire. Last night I got as far as plugging it into the computer and it was recognized as a 'HID joystick' or something like that. I'd like to test it tonight.

What simulator did you use ?
Do you know of a free simulator that will work with the dongle ?
How about anything that will run in linux ? Native or wine?

A guy at work got me started on rc simulator on my android tablet. Now I'd like to do it at home through my 9x or even an old dx4e that i stripped the rf module out of.

Thanks
I would like to do that as it seems to be pretty straight Forward.
Is that possible on the new Version of the usbasp which Hobbyking sells?
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

I would say yes it should work with any usbasp as they all follow the same hardware schematic. Exactly where you need to cut and solder would be different though.

If you need more help I could probably tell you where to cut and solder if I had good pics of both sides of your usbasp. It would take me a little while to review the code as I dont remember all the details. I do remember it was the ICP pin that needed rerouted.

You know after making the change it wont work as a usbasp any more ?

If I was a better coder I think this code could be modified to work on a usbasp without any hardware changes. It would run off of a 'pin change interrupt' instead of the 'input capture pin' . If there is an interest I can see if I can make that work. Currently I am sidetracked on buying broken pro audio equipment and fixing it. gonna go look at a broken digital piano tonight, but I digress :)
NI0X
Posts: 67
Joined: Thu Mar 07, 2013 3:19 pm
Country: -

Re: PPM to USB Dongle

Post by NI0X »

rperkins wrote:You know after making the change it wont work as a usbasp any more ?
Yes of course I know it ;)
I am looking for a cheap solution to have an 8 channel (at least) PPM2USB Interface.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: PPM to USB Dongle

Post by rperkins »

great
Above I noted the two places the code needed to be modified to change the number of channels.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: PPM to USB Dongle

Post by jhsa »

The one described at the beginning of the thread, works with 8 channels and probably more.. No need to change any code.. I'm using the 8 channels that the simulator allow. I think it wouild be possible to use more as I injected 10 channels and the dongle didin't mess the channels up as some of the dongles do ;)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: PPM to USB Dongle

Post by OctavioS »

dongle.JPG
dongle.JPG (14.56 KiB) Viewed 22873 times
Does anybody know if its possible to make these chinese usb simulator dongles accept more than 4 channels?
Thx!
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
tonnie78
Posts: 123
Joined: Mon Jan 12, 2015 9:33 am
Country: -

Re: PPM to USB Dongle

Post by tonnie78 »

Yes I used that dongle on the Taranis trainer port and it gave me 8 channels.
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: PPM to USB Dongle

Post by OctavioS »

tonnie78 wrote:Yes I used that dongle on the Taranis trainer port and it gave me 8 channels.
Really?
Which simulator do you use?
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
tonnie78
Posts: 123
Joined: Mon Jan 12, 2015 9:33 am
Country: -

Re: PPM to USB Dongle

Post by tonnie78 »

Realflight RC7
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: PPM to USB Dongle

Post by kalle123 »

Octavio, that one works here with PhoenixRC. But it is not quite legal. Yes, and I have the original PhoenixRC dongle ;)
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: PPM to USB Dongle

Post by OctavioS »

tonnie78 wrote:Realflight RC7
ok, i dont have that one.
kalle123 wrote:Octavio, that one works here with PhoenixRC. But it is not quite legal. Yes, and I have the original PhoenixRC dongle ;)
Me too, the same (5.0v). But in case your stock original dongle stops working, and mine is out of warranty time, this is a nice backup. Unless you know where to buy the standalone dongle without paying again 100€+ for a new sim bunble.
Also i know it works with phoenix RC and others. But, can you take more than 4 channels?
Everytime i try to to configure a new controller only 4 channels were available (RTEA) and nothing more.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.

Post Reply

Return to “Other Electronic Projects”