This adaptor is suited to attach your RC transmitter to computer via game-port. That allows to use transmitter like joystick with any software, but it will be most useful with RC model simulators.
Theory
Every gameport hardware contains "classic" 555-timer, which acts as pulse generator with variable pulse length. Timing capacitor is placed at gameport side, and timing resistor is placed in joystick. That resistor change it's value upon joystick movement. When software writes to gameport address, pulce genegation starts, capacitor is charged via joistick resistor, until capacitor voltage reaches 2/3 of power voltage. Then, trigger in 555 timer switches, pulce finishes and capacitor discharges. Software counts pulse length and determines joystick position. Below, you can see a voltage diagram at gameport input. Of cause, here was described work of single channel. Usually, gameport has 4 channels, and those work simultaniously.
There are lots of another RC-joystick interfaces, but most use digital potentiometers, to imitate a real joystick. That's straitforward solution. But not the best, not the simpliest, there'are too many details and so on...
Certenly, it would be nice to have somerthing more original. We still need microcontroller, but note, that PC software measures only the charging time. Not resistor value, not capacitor voltage, but only charging time.
Here it solution: let's try to control gameport inputs with digital methods, useing 555-timer peculiarities. We have only 2 key moments: the moment of 555-timer start and the moment of 555-timer stop. Everything between those events doesn't make a sence. So we have the followind algorythm:
Here is gameport input diagram:
It's no use to describe schematics, because it's evident. Curcuits values are not critical. Transistor Q1 has russian title, but you can easily find somerthing similar in your local stock. Any NPN transistor will be ok. Note, that input plug is wired for Hitec and Futaba 8U/9Z transmitters. If you have another transmitter, just change plug. Apparently, no comments can be done about how to were other transmitters. I doesn't have those, so I can't help and don't ask me about.
Practice
This adapter supports up to 8 channels. 4 proportional and 4 discrete. Discrete channels imitate joistick buttons. It worth to make custom 4-axis joistick in Windows (go to game adapters in control panel). If you transmitter has less channels, that's not a problem: anyway, make a full joystick (4 axis, 4 buttont) and use only available controls. You will se a really working channels during joystick calibration. By the way, adapter always shows 4 axises and 4 buttont, but unavailable controls are fixed at certain position (unavailable sticks are placed in the midle position).
Now about buttons: Windows expects, that joystick has at least one buttont. This button is used for calibration. So, if you have only 4-channel transmitter, you need to use fake button (S1), placed at schematics. Of cause, if you like, you can add more buttons (up to 4 total) right to adapter.
The next topic you must know is mapping of transmitter channels to joystick axises and buttons. Adapter firmware was written for my Hitec Prism 7x. If you need another mapping, for example, to change stick directions and so on, then you can change firmware source code. Find in the begining of code appropriate parts and modify it. Here're some explanations, how to do that:
Joystick axises mapping. X1, Y1, X2, Y2 - joystick axises, look to schematics
for microcontroller assignement. Change the following strings, to suit your
needs.
TestChannel Ch1tmpL, Ch1tmpH, X1 ; Channel1 output
TestChannel Ch2tmpL, Ch2tmpH, Y1 ; Channel2 output
TestChannel Ch3tmpL, Ch3tmpH, Y2 ; Channel3 output
TestChannel Ch4tmpL, Ch4tmpH, X2 ; Channel4 output
Channel revercing. "DirectChannel" means, that channel is mapped
straight, "ReverseChannel - channel is reverced.
DirectChannel Ch1tmpL,Ch1tmpH,1 ; Channel 1
ReverseChannel Ch2tmpL,Ch2tmpH,2 ; Channel 2
ReverseChannel Ch3tmpL,Ch3tmpH,3 ; Channel 3
DirectChannel Ch4tmpL,Ch4tmpH,4 ; Channel 4
Buttons mapping. Play with Button1-4, if required.
CheckButtons 5, Button1 ; Channel 5
CheckButtons 6, Button2 ; Channel 6
CheckButtons 7, Button3 ; Channel 7
CheckButtons 8, Button4 ; Channel 8
After applying changes you need to assemble code. That can be done with AVR Studio. It's a free development environement, take it from http://www.atmel.com.
Microcontroller programming is relatively easy. Programmator is attached via J1 connector. I've used programmstor AvReal. It consists of 5 wires, attached to LPT-port (look AvReal docs). Command line for my case was "avreal -ew -p1 +90s2313 -! -o8000 rc2joy.hex". AvReal documentation describes all details about launching softwaer and making command line arguments.
To avoid questions about printed circuit board, I'd like to warn you, that I 've used a simple test board and connected details with wires.
Problems and Bugs
There're no problems and no bugs :)
In real life:
Schematics, program sources and this description of "RC to joystick adapter" are freeware. You can use it for noncommercial purpuses and futher distribute, keeping integrity of source archive and all files included. Any commercial use without author's permission is prohibited.
© JIV 2001