LIST p=16F628A ;tell assembler what chip we are using
include "P16F628A.inc" ;include the defaults for the chip
ERRORLEVEL 0, -302 ;suppress bank selection messages
__config _WDT_OFF & _INTOSC_OSC_NOCLKOUT & _LVP_OFF
cblock 0x20
Jiffy ;
endc
ORG 0x00
goto MAIN
ORG 0x04
IRQ decfsz Jiffy ; 500ms interval
goto Pop
; one second code goes here
movlw .2 ; reload the Jiffy timer
movwf Jiffy ;
Pop bcf PIE1, CCP1IE
retfie
MAIN movlw 0x07
movfw CMCON
bsf STATUS, RP0
clrf TRISB ;b1 Sets up PORTB all OUTPUT
bsf PIE1, CCP1IE ;b1 CCP1 IRQ enable
bcf STATUS, RP0
clrf PORTB
movlw high(.62500)
movwf CCPR1H
movlw low(.62500)
movwf CCPR1L
movlw 0x0B ; compare trigger special event
movwf CCP1CON
movlw b'00110001' ; TMR1 on, 1/8 prescale
movwf T1CON
movlw b'11000000'
movwf INTCON
LOOP goto $ ; loop forever
END