Yes there is a problem.
Potentially, if they don't switch at the same time, then pin.A (which has gone High) is now feeding a high current into pin.B (which is still Low).
Ideally you need a series Diode on each PIC pin, but that would drop between 0.6 and 0.7v.
An alternative if you are SOURCING the Relay (ie pins go HIGH to trigger it), then OFF would be High-Impedance input, and ON would be Output High eg...
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
If you're SINKING the relay rather than SOURCING it, then change the two HIGH statements to LOW.
Bookmarks