Hi Tim, There are a bunch of methods to do want you want. The first task is to be able to detect the 50 inputs. You could use a big micro (lots of I/O) or mux them with shift regs, muxes, etc. I probably would use six (48 lines plus 2 for the micro to read directly) or seven (56 inputs) CD4021, as they are cheap and only require 3 lines to the processor. As far as making the voltage, you could then use the micro to drive a DAC (there are many), or for a cheap route out, make a DAC in software via PWM. There are lots of app notes on PWMs. Since you need 50 steps of voltage, a 7 bit DAC (128 steps) should be plenty. The PWM route; however, gives you about the rail voltage of the micro as the top voltage, so you would need to scale the output by using a simple resistor voltage divider. So if the micro ran on a stable 5 volt line, the highest output would be 5 volts (you can adjust the power supply voltage) then the voltage divider as 5:1 would give you a max 1 volt output. Each of the 7 bit steps would be approx 7.8 mv (1V / 128), so 3 steps would give you appx 23.4 mv. By reworking the number of bits (leaving one bit extra for easy stability) and the supply voltage, you should be able to get the voltage step size that you want. As far as the micro goes, use whatever you have and can write code for, you could do it with just 4 lines to the micro! - Mike tim wrote: > I have 50 seperate logic lines that switch in sequence from # 1 to # 50 then reverse from # 50 to # 1 > at any one time only one line is in a low state and all others are high state. what I need is an analog output > voltage generated from the pic in response to which switched line is enabled. > example: > > max reference voltage output is 1 volt at line 50 switched on. > half of the reference voltage is 500 mv at line 25 switched on. > each switched line represents a 20 mv change in output voltage. > > these parameters are not set in stone and the analog reference voltage could > change if it made code and chip selection easier. > > any thoughts on which pic chip to use as i have not bought any chips yet. > is there a simple mixed signal or d/a chip that will do this instead of using a pic chip? > it seems that this type of digital line switching (single line enabled only ) > to generate an analog voltage is really not what the D/A chips do that are > presently out there on the market. well as easy as this application seems to be > i want to ask before i begin re-inventing sliced bread.... > > thanks alot for reading this and all comments and suggestions welcome tims 800 > > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads