Quote Originally Posted by CuriousOne View Post
Well, troubles continue.

Also I found a strange thing - if I set TRISA=%00110010, which means to set LATA.2 as input, the code does not works at all, but it also stops consuming current on that pin. What can be the reason?
I think you have set porta.1 to input and not porta.2

This sets PORTA.2 as input
Code:
%00110100
Not sure about your other problems