Thursday, October 16, 2008

Open-Drain RA4 pin on PIC Microcontroller

I had a problem with RA4 pin which I cound not send '1' nor output 'high' to this pin. After some searches, I have found that RA4 pin (pin 3 for PIC16F627a) is "Open-Drain" type output pin. That means it cannot source current and it will be high impedance when assigned logic '1' to it. I cannot set this pin as an output pin by using 'TRISA=0x00'. The solution is attaching a pull up resistor (10K) to the RA4 pin in order to use this pin as an output pin.

RA4 Open Drain PIC16F627a


marian said...

thank you so much!I was in really big trouble before reading your article!

Ni@m said...

First of all thanks for the article! Actually it would be much better if you could configure each pin as open drain explicitly.