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>; equ b3; equ b4; equ b5; equ b6; equ b7;******************************************#define data_hi bsf GPIO, disp_data#define data_lo bcf GPIO, disp_data#define clk_hi bsf GPIO, disp_clk#define clk_lo bcf GPIO, disp_clk#define strobe_hi bsf GPIO, disp_strobe#define strobe_lo bcf GPIO, disp_strobe#define relay_on bsf GPIO, relay#define relay_off bcf GPIO, relay;************** EOF DEF_RAM.ASM ***********; SUBS.ASM; ********;read key port in keyread_keys movf newkey, w ;debouncing taken care by s/wmovwf oldkeymovf GPIO, w ;read newkeysandlw 00011000b ;gp3, gp4 are key portsmovwf newkeycomf newkey, f ;complement since active lowandwf oldkey, w ;key=oldkey AND compl(newkey)movwf key;indicate to display routine units or tens key pressedbtfsc key, units_keybsf digit_inc, units_incbtfsc key, tens_keybsf digit_inc, tens_increturn;************************************************************init_ports movlw 0 ;all lomovwf GPIOmovlw 00011000b ;port g0-g2,g5 o/p & gp3,gp4 i/ptris GPIOclrf TMR0 ;clr tmr0 & prescalermovlw 11000011b ;tmr0 enable with 1:16 prescaleroptionreturn;***************** EOF SUBS.ASM ******************************; TABLES.ASM; **********;7 segments decoded data. lo is segment on & hi is segment offget_seg addwf PCL, f; ABCDEFGP ;P is decimal pointretlw 00000011b ;0retlw 10011111b ;1retlw 00100101b ;2retlw 00001101b ;3retlw 10011001b ;4retlw 01001001b ;5retlw 01000001b ;6retlw 00011111b ;7retlw 00000001b ;8retlw 00011001b ;9dec_pt equ 11111110b ;decimal point bit;*************** EOF TABLES.ASM **************************DS40160A/1_001-page 4© 1997 Microchip Technology Inc.

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

Saved successfully!

Ooh no, something went wrong!