Sometimes, it is necessary to use analogue pins in the PIC micro- controller for Digital I/O. PORTA and TRISA registers of the PIC microcontroller are normally congured for Analogue input function, to congure them for digital output, rst set the TRISA register for output. To congure for digital input, the TRISA register should be set for input.
Then the ADCON1 bit3-0 (PCFG3:PCFG0) should be set to 011X as indicated in Table 1. ADCON1 < 3 : 0 > are A/D Port Configuration Control bits.
This is given by the following two lines of code:
No comments:
Post a Comment