;********************************************************************** ;********************************************************************** ; * ; Files Required: P12F629.INC * ; * ;********************************************************************** list p=12f629 ; list directive to define processor #include ; processor specific variable definitions errorlevel -302 ; suppress message 302 from list file errorlevel -203 ; suppress message 203 from list file __CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_ON & _PWRTE_ON & _INTRC_OSC_NOCLKOUT ;***** CONSTANT #define LED GPIO #define PIN GPIO #define RED GP4 #define GREEN GP5 #define BLUE GP1 #define POWER GP2 #define STR GP0 #define SHET_CONST 10 ; кол-во вспышек #define IMPULS_CONST 2 ; время вспышки/паузы CONST*18ms ;***** VARIABLE DEFINITIONS CBLOCK 0x20 W_Temp ; Регистр сохранения содержимого W при прерываниях. Stat_Temp ; Регистр сохранения содержимого STATUS при прерываниях. caunt Tamer FLAG shet ENDC ;**** BIT FLAG FL EQU 0 ; ;********************************************************************** ORG 0x000 ; processor reset vector clrf INTCON clrwdt goto main ; go to beginning of program ;************************************************************************** ;************************************************************************** ORG 0x004 ; interrupt vector location movwf W_Temp ; save off current W register contents movf STATUS,w ; move status register into W register movwf Stat_Temp ; save off contents of STATUS register ; isr code can go here or be located as a call subroutine elsewhere movf Stat_Temp,w ; retrieve copy of STATUS register movwf STATUS ; restore pre-isr STATUS register contents swapf W_Temp,f swapf W_Temp,w ; restore pre-isr W register contents retfie ; return from interrupt ;**************************************************************************** ;**************************************************************************** init: banksel CMCON movlw (1<