Or use a PIC with A/D inputs. With a full scale range of 0..5V you'll have about 50 counts at 0.5V. Treat anything over 25 counts as a '1'. More than enough room. You could even use a lower reference voltage and get a bigger swing. Bob Ammerman RAm Systems ----- Original Message ----- From: "Byron A Jeff" To: Sent: Monday, March 10, 2003 8:57 PM Subject: Re: [PIC]: Voltage to bytes conversion > On Mon, Mar 10, 2003 at 11:37:48PM +0000, Laura Adamson wrote: > > I chose the PIC16c84 because it was the chip that uni had the most > > information on, other than that there is no reason for using that particualr > > chip. > > > > Understood. We have a lot of reasons why you should consider upgrading. > I've summarized them here: > > http://www.finitesite.com/d3jsys/16F628.html > > All of the arguments listed apply to the 16F87X, 12F675/12F629, and the > 16F676 familes of parts. > > > The voltages will be between 0v and 0.5v. > > There will be up to 8 inputs. > > I need the outputted byte stream to tell the PC which input source it is > > looking at and whether it is high or low, for each of the sources in turn, > > running in a loop. E.g. 0011 would mean source 1 is high and 0100 would mean > > source 2 is low. > > A raw PIC won't be able to discern 0V and 0.5V. So you'll need a voltage > multiplier, or an external comparator to differentiate. Something like a > couple of LM339 quad comparators should do the trick. Attach to PORTB, turn > on the weak pullups. Generate a 0.25V reference voltage using a couple of > precision resistors, and off you go. > > BAJ > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.