PDA

View Full Version : PortA digita input?



MOUNTAIN747
- 27th January 2009, 01:07
I am working on a home project which I would like to use a 16F873A to control a TIP120 Darlington to drive a relay coil. I first check a PortC pin for high or low. If high, I need to read an encoder to select a time delay before triggering the relay.

I would like to Check for high or low on PortC, read the two bit encoder which will have some value continuously on PortA, display time delay value on PortB, and drive the TIP120 on PortC. As I read about PortA I have some concerns using PortA as digital inputs. Question; using PBP should I set ADCON1= %00000111, TRISA=%11111111. There is a note in the mid range manual that says I may have a high current on pins on PortA as I read the value of the port. Do I have a problem using PortA as digital input?
TRISB=%00000000
TRISC=%11110000
Will PBP handle my concerns?
Comments will be appreciated.

Archangel
- 27th January 2009, 05:57
Question; using PBP should I set ADCON1= %00000111ADCON1 =6 or 7 ok

TRISA=%11111111. There is a note in the mid range manual that says I may have a high current on pins on PortA as I read the value of the port. Do I have a problem using PortA as digital input?NO, as set all port a inputs.

TRISB=%00000000
TRISC=%11110000
Will PBP handle my concerns?
Comments will be appreciated.
Ok, all port b outputs upper half of PortC as inputs,
set ADCON0=0 , CMCON=7 , and remember RA4 is open drain and requires a pullup resistor.

MOUNTAIN747
- 27th January 2009, 21:55
It looks like I'm good to go. Also thanks for mentioning ADCON0 and CMCON, I wasn't sure about that.
Thanks Joe