At 03:52 PM 1/4/01 -0200, RoDelta wrote: >Hi. >I tryed to use PIC16C621A, RA4 as output, open drain. I put a 10K resistor >to Vcc and the base of a npn transistor in RA4 to drive a relay (relay >conected on colector with diode self induction protection, and emitter to >zero). What's the beta (gain)of the transistor? You're putting 500uA roughly, into the base. A gain of 100 will give you 50mA collector current. If the relay takes more than that, you don't close. Measure the voltage across the relay coil, when it's supposed to be energized. Also, this is a CLASSIC for being bitten by BSF/BCF instructions. The voltage on the I/O pin will never get to a logic high, so any subsequent read-mod-write instruction will change that pin into a low output. You may need to shut the comparator off as well. I'm using RA4 here in an F627, but I'm turning off the comparator first. -- Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9 -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.