Specific analog pin to digital

Thread Starter

Omais Ahmed

Joined Oct 4, 2015
35
Hello Everyone,
How do I convert an Analog pin to digital? I'm using PIC18f4550.
I'm using ADCON1 register like ADCON1=0b00000111, which converts all PORTB's analog pins into digital.
but I have to convert only RB0 pin as digital pin.

Thanks in Advance
 

Thread Starter

Omais Ahmed

Joined Oct 4, 2015
35
I need a function that makes an analog pin to digital. whereas ADCON1=0b00000111 converts all pins to digital. I did not want to convert all pins as digital except the one that I want.
like:
short pin3=3;
func(&PORTB,pin3);
 
Top