PDA

View Full Version : PIC16F877A PORTA.2 not working



The Master
- 10th October 2009, 15:38
Hi, I think i know the answer to this one but i want to double check. Ive got PORTA.2 connected to a transistor but it never turns on. Im pretty sure my settings are correct.



'Chip settings
ADCON0=0
ADCON1=0
CMCON=7
CVRCON=0
CCP1CON=0


All special operations on that pin should be disabled. When i put my finger under the transistor the LEDs turn on so i know the transistor is working. When the PIC is connected they even flash. It seems like the PIC is turning that output on and off correctly but it doesnt actually go high. It seems to switch between low and floating.

Is the chip supposed to do this or is this one broken? Will it be fine to add something like a 100K pull up resistor? (I think that might solve this problem)

Darrel Taylor
- 10th October 2009, 18:03
For an 877A, you only need one of those lines, but with a different value.

ADCON1 = 7

CMCON=7 ; already 7 on power-up
ADCON0=0 ; already 0 on power-up
CVRCON=0 ; already 0 on power-up
CCP1CON=0 ; already 0 on power-up

The Master
- 10th October 2009, 18:16
Thanks, Ill try that.

Im going to leave the other lines there because last year im sure i had to add 2 lines to get it to work properly but i cant remember which 2.