It works now but 12F683 still gets hot, I also noticed it flashes the
power power light on the old controller after 15 seconds.
but relay is still up seems like it takes 2 cycles to release relay.
Then 12F683 starts getting really hot.
I put the 10K resistor in not really sure on how to do the math on the
transistor.
any ideas?
Thanks
Larryd
'************************************************* ***************
'* Name : RelayHold.BAS *
'* Target PIC : PIC12F683 *
'* Oscillator : 4MHz internal *
'* Description : Pull Relay and Hold 15 seconds *
'************************************************* ***************
RstRELAY Var GPIO.2 ' Alias GPIO.2 Go High To Pull Relay
RESETME Var GPIO.4 ' Alias GPIO.4 to Wait For Pin-3 to Go High From Old Controller
STAT Var GPIO.5 ' Alias GPIO.5 Go High show LED Relay Active
ANSEL = 0 ' Set all digital
CMCON0 = 7 ' Analog comparators off
TRISIO =%00011000
low STAT
low RstRELAY
mainloop:
If RESETME = 1 Then ' PIC Requesting Reset
gosub ReSet_Ctrllr
Endif
Goto mainloop ' Do it forever
End
ReSet_Ctrllr:
High RstRELAY ' Turn on Relay connected to GPIO.0
High STAT ' Turn On LED If Present
PAUSE 15000 ' Hold Relay High for 15 seconds
low RstRELAY ' Turn Off Relay connected to GPIO.0
low STAT ' Turn Off LED If Present
PAUSE 20000 '50000 'Give Controller Chance to Recover Pause about a minute
return
Bookmarks