Trying to build small power reset circuit using a PIC12f683.
When GPIO.1 goes high, I set GPIO.0 high to MPS2222
Transistor to make the circuit. Trouble is GPIO.0
dosen't go low, or if it does it's only for a MS, then goes high again.
and PIC12F683 starts to get hot.
Code:
'************************************************* ***************
'* Name : RelayHold.BAS *
'* Description : Pull Relay and Hold 15 seconds *
'************************************************* ***************
PRELAY Var GPIO.0 'Pull Relay turn off power to old controller 15 seconds
RESETME Var GPIO.1 'GPIO.1 to Wait For 1 to Go High From Old Controller
STAT Var GPIO.4 'Alias GPIO.4 to Turn on LED while relay is on
ANSEL = 0 'Set all digital
CMCON0 = 7 'Analog comparators off
TRISIO =101110 'Set Pin I or O
low STAT
low PRELAY
mainloop:
If RESETME = 1 Then 'PIC Requesting Reset
gosub ReSet_Ctrllr
Endif
Goto mainloop ' Do it forever
End
ReSet_Ctrllr:
High PRELAY 'Turn on Relay connected to GPIO.0 to power cycle old controller
High STAT 'Turn On LED If Present
PAUSE 15000 'Hold Relay High for 15 seconds
low PRELAY 'Turn Off Relay connected to GPIO.0
low STAT 'Turn Off LED If Present
PAUSE 50000 '50000 ' Give Old Controller Chance to Recover Pause about a minute
return
See attached drawing for details.
Thanks in advanced,
Larryd
Bookmarks