Quentin wrote: > Since it has somekind of analogue switching input, I would rather make > it a 4093 (Quad NAND with schmidt trigger). > OTOH, I am sure the function of the logic circuit can be done in > software in the PIC. Just limit your input voltage level. Actually, no it can't. I've seen this design before -- it's a frequency counter. The problem is that you can't read the residual count in the timer prescaler directly in software. In order to determine its value, you need this external gate, wired as a 2:1 multiplexer, to feed in extra pulses until the main timer register ticks over one more count, then you can infer what value the prescaler had in it at the end of the measurement interval. -- Dave Tweed -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu