![Trisd mplab xc8](https://kumkoniak.com/104.jpg)
![trisd mplab xc8 trisd mplab xc8](https://nvtienanh.info/static/4a7fbd947a3288f11bf4bf1c58cbe3b6/62826/010116_1312_MPLABXC8Lp1.jpg)
Reading a pin that is set to analog mode will return a '0'. AN0 will also be in analog mode (RA0 disabled). For example, if you make ANSEL equal to 0b10000001 (binary), then AN7 will be enabled and RC3 will be disabled because they share the same pin (pin 7). A '0' sets the pin to digital mode and a '1' sets the pin to analog mode. Each bit in the register controls one pin as outlined in the register tables shown below. The two registers ANSEL and ANSELH control whether or not AN0 through AN11 are operational. This is because it can serve as digital I/O port RA4, or analog input pin AN3. If you look at the pin diagram you will see that pin 3 is called RA4/AN3. There are several registers that affect the operation of the digital I/O pins.
![trisd mplab xc8 trisd mplab xc8](https://pic-microcontroller.com/wp-content/uploads/2018/05/mplabx_large13.jpg)
That is because pins can serve more than one purpose and it is up to the designer to decide how each pin is configured. You will notice that some pins have more than one name. To the right is a pin diagram of the PIC16F690.
![Trisd mplab xc8](https://kumkoniak.com/104.jpg)