So I need to send out 3 voltages down a wire from my arduino. 3.3, 2.2 and Gnd. Gnd is basiclly the inactive state while 3.3. is high and 2.2. is low. I also have another wire that is 3.7, and 5v. 5v is the easy part. I don't want to use a whole lot of parts, and my local stores don't stock much of anything except an LED. So I just have a bunch of old diodes, resistors and capacitors at the moment.
So I know how to get a pin to push out 3.3. or 3.7v, I just don't know how to get it to go low at 2.2 and then make it gnd out also.
If it helps, I already have a voltage divider giving me 2.2 volts thats powering 3 pins on a LM339.
I would use a 4051 analogue switch. Feed the inputs with the correct voltages derived from potential dividers and then just select the required input with a couple of digital output lines.
You don't say what sort of impedance you need so that might not be the best solution for you, but it is simple to implement.
I think this can be done with a combination of 2 output pins and some resistors - one pin to switch a resistor that shifts the level from 3.3 to 2.2 of the main resistor divider. The other pin is directly connected to the output and set to output LOW, and switch it using pinMode() to go from grounded to hi-impedance. 3 resistors, 2 pins...
So would a TS3A5017 work? Like this one from sparkfun?
The on/off time is 5ns, and since I'm dealing with signal up time being 2.4 us, I think this would work. It has a max of 4.6 v, but I'm assuming from the datasheet since the arduino gives 40ma, and the clamp current is 50ma, i can give it 5v and it won't kill the chip, since the datasheet says,
"The input and output voltage ratings may be exceeded if the input and output clamp-current ratings are observed.".
My other option is to hope my radio shack has a chip in the 1 sqft it has its electronic components in .
Also the price is massive. A 4051 will cost you about $0.40.
So you can't run it from 5V it is designed to run from 3V to 3V6. You need to power it from the few mV of the 3V3 output. The absolute maximum is 4V6 so you can't run it anywhere that high. That means you have to scale back the signals from the arduino that do the switching. So while you can use it, it's far from ideal.
You are relying on the logic output to be a constant voltage when high. please look at the data sheet.
Yes I am, because I've read the ATmega electrical specs, its got high current CMOS output drivers with Ron of around 45ohm at 5V supply and around 60ohm at 3.3V supply, judging from the DC parameters. That's low enough for this application. Have you read the sections of Art of Electronics on interfacing digital to analog circuitry then?