# Error in making pins input in PIC32

I am trying to make some pins act as input in PIC32MX795F512L.

I am doing like this

TRISEbits.TRISE9 = 1
TRISBbits.TRISB5 = 1
TRISCbits.TRISC13 = 1


So I making above pins as input. But when I debug my code, all the pins of PORTE are acting as input whereas I have only made PINE9 input. Same is happening with other PORTS.

What could be the reason for this.?

Also I want to know that what is the default status of PIN(input or ouput), when we don't make it input or output.? I am really confused at this point. Please help.?

• I don't know about PIC32 but for 8-bit PICs the default port state is is always input. The datasheet should tell you. – Roger Rowland Nov 18 '15 at 7:53

This is covered in the first paragraph of the I/O section of the datasheet.

I can understand if you are new to this, so I'll give you the benefit of the doubt but the datasheet will nearly have every answer to any question you have about the device. What the defaults are, how to control it, what the features are, how to enable or disable a feature etc. Yes, the datasheet is big, and some can be well into a 1000 or more pages. So you are going to have to learn to do some reading and spend your own time investigating.