#96111 - 28/05/2002 05:16
Sony stalk interface
|
stranger
Registered: 12/04/2002
Posts: 35
|
I am trying to connect up a non-Sony steering wheel remote (on a Chrysler vehicle) to the Sony stalk interface on a tuner and I need help!
The scenario:
On my Jeep the steering wheel remote switches are pulled to 5V by the car and pressing one of the six possible buttons causes the voltage level to drop to levels like 0.5v, 1.5v, 2v, 2.5v, 3v, 3.5v, 4.5v. Looking at the FAQ it appears the stalk interface on the tuner module has a 22K pull-up resistor going to 5V and the stalk is the just fed into an a/d on a PIC microprocessor. Normally with a Sony stalk attached it will have the same effect as above pressing different switches will cause a simple voltage divider and levels to be applied to the PIC. (BTW The 22K resistor inside the tuner is too high a value for the Jeep, if I disconnect the car feed and just use the 22K->5V pull-up I get levels voltage levels of less than 1v for all switches).
My reading of the interface is that it returns a packet containing the state of a shift button (that I am not using) plus the a/d level in the range of 0-0xff (for 0-5V). One packet being sent for a button down press and a second packet on button release. The latter always having a value of 0xff.
So far so good, I connect up the remote and press the buttons and then I hit the problem. Only two or three of the buttons are reported the rest just don't get 'seen'. Yet as far as I can tell they should. BTW I am using hijack to report stalk packets to the serial port.
After all of that these are the questions!
a) Does the pic just report a/d values or does it do any other processing.
b) What voltage range does the pic interpret i.e. is it covering the full 0-5V range or just a subset.
c) Any ideas where or what I am going wrong?
|
Top
|
|
|
|
#96112 - 28/05/2002 09:37
Re: Sony stalk interface
[Re: snowwhite]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Perhaps you should start by measuring the right value. The Sony stalk interface does not interpret voltage, it interprets resistance. I know the two are inter-related, but I'm just saying, start at the bottom of the right ladder.
Also, I don't know if the Chrysler interface simply changes the voltage or resistance on the wire. It's possible that it's got some sort of pulse code modulation or serial communication happening on the wire, and that it only seems to change the voltage as read by your volt meter.
|
Top
|
|
|
|
#96113 - 28/05/2002 10:18
Re: Sony stalk interface
[Re: tfabris]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
Tony, the stalk interface measures the voltage at the socket. This happens to correspond with measuring the resistance of a pure resistor such as the Sony stalk because of the internal resistor network. If an external source provides a non-resistive voltage input, then that voltage will be measured, and the internal resistor network will have virtuall no effect (it's now merely a heater). See the circuit diagram on RioCar.Org for details.
Snowwhite, Tony's advice to actually measure the voltage present at the input is good - remember that your stalk's output will have its own source resistance which may have an effect (and if the resistance is different for different outputs, it may cause some buttons to be indistinguishable). And get your hands on an oscilloscope if you can, to check whether it's using some serial protocol.
The stalk interface needs its input to be stable for a certain time (Hugo? Patrick? anyone?) before you get the packet at the tty device. Perhaps your stalk isn't holding the line steady enough? That's quite likely if it's using some digital protocol.
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#96114 - 29/05/2002 15:01
Re: Sony stalk interface
[Re: tms13]
|
stranger
Registered: 12/04/2002
Posts: 35
|
It's a Grand Jeep Cherokee and the remote interface at the back of the radio is a pulsed signal (looking very like Sony's S-Link or baseband IR). However I'm taking a tap off the wiring harness at the steering wheel which it a voltage level (or resistor level if I cut the original factory connection).
Some basic maths show that the with a 5V drive, 22K pull-up resistor (as shown in the dev faq) and using the sony resistor values from the dev faq produce a voltage level rising in 0.4V increments between 0.4V and 4V.
Currently I have six voltage levels which unfortunatly do not match the sony levels exactly.
What I really need to determine is if the PIC in the tuner returns packets for all voltage levels or just for the 'valid' bands (there are ten bands between ~0.4 and ~4V, the mid point being at 0.4v intervals. Each band has about 0.1v gap between the next).
If the PIC only retuns 'valid' results then I need to shift the Jeep levels into valid bands. If the PIC retuns a straight voltage from the a/d convertor then I hope I can re-define the valid bands using hijacks rhs_stalk command.
Anyway I'm off to the car to add a 2K resistor to the circuit as this show make the existing circuit a closer match to the sony stalk and to play with Hijack.
Oh, and before someone suggests changing the resistors in the steering wheel - I did think about this, but I hate airbags and I do want to re-sell this car at some point which will require putting it back to factory fit. And after what this Empeg cost me, there is noway I am going to giving it away in the car!!!!!!!
|
Top
|
|
|
|
#96115 - 29/05/2002 15:35
Re: Sony stalk interface
[Re: snowwhite]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Ah, cool, I see.
Anyone know if the tuner sends raw resistor values to the player or if it sends pre-validated codes to the player?
Because if what this gentleman is saying is true, and if we can program Hijack the way I'm hoping that we can, then I can get my friend Tod's steering wheel controls working without an adapter box. All I need to know is where to tap into the factory wire (as described in the above message).
|
Top
|
|
|
|
#96116 - 29/05/2002 16:23
Re: Sony stalk interface
[Re: snowwhite]
|
stranger
Registered: 12/04/2002
Posts: 35
|
Well, it looks like the PIC has fixed ranges or I am doing something very wrong. Which is a pitty, as I can't see any way to align the six possible switch options I have with the sony levels. I can do combinations of four but not all six.
Guess I might be taking the steering wheel apart afer all.....
These are the 'mid point' voltage levels for the stalk interface (leftmost value):
hex, dec, res opt, res min, res max, Voltage
16 22 2077 1473 2714 source 0.4v
2a 42 4338 3616 5101 att 0.8v
3a 58 6477 5635 7372 back/front 1.1v
48 72 8656 7683 9695 fwd track 1.4v
5a 90 12000 10807 13283 back track 1.8v
6e 110 16690 15152 18360 vl fwd 2.2v
84 132 23610 21488 25949 vl back 2.6v
9a 154 33545 30430 37053 front/back 3.0v
af 175 48125 43233 53811 middle 3.4v
Using 5v supply and a 22k pull-up.
|
Top
|
|
|
|
#96117 - 30/05/2002 04:51
Re: Sony stalk interface
[Re: tfabris]
|
carpal tunnel
Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
|
The tuner sends raw values to the player, which interprets the codes.
The values need to settle (we wait for a certain number of readings in the same ballpark before transmitting to the player) though, this is configurable but shouldn't need to be tweaked. There is a 22k pullup in the tuner module, so it should be fine.
Hijack should be able to remap these to sony values.
Hugo
|
Top
|
|
|
|
#96118 - 31/05/2002 02:05
Re: Sony stalk interface
[Re: altman]
|
stranger
Registered: 12/04/2002
Posts: 35
|
Your right (of course you should be!). I pulled the sled out of the car which allowed me to work on it in the house and gave me the oppertunity to put a pot/switch on the stalk interface and play. The PIC does return values in the range of 0x00-0xff for valuse of 0-5v on the input to the A/D convertor.
Since the Jeep steering wheel switchs have low values compaired to the sony interface (mostly below 1k) , I replaced the 22K resistor in the tuner module with a 2.4K one. This should provide levels in the range of 0.1-2.8V. I have yet to test this but it shoulod work.
|
Top
|
|
|
|
#96119 - 31/05/2002 05:25
Re: Sony stalk interface
[Re: snowwhite]
|
stranger
Registered: 12/04/2002
Posts: 35
|
*!$"!!!!!
It still does not work, with a meter on the stalk and having replaced the 22k pull-up with a 2.4K resistor I can read the following voltages, 2.7v,1.62v,1v,427mV,251mV and 32mV. But only the 2.7V and 32mV settings are generating stalk packets - yet last night with the Empeg on the bench and using a test rig, it worked great.
I'm getting very !"££$" off.
|
Top
|
|
|
|
#96120 - 31/05/2002 05:42
Re: Sony stalk interface
[Re: snowwhite]
|
carpal tunnel
Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
|
If the tuner is not sending back a packet, it means that the value is "wobbling" too much (ie, too much noise) - it doesn't settle.
There are 2 parameters which define when the tuner will send a stalk command to the host: "fuzz" and "loops". The value has to be stable, +/- "fuzz" for "loops" trips round the main loop before it gets sent.
Defaults (not changed by the player s/w) are: fuzz=2 loops=100
You can set these with a command to the tuner: 0x01 0x08 <fuzz> <loops> - you should get a reply 0x01 0x08 0x00 0x08. Try, for example, fuzz=5 loops=100. Reducing loops is probably a bad idea as this gives some form of debouncing.
Obviously, you need to be sure that the values are spaced well enough that it'll work given the fuzz you're using.
The values can be sent over serial from the shell using /bin/echo (not the built-in as ISTR it doesn't support -e) with something like:
stty raw 38400 </dev/ttyS1 (I think it's S1, can't check atm)
/bin/echo -e -n \\001\\010\\005\\144 >/dev/ttyS1
...but remember when the display goes off the tuner loses power and so will loose these settings.
Hugo
|
Top
|
|
|
|
#96121 - 31/05/2002 05:50
Re: Sony stalk interface
[Re: altman]
|
stranger
Registered: 12/04/2002
Posts: 35
|
Thanks for the quick response, it saved some of my hair :-)
Before I take the s/w route I'll try adding a capacitor to make an RC network (filter) to the circuit and see if that helps.
|
Top
|
|
|
|
#96122 - 31/05/2002 12:48
Re: Sony stalk interface
[Re: altman]
|
stranger
Registered: 12/04/2002
Posts: 35
|
Thanks again, putting a 1uF cap between the input and ground worked. I now get packets as expected, in fact it works so well I wonder if I had to change the 22K resistor after all.
Still, looks like I'm sorted <yahoooo>
Well at least until I look at the hijack ir_translation table ;-)
|
Top
|
|
|
|
|
|