Hi again
Thanks a lot for the reply and to all,

I use the pic16f876, PortB outputs an LCD pins 0 to 5, pulse out are on 6 and 7.
PORTA.0 input where a button with a 10 K pull up resistor connected.
No master clear connection.

But even with or without pull ups or master clears nothing changes. I think I have to learn how to activate or disable internal pullups too.

I'll consider your remarks and try them out and come back later.

Regards

Alfonso