My means is No use IC to do it! only use the diodes to do it? but I don't know how to connected it? There are two different ways that I know of. 1) You would use a 16-to-4 line encoder IC. The output would be binary encoded to a single key but is the simplest if you don't need to look at more than one key at a time. 2) if you need to look a more than one key at a time, use a 16 input shift register (port expander). Cycle thru all 16 inputs (one at a time) and see which bits are set. Disadvantage to this is the time it takes to cycle thru all 16 inputs. Not good for fast moving signals. Wing Kent Kwan wrote: > how can I only uses 5 cpu I/O pin for 16 keyborad keys input? > THANK!!!!!!! On Sat, Mar 25, 2000 at 10:47:41PM +0800, Wing Kent Kwan wrote: > how can I only uses 5 cpu I/O pin for 16 keyborad keys input? > THANK!!!!!!! --------- | OUT1-- Q0--- | | OUT2-- DECODER ... |MATRIX 8-OUTS |OF OUT3-- Q7--- |SWITCHES ---------- | |(8 rows, 2 columns) IN1-------------------| | IN2-------------------| -- HTH Wojciech Zabolotny http://www.ise.pw.edu.pl/~wzab http://www.debian.org Linux - free OS for free people! Three pins to a hc138 demux each pin of the 138 to two buttons on two data lines 16 buttons and 16 diodes three outputs two inputs 5 i/o pins Easy........... Cheers Steve........ Ps you can do it with less if use shiftt registers...... David VanHorn wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > >> Does anyone of you knows how to measure the phone line > >> impedance? > > Sure, build an impedance bridge. Two known resistances, precisely matched, > a variable, and the unknown. Feed a tone in across the bridge, measure the > imbalance, tune the variable to minimize the imbalance, measure the > variable, that's your impedance. > > Doing this on a live line presents some special considerations. You might > be better to get the spec, and design to that. > > >> I have a voice multiplexer project and I interface to > >> Private Automatic Branch Exchange. I can't balance the > >> transmit and receive gain of my system. I suspect it > >> depends on the phone line length and impedance. > > It probably does. Or more precisely, your return loss depends on how well > you match your impedance to the line. > > I'm guessing the PI phone system uses US standards, which would be 600 ohms > nominal, with some reactance, but I forget. It's been a few years since I > dealt with this. > > If you have a flexible hybrid design, a microcontroller, and a way to > measure signal levels, then you can have the system calibrate itself by > injecting a tone on the transmit side of the hybrid, and measuring the > level on the receive side of the hybrid, then tune a digital pot for > maximum return loss. You should only have to do this once. It's certainly > not something you want to do on every call! > > -----BEGIN PGP SIGNATURE----- > Version: PGPfreeware 6.5.2 for non-commercial use > > iQA/AwUBON0QBoFlGDz1l6VWEQInTwCdH30iErdKZgvI9cj55qVPoaqo0dcAoLqH > OHkJNBtPld3fKgK/BQeKiSnc > =C4pw > -----END PGP SIGNATURE-----