There is a digital chip called a 'priority encoder' which will take 2**N digital inputs and return an N bit code identifying which is the 'highest priority' one that is active (or a special output if none is active). The 74LS348 (I assume an HC equivalent exists) takes 8 active low inputs and encodes them to 3 outputs. The chips support cascading so you can build a network of them that will directly decode your 50 input lines to a 6-bit binary number. The first level of the network contains 7 chips which provide 56 inputs. You only use 50 of them. The second level of the network contains 1 more chip, the inputs of which are connected to cascade outputs from the first level chips. The first level chips provide the low-order 3 bits of the resulting binary value. The second level chip providews the high-order 3 bits of the 6-bit value. You can then use that 6-bit binary number to drive a D/A chip. No PIC needed. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: "Douglas Butler" To: Sent: Thursday, August 30, 2001 9:07 AM Subject: Re: PIC UNUSUAL D/A APPLICATION > My first thought would not be to use a processor at all. I would run > the 50 inputs to 50 open collector buffers pulling down a resistor > network. Something like a R2R network but it might be simpler as you > don't have to distinguish when multiple lines are low together. Finally > use an op amp to buffer and filter the output. > > Sherpa Doug > > > -----Original Message----- > > From: tim [mailto:stm800@CITY-NET.COM] > > Sent: Wednesday, August 29, 2001 8:37 PM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: PIC UNUSUAL D/A APPLICATION > > > > > > 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 > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads