I have a PTZ Optics camera which can apparently take input from an RS-232 joystick. I've never used a joystick before but apparently there's a standard for joystick communication over RS-232. I had a broken gamepad sitting around so I figured it would be pretty easy to wire its buttons and sticks to a micro hidden in the handle and look up the joystick control specifications to send commands to the camera.
The first part was easy, the second part however is stumping me as I have spent over an hour googling now and have found nothing defining the messages in this protocol. Anybody have any experience with RS-232 joysticks know where I can find a spec on the communication protocol in order to effectively make my own joystick?
The best thing I can think of is to connect a sniffer and watch the signals and decipher what they mean as you move the joystick. If you are correct you can connect a 10K resistor to the output of the joystick, the other end to a 74HC04 (or =) and connect the output of the 04 to a serial input on the arduino, you may have to use software serial. Then just dump in HEX to the debug console. That will give you an idea of what is coming across. Of course you have to have the baud correct for this to work.
gilshultz:
The best thing I can think of is to connect a sniffer and watch the signals and decipher what they mean as you move the joystick. If you are correct you can connect a 10K resistor to the output of the joystick, the other end to a 74HC04 (or =) and connect the output of the 04 to a serial input on the arduino, you may have to use software serial. Then just dump in HEX to the debug console. That will give you an idea of what is coming across. Of course you have to have the baud correct for this to work.
I could do that if I had an existing RS-232 joystick to listen to. But then I wouldn't be needing to make one in the first place.
It seems weird that this is a standardized protocol that's been around for ages but it's seemingly impossible to find a definition for it online anywhere.
It seems weird that this is a standardized protocol that's been around for ages but it's seemingly impossible to find a definition for it online anywhere.
That would suggest to me that there isn’t a standard protocol. I certainly have never come across mention of such a thing in over 50 years of doing this sort of thing.
That doesn’t mean there isn’t one but if there is it hardly deserves the name standard.
By following links from the one you posted I came across this