Help Rqd - Driving 5Volt Relay using two pins
Hi
I have a 16F627A and a 5 volt relay DPST (OMRON G5V-1).
I can drive the the relay coil (167 ohms) ok using a single pin from the Pic.
However, the max current the I/O pin can source is 25ma, and the coil really needs 28ma. Could this burn out the PIC if left driving the relay too long?
I was hoping that I could parallel two I/O pins to drive the coil but when I do this, the relay does not throw at all.
Is there a problem when paralleling two Pic I/O pins together?
J
?????????????????????????????????????????????????
Quote:
Originally Posted by Melanie
RelayPinA var PortB.0
RelayPinB var PortB.7
' Example Toggles Relay One Second ON/OFF
' Don't forget the Back-emf Diode across the coil
' otherwise you'll damage the PIC
Loop:
TRISB.0=1
TRISB.7=1
Pause 1000
HIGH RelayPinA
HIGH RelayPinB
Pause 1000
Goto Loop
Hi, Mel
May be I'm a bit asleep ...but how does that achieve toggling an output ???
woudn'it be better to write : PORTB = PORTB ^ %10000001 , to have simultaneous toggling on B.0 and B.7 ?
Alain, back to sleep
Default start up state of the TRIS registers?
Hi Mel,
You are right in that I should have chosen a relay with a higher coil resistance... and for sure that is what I will do next time.
What is the default start up state of the TRIS registers? Wouldn't they have been designed to go High-Imedance for safety's sake and not pseudo random?
Surely the lab coats at Microchip thought this one through?!!