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>goto seqEnd ;go to seqEndEAstable0EAstable1bcf flags,OUTON ;clear timer output on flagcall MoveP1ToTgt ;initialize target counter valuebtfsc flags,INPON ;is timer input on?incf modest ;if yes - move to mode state 1goto seqEnd ;go to seqEndbtfss flags,INPON ;is timer input still on?goto EAstable1a ;if not - go to EAstable1absf flags,OUTON ;set timer output on flagcall IsTgtZero ;is target timer = 0?SEQ ;goto seqEnd ;if not, go to seqEndincf modest ;otherwise, move to mode state 2call MoveP2ToTgt ;initialize target counter valuegoto seqEnd ;go to seqEndEAstable1abcf flags,OUTON ;clear timer output on flagclrf modest ;go back to mode state 0goto seqEnd ;EAstable2bcf flags,OUTON ;clear timer output on flagbtfss flags,INPON ;is timer input still on?goto EAstable2a ;if not - go to EAstable2acall IsTgtZero ;is target timer = 0?SEQ ;goto seqEnd ;if not, go to seqEndmovlw 1 ;otherwise, movemovwf modest ; to mode state 0call MoveP1ToTgt ;initialize target counter valuegoto seqEnd ;go to seqEndEAstable2aclrf modest ;go back to mode state 0goto seqEnd ;go to seqEndCounter0Counter1Counter1aCounter1bbcf flags,OUTON ;clear timer output on flagcall MoveP1ToTgt ;initialize target counter valueincf modest ;move to state 1goto seqEnd ;go to seqEndbcf flags,OUTON ;clear timer output on flagbtfsc flags,RSTON ;is reset input active?goto Counter1a ;yes it is - go to Counter1abtfss flags,EDGON ;have we detected an active input edge?goto Counter1b ;no we have not - go to Counter1bcall DecrTgt ;decrement the target countercall IsTgtZero ;is target counter = 0?SEQ ;goto Counter1b ;nope - go to Counter1bincf modest ;move to mode state 2goto seqEnd ;go to seqEndcall MoveP1ToTgt ;re-initialize target counter valuegoto seqEnd ;go to seqEnd© 1997 Microchip Technology Inc. DS40160A/1_005B-page 19

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

Saved successfully!

Ooh no, something went wrong!