What about expand the inputs via a I2C device? What about this: http://www.semiconductors.philips.com/acrobat/datasheets/PCF8575_3.pdf (16-bit) it can make a interrupt for you also when a key is pressed = (change of state on input pin)! Or: = http://www.semiconductors.philips.com/acrobat/datasheets/PCF8574_2.pdf (8-bit) Best regards Ole Andreas Gl=F8ersen LA9SHA -----Opprinnelig melding----- Fra: Bala Chandar [mailto:Bala.Chandar@AVENTIS.COM] Sendt: 10. desember 2001 12:12 Til: PICLIST@MITVMA.MIT.EDU Emne: Re: [EE]: Which is the ideal IC? In my circuit, I am using all the 8 pins of Port B and pin 6 of Port A = as inputs to detect the closing of 9 PB switches. The PIC used is 16F628 = with internal RC Oscillator. Port B weak pull-up is enabled and PortA.6 has = a 4.7K pull-up resistor. As I am running short of I/O pins, I want to use an IC to reduce the = number of pins used by the PIC for detecting key pressings. After a search = through CMOS data book, I found 74HC147 (10 to 4 Priority Encoder) almost ideal = for the purpose. With this IC, I will need only 4 pins of the PIC and as = many as 5 pins will become available. Now, my question: Is there a better IC for the purpose? Please let me know if there is. Thanks & Regards, Bala -- 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.