> > > My standard for this type of work requires a bit more hardware but is > > cheap and easy to implement. I got this from Steve Ciarcia when he was > > writing for BYTE. Used it in his Intelligent Serial EPROM programmer. > > > > Basic Setup: An LM317 variable regulator is designed so that the output > > is 1.25V above the voltage of the adjust pin. So by simply switching the > > voltage on the adjust pin, the output voltage changes. > > > By using multiple resistors and an Open Collector switch to ground it's > > easy to change which resistor is used for generating the adjust voltage > > (and therefore the output voltage). An example: > > Unfortunately, this one does not failsafe if your ground-sinks go > open-circuit (e.g. PIC goes into reset). Instead, the voltage may float > up and away. You're right John. I forgot that detail. I usually need 0V so what I do is have reset latch the 0V system (which grounds ADJ and pulls down the current limited output). With a PIC I use two 7406 OS inverters with their inputs connected to the PIC I/O line with a pullup. So when the PIC resets, both the inverters drive to 0V, the ADJ pin goes to 0V (with a 1.25V output) and the current limited output is driven to zero. In this case with only two voltages I'd probably just connect the inputs of the OC switches to opposite sides of an inverter. Then one PIC output would select the voltage and it could only be one voltage or the other. Thanks for pointing this out. BAJ [John's most excellent circuit deleted for brevity] This circuit would be great if you needed many voltages. I wonder how well it works with the 4060 based PWM generator that was discussed here.