You don't need a comparator to do what Antonio suggests, but we sure aren't talking ten bits. But for that zero component count, el cheapo resistive a/d, like to read a user input knob with a '54 or something: The BASIC Stamp's POT routine uses the schmitt trigger inputs as the 'comparator.' Hook unknown resistor to i/o pin, other end through 0.1uf to ground. Charges cap for some max time, then goes into a loop in which the pin is pulsed output low, then set to input and checked for low, if not increment counter and do again. Some people improve accuracy with an extra i/o line with a precision resistor to calibrate/compensate for mfr and temp variations in the cap. ---------- Bruce Cannon Style Management Systems Remember: electronics is changing your world...for good! ---------- From: Antonio Vilches To: PICLIST@MITVMA.MIT.EDU Subject: Re: Req:Hardware design Suggestions Date: Tuesday, July 29, 1997 3:18 AM A2D: Try using a simple RC network feeding the noninverting port of a comparator and the analogue signal feeding the inverting port. -Ensure RC is discharged. -Apply 5v (1 on the selected port pin) -Start internal counter. -Stop counter (software polling or interrupt) when the comparator's output is high (detected by another port pin). -Shift the byte into EEPROM memory (use something like Microchip's 24c65 - they even provide the I2C routines on the web pages). I have built a 6 channel data logger using this system - and still have one port pin to spare! Antonio.~~ NB. The RC response becomes nonlinear after about 1.5V - limit your input voltage to 0-1.5v. > >On Tue 29 Jul, Glen Fry wrote: >> >> Hi, >> >> I'm about to start designing a small system that is to provide reasonably >> accurate temp control, drive a 2x16 or 2x20 lcd and handle12 inputs and 10 >> outputs. >> >> I'm probably going to use a `74 for the job. >> I'm looking to those of you that have experience with these these things for >> advice. >> >> 1. I need to store temp setting and some other data in NV memory. I require >> about 128 Bytes. May be written to once or twice a day. Can I use the EEProm >> in the 74 for this? > >There is no EEPROM in the'74, so you'd have to use an external device >(I2C preferred since it may share the bus with the ADC) > >> 2. I need a cheap but reliable 10 bit A/D with IIC. (dosen't every one?) > >Hmmm, I've been looking for I2C ADCs and have been unlucky so far. Instead >I found the MAX186, which is 12 bits, with 8 channel MUX and internal 4.096V >reference. Unfortunately, it requires 4 pins to drive it. > >> 3. Is it efficient to drive the LCD from the serial port or is 4 bits on a >> parallel port the best way? > >Assuming that you know the speed of the PIC and the LCD, you don't even need >a busy-feedback fromn the LCD. In that case, all you need is 6 I/O pins >(four for data, one register select and one enable pulse), and some software >delay loops to make sure you wait for the LCD to finish executing commands. >You can find timings in the LCD controller datasheet, or simply test them >yourself in the lab, and then (for the production run) *multiply all time >constants by two* just to make sure that it continues to work over temperature >variations. > >Frank > >---------------------------------------------------------------------- -- >Frank A. Vorstenbosch Phone: +44-181-636 3391 >Electronics & Software Engineer or: +44-181-636 3000 >Eidos Technologies Ltd., Wimbledon, London Mobile: +44-976-430 569 > ---------------- Hasta aqum el texto original ---------------- ----------