Hi, I find at the first look only one point may be bogus: obviously, you intend to set the TRIS registers in the setup routine; however, you set bits BEFORE you switch to bank1. Does not make any sense for me... Regards, Imre