At 02:37 PM 1/4/01 -0500, Olin Lathrop wrote: > > >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). > > > > Do you have a resistor between RA4 and the base? If not, > > put one in. > >And why should that help? If it is open drain, then he should be able to >connect the base of the NPN directly to the pin because the current into the >base can only come from the pullup resistor. Adding an additional series >resistor has no advantage and will slow down the response. Because of the Read-Modify-Write problem. The logic level at pin RA4 will never go above 0.7Vdc which reads as a logic LO under all cases. Lets say that you did a "bsf RA4" and then did *ANY* R-M-W operation to port RA. Voila! Pin RA4 is now a logic LO. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 16 years of Engineering Innovation (1984 - 2000) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.