>> >>The "proper" approach would be pull-ups on the output lines. >>But that's extra parts, and equal in parts count to your >>approach of series resistors in the output lines. > > Or use PORTB with it's internal pullups. > I agree that we should be able to do it with no external resistors. If we drive the cols and read the rows, the cols could have the latch register holding 0x00 and TRIS holding 0xff. As each col is to be driven the appropriate bit of the TRIS would be set low, causing that col output to be pulled low. We'd then read the row on a portb input with internal pull-up. If a key is down, we detect the row of the key on portb and the col based on which TRIS bit we set low. If multiple keys are down, we could have trouble figuring out which ones they are, but could throw out multiple keys as invalid. Also, if keys in a couple cols are low, the use of TRIS prevents us from getting an output high to output low short. Of course we DO have floating inputs on the col lines that are not being pulsed low at the time, but I expect that with a typical scan rate the lines would tend to stay low based on their last being driven low. This should prevent excess power dissipation due to an intermediate level on a PIC digital input. So, use of TRIS to simulate an open drain output (pull low, but not pull high) is interesting. Harold -- FCC Rules Updated Daily at http://www.hallikainen.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist