I' ve had the same problem with the dsPic33fj128mc706.
I' ve configured all analog inputs as digital I/O, and portB as input, but when I tried to read the B port it always returned zero. The strangest thing is when I write to the portB it looks like ok, but I can't read.
Someone knows what happen?8-O
---------- Post added at 13:59 ---------- Previous post was at 13:12 ----------
Problem solved!
In my case, the dsPic33fj128mc706 have two ADCs and both must be seted to digital I/O, like this:
AD1PCFGL = 0xFFFF;
AD2PCFGL = 0xFFFF;
That is it!