Juan, To identify one out of 128 SW's might be possible with a matrix structure. I have seen it used in several keypads. Make a structure with rows and colums with the SW's at their intersections. By selecting one colum at the time and reading the rows. One can identify wich SW's are open or closed. There might be a few problems with this in your application. 1 the amount of inputs and outputs needed you probebly need some extra latches 2 the polling part you probebly want an interrupt first and then start polling this might work by selecting all colums and or-ing the rows for the interrupt greetings, Paul Paul E. Kamphuis Wilhelminastraat 9 5121 WR Rijen 0161-222362