Jump to content
Sign in to follow this  
JosephArmbruste

JR PIC96 Serial->TX

Recommended Posts

Hi,

I have a JR Sport S400 controller hooked up to the PIC96 serial -> transmitter cable. My ultimate goal is to operate my alpha trainer from my computer. I figured a good first step would be to hook my PC via serial up to the the transmitter and:

- decode the data received

- figure out what data needs to be sent to modify the state of each channel

I hooked up the controller and in NON-trainer mode, listened to the bytes I was receiving. I hacked together the following blip of python to read / analyze the data:

import serial

ser = serial.Serial('/dev/ttyS1', 9600, timeout=5)

while(1):

x = ord(ser.read())

print x

if x == 0:

break

while(1):

x = ser.read(6)

x = map(ord,x)

print '%3d %3d %3d %3d %3d %3d' % (x[0], x[1], x[2], x[3], x[4], x[5])

ser.close()

The bytes are pretty self explanatory, in fact, this is what the bytes looked like from no-throttle to full-throttle.

151 106 105 105 246 0

151 106 105 105 246 0

151 106 105 105 246 0

151 106 105 106 246 0

151 107 105 106 246 0

151 107 105 105 246 0

152 107 105 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

153 108 106 107 246 0

153 108 106 107 246 0

153 108 107 107 246 0

153 108 106 107 246 0

153 108 107 107 246 0

153 108 107 107 246 0

153 108 107 107 246 0

153 108 107 108 246 0

154 109 107 108 246 0

154 109 107 108 246 0

154 109 107 108 246 0

154 109 108 108 246 0

154 109 108 108 246 0

154 109 108 108 246 0

155 110 108 108 246 0

155 110 108 108 246 0

155 110 108 109 246 0

155 110 109 109 246 0

155 110 109 109 246 0

155 110 109 109 246 0

156 111 109 110 246 0

153 111 109 110 246 0

137 111 110 110 246 0

119 111 110 110 246 0

103 112 110 110 246 0

88 112 110 111 246 0

78 112 111 111 246 0

72 112 111 111 246 0

73 113 111 111 246 0

73 113 111 111 246 0

72 113 111 111 246 0

So, I can figure out reasonably easily what bytes I am receiving and what they mean. Now, onward to the 'controlling' part. I have no clue what the PIC92 is expecting to receive in order to change the state of a specific channel OR more importantly, IF the PIC92 is meant to receive data at all. . . Which leads to my questions :-)

a) Is the JR PIC92 cable a two way street? So that it can both receive commands and transmit state information. Right now, I am assuming this is the case, since when I switch trainer-mode on, I no longer receive any bytes. I was warned by one individual that this interface may simply exist to operate with flight-simulator programs (aka, never receive any data... just transmit).

B) If the JR PIC92 is meant to receive commands, does anyone have any insight into what they might be? Is there any standard set of instructions that the RC community has come to agree upon for their pic interfaces to these devices?

In 2008, am I Really going to have to get out a soldering iron for this.... 8>)

Thank you all in advance!

Share this post


Link to post
Share on other sites

My apologies, I just reviewed and it looks like the tabs were removed from the python code. . . Ooops !

Hi,

I have a JR Sport S400 controller hooked up to the PIC96 serial -> transmitter cable. My ultimate goal is to operate my alpha trainer from my computer. I figured a good first step would be to hook my PC via serial up to the the transmitter and:

- decode the data received

- figure out what data needs to be sent to modify the state of each channel

I hooked up the controller and in NON-trainer mode, listened to the bytes I was receiving. I hacked together the following blip of python to read / analyze the data:

import serial

ser = serial.Serial('/dev/ttyS1', 9600, timeout=5)

while(1):

x = ord(ser.read())

print x

if x == 0:

break

while(1):

x = ser.read(6)

x = map(ord,x)

print '%3d %3d %3d %3d %3d %3d' % (x[0], x[1], x[2], x[3], x[4], x[5])

ser.close()

The bytes are pretty self explanatory, in fact, this is what the bytes looked like from no-throttle to full-throttle.

151 106 105 105 246 0

151 106 105 105 246 0

151 106 105 105 246 0

151 106 105 106 246 0

151 107 105 106 246 0

151 107 105 105 246 0

152 107 105 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

152 107 106 106 246 0

153 108 106 107 246 0

153 108 106 107 246 0

153 108 107 107 246 0

153 108 106 107 246 0

153 108 107 107 246 0

153 108 107 107 246 0

153 108 107 107 246 0

153 108 107 108 246 0

154 109 107 108 246 0

154 109 107 108 246 0

154 109 107 108 246 0

154 109 108 108 246 0

154 109 108 108 246 0

154 109 108 108 246 0

155 110 108 108 246 0

155 110 108 108 246 0

155 110 108 109 246 0

155 110 109 109 246 0

155 110 109 109 246 0

155 110 109 109 246 0

156 111 109 110 246 0

153 111 109 110 246 0

137 111 110 110 246 0

119 111 110 110 246 0

103 112 110 110 246 0

88 112 110 111 246 0

78 112 111 111 246 0

72 112 111 111 246 0

73 113 111 111 246 0

73 113 111 111 246 0

72 113 111 111 246 0

So, I can figure out reasonably easily what bytes I am receiving and what they mean. Now, onward to the 'controlling' part. I have no clue what the PIC92 is expecting to receive in order to change the state of a specific channel OR more importantly, IF the PIC92 is meant to receive data at all. . . Which leads to my questions :-)

a) Is the JR PIC92 cable a two way street? So that it can both receive commands and transmit state information. Right now, I am assuming this is the case, since when I switch trainer-mode on, I no longer receive any bytes. I was warned by one individual that this interface may simply exist to operate with flight-simulator programs (aka, never receive any data... just transmit).

B) If the JR PIC92 is meant to receive commands, does anyone have any insight into what they might be? Is there any standard set of instructions that the RC community has come to agree upon for their pic interfaces to these devices?

In 2008, am I Really going to have to get out a soldering iron for this.... 8>)

Thank you all in advance!

Share this post


Link to post
Share on other sites
Is the JR PIC92 cable a two way street? So that it can both receive commands and transmit state information.

I have no idea what a PIC96 is, but R/C simulator dongles are not 2-way. No reason for that in order to operate the simulator.

when I switch trainer-mode on, I no longer receive any bytes.

Yup, when the trainer switch is enabled, JR's internal PPM encoder signal path is interrupted and the Tx expects the PPM stream to be applied by an external source. Could be another {slave} Tx or some hardware/software that supplies a properly formatted PPM signal. For example: http://www.rc-cam.com/forum/index.php?showtopic=1988

Share this post


Link to post
Share on other sites

I don't know of a 2-way interface on the market. There are input ones for simulators and output ones for robotics though.

And as Mr-RC-CAM said, the trainer port on JR transmitter is 2-way, on the same contacts. When trainer mode is off it will send its PPM signal for others to use, when you switch trainer mode on it stops doing that and instead expects someone else to feed it a signal.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×