MPASM 4.02 Released WATCH.ASM 12-1-2005 11:55:40 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 list p=16f627a 00002 #include p16f627a.inc 00001 LIST 00002 ; P16F627A.INC Standard Header File, Version 1.10 Microchip Technology, Inc. 00265 LIST 00003 00004 ; Set config bits 00005 ; __CONFIG _INTRC_OSC_NOCLKOUT & _PWRTE_OFF & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _LVP_OFF 00006 ; __CONFIG _INTOSC_OSC_NOCLKOUT & _PWRTE_OFF & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _LVP_OFF 2007 3F49 00007 __CONFIG _XT_OSC & _PWRTE_OFF & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _LVP_OFF 00008 ; __CONFIG _LP_OSC & _PWRTE_OFF & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _LVP_OFF 2000 000B 000C 0001 00009 __IDLOCS 0xbc11 0001 00010 00011 ; Declare the variables. 00012 cblock 0x20 00000020 00013 dark ; Time until the display is blanked. 00014 ; (Blanking the display saves battery life.) 00000021 00015 row ; Row to refresh on display 00000022 00016 ticks ; Ticks this second (0-124) 00000023 00017 seconds ; Seconds this minute (0-59) 00000024 00018 minutes ; Minutes this hour (0-59) 00000025 00019 hours ; Hours this day (0-23) 00000026 00020 days ; Day of month (1-31) 00000027 00021 months ; Month of year (1-12) 00000028 00022 mode ; Current operatin mode 00023 ; 0 - displaying time 00024 ; 1 - setting minutes 00025 ; 2 - setting hours 00026 ; 3 - setting days 00027 ; 4 - setting months 00028 ; Start in mode 4. Pressing the button decrements the mode. 00029 ; Pressing the button generally decrements the mode, 00000029 00030 bouncing ; Non-zero during debounce intervals 0000002A 00031 savew ; Saves W during interrupts 0000002B 00032 saves ; Saves STATUS during interrupts 0000002C 00033 timevh ; Value for the timer register, high byte 0000002D 00034 timevl ; Value for the timer register, low byte 0000002E 00035 ticksec ; Ticks per second (after row division) 00036 endc 00037 0000 00038 org 0x0000 ;Reset vector 0000 2820 00039 goto main ; Jump to main code defined in Example.asm 0001 0000 00040 nop ; Pad out so interrupt 0002 0000 00041 nop ; service routine gets 0003 0000 00042 nop ; put at address 0x0004. 0004 2888 00043 goto service ; Points to interrupt service routine 0020 00044 org 0x0020 ; Begin program 0020 00045 main ; Main code entry -- once only initialization 00046 ;OPTION 00047 ; Clear RBPU 00048 ; Clear TOCS 0020 1303 00049 bcf STATUS, RP1 ; Select BANK0 or BANK1 MPASM 4.02 Released WATCH.ASM 12-1-2005 11:55:40 PAGE 2 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0021 0064 00050 clrwdt 00051 errorlevel -302 0022 1683 00052 bsf STATUS, RP0 ; Select BANK1 0023 0181 00053 clrf OPTION_REG 00054 errorlevel +302 00055 00056 ;INTCON 00057 ; Set GIE 00058 ; Set PEIE -- apparently timer 1 is a peripheral? 0024 1283 00059 bcf STATUS, RP0 ; Select BANK0 0025 30C0 00060 movlw (1<>8) & 0xFF 2101 00C1 00470 de TimeVal & 0xFF 2102 007D 00471 de d'125' ; Configure the clock rate 00472 end MPASM 4.02 Released WATCH.ASM 12-1-2005 11:55:40 PAGE 10 SYMBOL TABLE LABEL VALUE ADEN 00000003 BRGH 00000002 C 00000000 C1INV 00000004 C1OUT 00000006 C2INV 00000005 C2OUT 00000007 CCP1CON 00000017 CCP1IE 00000002 CCP1IF 00000002 CCP1M0 00000000 CCP1M1 00000001 CCP1M2 00000002 CCP1M3 00000003 CCP1X 00000005 CCP1Y 00000004 CCPR1H 00000016 CCPR1L 00000015 CIS 00000003 CM0 00000000 CM1 00000001 CM2 00000002 CMCON 0000001F CMIE 00000006 CMIF 00000006 CREN 00000004 CSRC 00000007 DC 00000001 EEADR 0000009B EECON1 0000009C EECON2 0000009D EEDATA 0000009A EEIE 00000007 EEIF 00000007 F 00000001 FERR 00000002 FSR 00000004 GIE 00000007 INDF 00000000 INTCON 0000000B INTE 00000004 INTEDG 00000006 INTF 00000001 IRP 00000007 NOT_BO 00000000 NOT_BOD 00000000 NOT_BOR 00000000 NOT_PD 00000003 NOT_POR 00000001 NOT_RBPU 00000007 NOT_T1SYNC 00000002 NOT_TO 00000004 OERR 00000001 MPASM 4.02 Released WATCH.ASM 12-1-2005 11:55:40 PAGE 11 SYMBOL TABLE LABEL VALUE OPTION_REG 00000081 OSCF 00000003 PCL 00000002 PCLATH 0000000A PCON 0000008E PEIE 00000006 PIE1 0000008C PIR1 0000000C PORTA 00000005 PORTB 00000006 PR2 00000092 PS0 00000000 PS1 00000001 PS2 00000002 PSA 00000003 RBIE 00000003 RBIF 00000000 RCIE 00000005 RCIF 00000005 RCREG 0000001A RCSTA 00000018 RD 00000000 RP0 00000005 RP1 00000006 RX9 00000006 RX9D 00000000 SPBRG 00000099 SPEN 00000007 SREN 00000005 STATUS 00000003 SYNC 00000004 T0CS 00000005 T0IE 00000005 T0IF 00000002 T0SE 00000004 T1CKPS0 00000004 T1CKPS1 00000005 T1CON 00000010 T1OSCEN 00000003 T2CKPS0 00000000 T2CKPS1 00000001 T2CON 00000012 TMR0 00000001 TMR1CS 00000001 TMR1H 0000000F TMR1IE 00000000 TMR1IF 00000000 TMR1L 0000000E TMR1ON 00000000 TMR2 00000011 TMR2IE 00000001 TMR2IF 00000001 TMR2ON 00000002 MPASM 4.02 Released WATCH.ASM 12-1-2005 11:55:40 PAGE 12 SYMBOL TABLE LABEL VALUE TOUTPS0 00000003 TOUTPS1 00000004 TOUTPS2 00000005 TOUTPS3 00000006 TRISA 00000085 TRISB 00000086 TRMT 00000001 TX9 00000006 TX9D 00000000 TXEN 00000005 TXIE 00000004 TXIF 00000004 TXREG 00000019 TXSTA 00000098 TicksLost 00000001 TimeVal FFFFF9C1 VR0 00000000 VR1 00000001 VR2 00000002 VR3 00000003 VRCON 0000009F VREN 00000007 VROE 00000006 VRR 00000005 W 00000000 WR 00000001 WREN 00000002 WRERR 00000003 Z 00000002 _BODEN_OFF 00003FBF _BODEN_ON 00003FFF _BOREN_OFF 00003FBF _BOREN_ON 00003FFF _CP_OFF 00003FFF _CP_ON 00001FFF _DATA_CP_OFF 00003FFF _DATA_CP_ON 00003EFF _ER_OSC_CLKOUT 00003FFF _ER_OSC_NOCLKOUT 00003FFE _EXTCLK_OSC 00003FEF _HS_OSC 00003FEE _INTOSC_OSC_CLKOUT 00003FFD _INTOSC_OSC_NOCLKOUT 00003FFC _INTRC_OSC_CLKOUT 00003FFD _INTRC_OSC_NOCLKOUT 00003FFC _LP_OSC 00003FEC _LVP_OFF 00003F7F _LVP_ON 00003FFF _MCLRE_OFF 00003FDF _MCLRE_ON 00003FFF _PWRTE_OFF 00003FFF _PWRTE_ON 00003FF7 _RC_OSC_CLKOUT 00003FFF MPASM 4.02 Released WATCH.ASM 12-1-2005 11:55:40 PAGE 13 SYMBOL TABLE LABEL VALUE _RC_OSC_NOCLKOUT 00003FFE _WDT_OFF 00003FFB _WDT_ON 00003FFF _XT_OSC 00003FED __16F627A 00000001 bouncing 00000029 dark 00000020 day 00000111 days 00000026 debounce1 0000007A debounce1b 0000007D debounce2 00000082 debounce2b 00000085 display 000000A8 hour 0000010C hours 00000025 intret 000000B3 loop 00000062 main 00000020 mins 00000107 minutes 00000024 mode 00000028 mode0 000000B8 mode1 000000E4 mode2 000000EB mode3 000000F2 mode4 000000FA month 00000116 months 00000027 newmode 00000074 row 00000021 saves 0000002B savew 0000002A seconds 00000023 secs 00000102 service 00000088 ticks 00000022 ticksec 0000002E timevh 0000002C timevl 0000002D uptime 000000C3 waituser 0000007F MPASM 4.02 Released WATCH.ASM 12-1-2005 11:55:40 PAGE 14 MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0000 : XXXXX----------- ---------------- XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0100 : XXXXXXXXXXXXXXXX XXXXXXXXXXX----- ---------------- ---------------- 2000 : XXXX---X-------- ---------------- ---------------- ---------------- 2100 : XXX------------- ---------------- ---------------- ---------------- All other memory blocks unused. Program Memory Words Used: 256 Program Memory Words Free: 768 Errors : 0 Warnings : 0 reported, 0 suppressed Messages : 0 reported, 18 suppressed