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>APPENDIX A:SOURCE CODE;*******************************************************************; TM_DLY01.ASM; Variable time delay, on & off, relay program;*******************************************************************; AUTHOR: Paul McCoy; DATE: 31 May 1997; ORGANIZATION: Zykora Inc.; REVISION: 1.00.00;;*******************************************************************;LIST p=12C671; PIC12C671 is the target processor#include CBLOCK 0x20 ; autosets register variable addressesflag; flag register for program flagssecond_cnt; counter for one second timertemp_stat; holds status register for interruptstemp_w; holds W register for interruptstime_cntENDC;*******************************************************************; FLAG BITS;*******************************************************************COMMAND equ 00 ; Set - input line is setACTUAL equ 01 ; Set - output line is setTIMING equ 02 ; Set - <strong>Timer</strong> is running;*******************************************************************; OTHER DEFINES;*******************************************************************LAST_LOCATE equ 0x3ff;*********************************************************************; Program;********************************************************************org 0x00 ;reset vectorgotostartorg 0x04 ;interupt vectormovwf temp_w ;note: if Bank1 is used this space must;be reservedswapf STATUS,WbcfSTATUS,RP0movwf temp_statbtfsc INTCON,2call<strong>Timer</strong>btfsc INTCON,1bcfINTCON,1btfsc INTCON,0callInput_changeswapf temp_stat,Wmovwf STATUSswapf temp_w,Fswapf temp_w,Wretfie;********************************************************************; Initialization blockDS40160A/1_003-page 2© 1997 Microchip Technology Inc.

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

Saved successfully!

Ooh no, something went wrong!