Dash Controls to Sony Deck Interface
s2kman,
That is exactly the problem I was having with discreet components. Basically I could hook up just the resistors and they would work, but once I added a NPN transistor that was always toggled ON, it wouldn't work. I then played around with the resistors and found out that with an NPN transistor in the loop, the resistance needed was WAY off from what I was using. I don't remember the exact numbers as I have it on paper in CA. But it was something like I needed 4 or 5 times the resistance (more or less, don't remember, it's been a while) for that same function to work. I of course did this through trial and error methods, nothing mathematical at all. What I was planning on doing was to use an analog switch like the 74HC4066.
So we're both at the same roadblock.
David
That is exactly the problem I was having with discreet components. Basically I could hook up just the resistors and they would work, but once I added a NPN transistor that was always toggled ON, it wouldn't work. I then played around with the resistors and found out that with an NPN transistor in the loop, the resistance needed was WAY off from what I was using. I don't remember the exact numbers as I have it on paper in CA. But it was something like I needed 4 or 5 times the resistance (more or less, don't remember, it's been a while) for that same function to work. I of course did this through trial and error methods, nothing mathematical at all. What I was planning on doing was to use an analog switch like the 74HC4066.
So we're both at the same roadblock.

David
S2kMan,
The solid-state relays work really well, and it would solve two problems...it would allow the pot to settle (what I think the problem is), and would allow your code to disconnect the deck automatically for it's calibration code. I'm sure the pot is taking its own sweet time coming out of sleep mode, so probably what's happening is the deck sees some high resistance that starts to sweep down towards some lower resistance. Ever tried to press two buttons at once on calculators? They usually do one of two things...continue inputting the button that was pressed a few milliseconds earlier than the second, or refuse to take either button's input. No simple way to tell which the deck is doing in this case, but either way, it spells "I WON'T WORK!"
The solid-state relays work really well, and it would solve two problems...it would allow the pot to settle (what I think the problem is), and would allow your code to disconnect the deck automatically for it's calibration code. I'm sure the pot is taking its own sweet time coming out of sleep mode, so probably what's happening is the deck sees some high resistance that starts to sweep down towards some lower resistance. Ever tried to press two buttons at once on calculators? They usually do one of two things...continue inputting the button that was pressed a few milliseconds earlier than the second, or refuse to take either button's input. No simple way to tell which the deck is doing in this case, but either way, it spells "I WON'T WORK!"
I wouldn't bother with a solid-state relay, they're usually designed for higher current switching and will cost more and be physically larger than you probably want.
You're better off with either a low on-resistance mosfet (if one side of the circuit is at gnd or Vcc) or an analog switch if both sides are "floating".
Do not use anything with a bi-polar output, as the junction voltage drop will screw up the resistance (it will change depending on current).
I had a similar problem with the silly keyless entry module on the stook, which requires a ground for the driver's door switch input. You can't fool it by using an NPN transistor switch to ground, because it needs to be closer than .6 volts to ground. I had to use a mosfet to activate it when I made my Convenience Module .
You're better off with either a low on-resistance mosfet (if one side of the circuit is at gnd or Vcc) or an analog switch if both sides are "floating".
Do not use anything with a bi-polar output, as the junction voltage drop will screw up the resistance (it will change depending on current).
I had a similar problem with the silly keyless entry module on the stook, which requires a ground for the driver's door switch input. You can't fool it by using an NPN transistor switch to ground, because it needs to be closer than .6 volts to ground. I had to use a mosfet to activate it when I made my Convenience Module .
I ordered three things from Digikey earlier today, a mosfet solid state switch, a miniature solid state relay, and a PCB mount miniature relay. All three are in DIP packages and are very small. The miniature relay actually looks like a pretty good option, it's rated at 5 million cycles and has a 3mS engage time. I guess the controls themselves use switches, so there is no big harm in putting one into the circuit if I have to. The relays were half the price of the solid state stuff. Hopefully I'll get it tommorow and test it.
Also MacGyver: I agree that what you described is probably what the problem is. It pretty much looks like the Deck reads one of the resistances before the Pot stabilizes, doesn't recognize it and then doesn't try any more until the thing resets. The relay/switch will solve that problem, but it won't be enough to allow self-calibration without some additional relays to hook up the calibration circuit to the Pot.
The calibration is based on using the pot in a calibration circuit which is basically that hooks up a 5 volt source to one terminal and a low tolerance (1%) resistor that goes to ground on the other. I would need one additional switch to hook these things up to the pot, assuming I can use the other pole of the first switch for one of them.
The way the calibration works is that I can count on the resistor value to be within 1% of stated, and I know the input voltage is 5 volts, I simply calculated the voltages that the Pot had to drop when it was at the right R value and then calculated the HEX values that the A/D should see when the pot is tuned for the R value I want. The micro starts the pot off at one end of the scale and then bumps it up, lets it stabilize and then reads the voltage. As soon as it exceeds it, it saves the Pot setting to EEPROM. It does this for each Sony R value and saves them all to EEPROM.
I've thought about running the calibration automatically but don't think it is a good idea. The EEPROM has a limited number of cycles, and it is conceiveable that I could wear it out if I write to it on a regular basis. I could read it at power on OK, but I'm not sure if that would help much. I might have it do a self test once in a while to SEE if it needs calibrated and then if it does, it would do it. I'm going to design the PCB with auto self-calibration in mind, but will test the circuit without the software implementation at first and see how it is. If there is a spot on the PCB to add whatever additional circuit I need, it won't be any big deal to solder on a couple of extra parts and update the software if it turns out to be unstable without it.
Also MacGyver: I agree that what you described is probably what the problem is. It pretty much looks like the Deck reads one of the resistances before the Pot stabilizes, doesn't recognize it and then doesn't try any more until the thing resets. The relay/switch will solve that problem, but it won't be enough to allow self-calibration without some additional relays to hook up the calibration circuit to the Pot.
The calibration is based on using the pot in a calibration circuit which is basically that hooks up a 5 volt source to one terminal and a low tolerance (1%) resistor that goes to ground on the other. I would need one additional switch to hook these things up to the pot, assuming I can use the other pole of the first switch for one of them.
The way the calibration works is that I can count on the resistor value to be within 1% of stated, and I know the input voltage is 5 volts, I simply calculated the voltages that the Pot had to drop when it was at the right R value and then calculated the HEX values that the A/D should see when the pot is tuned for the R value I want. The micro starts the pot off at one end of the scale and then bumps it up, lets it stabilize and then reads the voltage. As soon as it exceeds it, it saves the Pot setting to EEPROM. It does this for each Sony R value and saves them all to EEPROM.
I've thought about running the calibration automatically but don't think it is a good idea. The EEPROM has a limited number of cycles, and it is conceiveable that I could wear it out if I write to it on a regular basis. I could read it at power on OK, but I'm not sure if that would help much. I might have it do a self test once in a while to SEE if it needs calibrated and then if it does, it would do it. I'm going to design the PCB with auto self-calibration in mind, but will test the circuit without the software implementation at first and see how it is. If there is a spot on the PCB to add whatever additional circuit I need, it won't be any big deal to solder on a couple of extra parts and update the software if it turns out to be unstable without it.
Originally posted by modifry
I wouldn't bother with a solid-state relay, they're usually designed for higher current switching and will cost more and be physically larger than you probably want.
I wouldn't bother with a solid-state relay, they're usually designed for higher current switching and will cost more and be physically larger than you probably want.
OK! I've got good news tonight! My circuit now has full control of a Sony XR-C5120 cassette deck with a 10 disk CD changer attached! It is totally solid state, and I can now produce EVERY function that the remote commander can do, I have tested AND verified all of the following functions:
Power Off
Source/Power On
Mute On
Mute Off
Display (Toggles between clock/station/track)
Seek+/Track Up (radio/CD)
Seek-/Track Dn (radio/CD)
Preset Up/Disk Up (radio/CD)
Preset Dn/Disk Dn (radio/CD)
Vol Up
Vol Dn
Sound (Bass/Treb/Fad/Bal)
Mode (AM1/AM2/FM1/FM2/FM3)
I still have a little bit of programming to do to clean up some stuff and then starting next week I will be working with my electrical engineer friend and have him go over (and improve) the schematics After that is done, I'll create a prototype from the new schematics, temporarily install it in my S2000 and test it. Once we are confident that the circuit works well and is stable we'll move on to getting a PCB made.
For anyone interested in the technical details:
I received my parts from Digi-key today and tried them out. I tried the Standard relays in the DIP packages first, and that worked fine, although I could very faintly hear them click when they were switched. I then tried the cheaper of the two different types of MOS solid state relays I got. This one is digikey part # CLA103-ND. It is a 'Clare' OptoMos solid state switch. You get two normally open solid state switches in an 8 pin dip package for only $6.34 (OK so they aren't cheap) All you need is a current limiting resistor on the 'contacts' and you are all set I'm VERY happy to be able to get a solid state solution to work. It actually works VERY well. The total time to send a command to the sony deck is 54mS. I could probably shorten that if I wanted to, but it works really well the way it is. It was very exciting to see it controlling the deck! I'm anxious to get the circuit off of my breadboard and into my S!!!! This project has turned out to be WAY more work than I initially anticipated. I'm up to 1500 lines of code so far and I've still got some more to add. I'm sure it could be trimmed down to a smaller size, but that would take even more time, and I've got PLENTY of room in the chip. I'm just barely over 25% of capacity as it is.
Power Off
Source/Power On
Mute On
Mute Off
Display (Toggles between clock/station/track)
Seek+/Track Up (radio/CD)
Seek-/Track Dn (radio/CD)
Preset Up/Disk Up (radio/CD)
Preset Dn/Disk Dn (radio/CD)
Vol Up
Vol Dn
Sound (Bass/Treb/Fad/Bal)
Mode (AM1/AM2/FM1/FM2/FM3)
I still have a little bit of programming to do to clean up some stuff and then starting next week I will be working with my electrical engineer friend and have him go over (and improve) the schematics After that is done, I'll create a prototype from the new schematics, temporarily install it in my S2000 and test it. Once we are confident that the circuit works well and is stable we'll move on to getting a PCB made.
For anyone interested in the technical details:
I received my parts from Digi-key today and tried them out. I tried the Standard relays in the DIP packages first, and that worked fine, although I could very faintly hear them click when they were switched. I then tried the cheaper of the two different types of MOS solid state relays I got. This one is digikey part # CLA103-ND. It is a 'Clare' OptoMos solid state switch. You get two normally open solid state switches in an 8 pin dip package for only $6.34 (OK so they aren't cheap) All you need is a current limiting resistor on the 'contacts' and you are all set I'm VERY happy to be able to get a solid state solution to work. It actually works VERY well. The total time to send a command to the sony deck is 54mS. I could probably shorten that if I wanted to, but it works really well the way it is. It was very exciting to see it controlling the deck! I'm anxious to get the circuit off of my breadboard and into my S!!!! This project has turned out to be WAY more work than I initially anticipated. I'm up to 1500 lines of code so far and I've still got some more to add. I'm sure it could be trimmed down to a smaller size, but that would take even more time, and I've got PLENTY of room in the chip. I'm just barely over 25% of capacity as it is.




