list p=16f627a #include p16f627a.inc ; Set config bits __CONFIG _INTRC_OSC_NOCLKOUT & _PWRTE_OFF & _WDT_OFF & _CP_OFF ; Compute a value for the timer. ; Goal is an interrupt per millisecond, so we need to divide ; 4Mhz by 4000 to get 125Hz. Set the prescaler for 4*(2^6)=256, ; then set the clock for (5^3)=125. ; Hmm. It seems OSC1 is already divided by 4 to get CLKOUT, ; so just use (2^6)=64 for the prescaler. timeval EQU -d'125' ; Declare the time of day variables cblock 0x20 row ticks seconds minutes hours days months mode bouncing savew saves endc org 0x0000 ;Reset vector goto main ; Jump to main code defined in Example.asm nop ; Pad out so interrupt nop ; service routine gets nop ; put at address 0x0004. goto service ; Points to interrupt service routine org 0x0020 ; Begin program main ; Main code entry -- once only initialization ;OPTION ; Clear RBPU ; Clear TOCS ; Clear PSA ; Set prescaler = 111 (divide by 256) clrwdt bcf STATUS, RP1 ; Select BANK0 or BANK1 bsf STATUS, RP0 ; Select BANK1 movlw (1<