Hi, Ioannis

And what about your I/O "defines" ( TRISB = ??? ) did you declare the input and output pins ???

Or use individual "HIGH" 's .or "LOW" 's..

Just an idea ...

Alain