PDA

View Full Version : Using port A on the 16F73



srob
- 29th September 2007, 00:30
I have a display project that uses a 16F73, and I need to add a GPS reciever and status LED. However the only availible ports are RB7, RA1 and RA3. Unfortunatly RA0 is used as an analogue input while RA2,4 and 5 are digital input so the ADCON1=4, which also set RA1 and RA3 to analogue as well.

I was going to put the GPS reciever on RB7 and was wondering if it is possible to toggle the ADCON registor within the programme so that when I need to get the voltage on RA0, I can set it to analogue and then set it back to digital straight after, e.g.

ADCON1 = 7 'port a digital
...
high porta.1 'turn on status LED
....
ADC: ADCON1=4 'RA0 analogue
ADCin 0,volt 'get voltage
ADCON1=7 'Port A digital again
RETURN

Thanks

mat janssen
- 29th September 2007, 09:47
Yes, you can do that.