Datasheet...

Section 10... let's look at this Port by Port...

PortA

Look at Table 10-2... immediately you can see you need to Disable Comparators, Voltage Reference Module and ADC's...

Jump to Comparator Module, see Register 20-1 and Figure 20-1 from those you can determine to knock-out the Comparators you don't need...

CMCON=%00000111

The Comparator has a Voltage Reference Module... jump to Register 21-1 and make sure it's OFF...

CRVCON=%00000000

Next, kill the ADC's...

Section 19 for ADC's, Register 19-1...

ADCON0=%00000000

and Register 19-2 make your selection from the table...

ADCON1=%00001111

All you're left with is configuring TRISA for your I/O application...

Now go back to Section 10 for...

PortB

Table 10-4 tells you ADC's affect this Port, but you've probably killed them with the ADCON statements you did above at PortA.

PortC

Table 10-6 tells us PortC has no issues...

PortD

Table 10-8 tells us that PortD has PWM's and a Parallel Slave Port.

By default, PWM's don't affect us - but if you want to be safe...

ECCP1CON=%00000000

A look at PSPMODE bit 4 of TRISE (OK, I didn't build this chip, so don't moan at me for having to look in TRISE for a PORTD control Bit), at Section 10-5 TRISE Register 10-1 on Page 142 tells us you need this bit to be ZERO for General Purpose I/O...

TRISE.4=0

PortE

Table 10-10 tells us that Comparators and ADC's affect this Port. But, you've probably switched them off back above at PortA stage...

OK... is there a problem?

PS, please keep problems on the forum...