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>;*****************************************; configuration block from EEPROM (must be in contiguous memory locations)mode equ 0x07 ;timer mode from EEPROMparam1L equ 0x08 ;parameter 1 low byte from EEPROMparam1H equ 0x09 ;parameter 1 high byte from EEPROMparam2L equ 0x0a ;parameter 2 low byte from EEPROMparam2H equ 0x0b ;parameter 2 high byte from EEPROMtmropt equ 0x0c ;option flags from EEPROM; file registers used in timer handleroldRTCC equ 0x0d ;keeps track of RTCC value from last run through looprollL equ 0x0e ;RTCC rollover counter low byterollH equ 0x0f ;RTCC rollover counter high byte; miscellaneous state variables, target counters, etc.inDbnc equ 0x10 ;<strong>Timer</strong> input debouncer staterstDbnc equ 0x11 ;Reset input debouncer statedbncTmr equ 0x12 ;Debouce check timertgtL equ 0x13 ;target counter low bytetgtH equ 0x14 ;target counter high byteflags equ 0x15 ;timer status flagsmodest equ 0x16 ;state of selected timer modetemp equ 0x17 ;temporary storage register; file registers used by EEPROM read routineseeprom equ 0x18 ;bit bufferdatai equ 0x19 ;data input registertxbuf equ 0x1a ;transmit buffercount equ 0x1b ;bit counterbcount equ 0x1c ;byte counter;****************************************;* Miscelaneous equates (constants) *;****************************************;GPIO initialization valuesGPINIT equ 00000010b ;GPIO initial value (SDA line high, all others low)GPTRIS equ 00111010b ;GPIO TRIS register initial valueSDAINP equ 00111010b ;GPIO TRIS register value when SDA line to EEPROM; needs to be an inputSDAOUT equ 00111000b ;GPIO TRIS register value when SDA line to EEPROM; needs to be an output;mode constantsONDLY equ 0 ;mode 0 = on delay timerOFFDLY equ 1 ;mode 1 = off delay timerONESHT equ 2 ;mode 2 = non-retriggerable one-shotRONESHT equ 3 ;mode 3 = retriggerable one-shotASTABL equ 4 ;mode 4 = astable multivibratorEASTABL equ 5 ;mode 5 = astable multivibrator with enableCOUNTR equ 6 ;mode 6 = event counterCOUNTRA equ 7 ;mode 7 = event counter with auto-reset;option flags bit valuesLOWIN equ 0 ;active low input flagLOWOUT equ 1 ;active low output flagLOWRST equ 2 ;active low reset flagTRLEDG equ 3 ;trailing input edge active flag;flags register bit valuesINPHI equ 0 ;timer input highOUTHI equ 1 ;timer output highRSTHI equ 2 ;reset input highEDGON equ 3 ;timer input transistion detectedINPON equ 4 ;timer input active© 1997 Microchip Technology Inc. DS40160A/1_005B-page 9

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

Saved successfully!

Ooh no, something went wrong!