12.07.2015 Views

Electromechanical Timer Replacement - 320Volt

Electromechanical Timer Replacement - 320Volt

Electromechanical Timer Replacement - 320Volt

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Electromechanical</strong> <strong>Timer</strong> <strong>Replacement</strong>;ResetIn state = 0 handlerRstSt0 btfss GPIO,TMRRST ;is timer reset input high?goto RstEnd ;if no - stay in state 0incf rstDbnc ;if yes - move to state 1goto RstEnd ;go to RstEndRstSt1 btfss GPIO,TMRRST ;is timer reset input high?goto RstSt1a ;if no - go to RstSt1aincf rstDbnc ;if yes - move to state 2goto RstEnd ;go to RstEndRstSt1a clrf rstDbnc ;move back to state 0goto RstEnd ;go to RstEndRstSt2 btfsc GPIO,TMRRST ;is timer reset input low?goto RstEnd ;if no - go to RstEnd (stay in state 2)incf rstDbnc ;if yes - move to state 3goto RstEnd ;go to RstEndRstSt3 btfsc GPIO,TMRRST ;is timer reset input low?goto RstSt3a ;if no - go to RstSt3aclrf rstDbnc ;if yes - move to state 0goto RstEnd ;go to RstEndRstSt3a decf rstDbnc ;move back to state 2goto RstEnd ;go to RstEndRstEnd retlw 0 ;return from subroutine;;doSeqState;********************************************************;* doSeqState *;* This subroutine runs the main sequencer state *;* machine. It is called periodically by *;* the main program loop. *;********************************************************doSeqStatemovf mode,w ;get configuration mode valueaddwf PC ;add it to the program counter to jump to the; appropriate mode handlergoto doOnDelay ;on delay timer handlergoto doOffDelay ;off delay timer handlergoto doOneShot ;one shot handlergoto doROneShot ;retriggerable one shot handlergoto doAstable ;astable multivibrator handlergoto doEAstable ;enabled astable multivibrator handlergoto doCounter ;event counter handlergoto doACounter ;auto resetting event counter handler;****************************************;* On Delay mode handler *;****************************************doOnDelaymovf modest,w ;get current sequencer state valueaddwf PC ;add it to the program counter to jump to the; appropriate mode handlergoto OnDly0 ;On delay state 0 handlergoto OnDly1 ;On delay state 1 handlergoto OnDly2 ;On delay state 2 handler;****************************************;* Off Delay mode handler *;****************************************doOffDelaymovf modest,w ;get current sequencer state value© 1997 Microchip Technology Inc. DS40160A/1_005B-page 15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!