12.07.2015 Views

Electromechanical Timer Replacement - 320Volt

Electromechanical Timer Replacement - 320Volt

Electromechanical Timer Replacement - 320Volt

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Electromechanical</strong> <strong>Timer</strong> <strong>Replacement</strong>;********************************;* MoveP1ToTgt *;********************************; This routine moves the timer parameter 1 values read from; the configuration EEPROM into the target timer file registers.; This routine is used by the various state handlers in the mode sequencer.MoveP1ToTgtmovf param1L,w ;initializemovwf tgtL ; targetmovf param1H,w ; countermovwf tgtH ; valuegoto InitRollOver ;re-initialize rollover counter; (return instruction executed at end of InitRollOver);********************************;* MoveP2ToTgt *;********************************; This routine moves the timer parameter 2 values read from; the configuration EEPROM into the target timer file registers.; This routine is used by the various state handlers in the mode sequencer.MoveP2ToTgtmovf param2L,w ;initializemovwf tgtL ; targetmovf param2H,w ; countermovwf tgtH ; valuegoto InitRollOver ;re-initialize rollover counter; (return instruction executed at end of InitRollOver);********************************;* InitRollOver *;********************************; This routine initializes the rollover counter with the value that; represents .1 secondInitRollOvermovlw TENTHL ;loadmovwf rollL ; rollovermovlw TENTHH ; countermovwf rollH ;retlw 0 ;return from subroutine;********************************;* IsTgtZero *;********************************; This routine checks to see if the target timer is equal; to zero. If it is, it returns with the zero flag in status register set. Otherwise,; the zero flag is cleared. This routine is used by the various state handlers in the; mode sequencer.IsTgtZeromovlw 0 ;is upper byte of target timeriorwf tgtH,w ; = 0?SEQ;if yes, skipgoto TgtNotZero ;if not, target timer not zero - branchiorwf tgtL,w ;is lower byte of target timer = 0? If so, zero flag in; status register will be setTgtNotZeroretlw 0 ;return from subroutine (result in zero flag in status reg);********************************;* DecrTgt *;********************************; This routine decrements the target counter. It is used in the timer handler and the; counter mode handlers in the mode sequencer.© 1997 Microchip Technology Inc. DS40160A/1_005B-page 13

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

Saved successfully!

Ooh no, something went wrong!