Input/Output initialisation on PIC chips with A/D convertors.

Problem:
Some PIC chips, that have A/D convertors built into them, initialise with the pins in analogue mode. This means that the input/output initialisation has ne effect on these pins.

Solution:
In order to ensure that port pins are initialised into digital mode, write the value of seven (7) to register 1F of register bank 1.

BSF 3, 5 ;Go to register bank 1
MOVLW 0x07
MOVWF 0x1F
BCF 3, 5 ;Go back to register bank 0


See also:
Clarification of Input/Output


Further information:
I hope that this page helps you with your projects but if you have found any other problems or if you have any further questions please contact me though the email address of gares-AT-g4aym-DOT-org-DOT-uk.

Sorry about the email address but it seems to be the only way to avoid the spammers



Click here to return to the PIC Basics Main Page

Click here for the Index of Errors and Ommissions