Thank you very much for your answers. The problem solved by itself and I was able to debug my program and go further with the development. Now I have another problem: a 4x5 matrix keyboard is interfaced to ports A0-A4 (the rows) and when I energize column 5 (A4) on the PIC 16F628, the keys from the 5th row won't read... I've read on the datasheet that pin RA4 is open drain, unlike the other RA pins, which are CMOS. I don't know the differences between those two, and if this is the cause of the row not functioning. I've debugged the program so I think the code is correct. Also the hardware... Could you please give an oppinion ? Thank you for your time. Lucian -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.