;
; Add to the MPLABX project Additional options:
; -Wa,-a -Wl,-presetVec=0h,-peepromData=2100h
;
#include <xc.inc>
PROCESSOR 16F630
config FOSC = INTRCIO // Oscillator Selection bits (INTOSC oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN)
config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
config MCLRE = OFF // RA3/MCLR pin function select (RA3/MCLR pin function is digital I/O, MCLR internally tied to VDD)
config BOREN = ON // Brown-out Detect Enable bit (BOD enabled)
config CP = OFF // Code Protection bit (Program Memory code protection is disabled)
config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
PSECT eepromData,global,class=EEDATA,space=3,delta=2,noexec
DB 0x16
DB 'j','o','s','e','t','e',' '
PSECT resetVec,class=CODE,delta=2
resetVec:
NOP
NOP
NOP
BCF STATUS,0x5
MOVLW 0x7
MOVWF CMCON
CLRF INTCON
BSF STATUS,0x5
MOVLW 0x28
MOVWF TRISA
CLRF OPTION_REG
CLRF EEADR
BSF EECON1,0
MOVF EEDAT,W
BCF STATUS,0x5
MOVWF PORTA
CLRF PIR1
L011:
BTFSS PORTA,0x3
GOTO L011
CLRF INTCON
CALL L04B
BTFSS PORTA,0
GOTO L030
BTFSS PORTA,0x1
GOTO L033
BTFSS PORTA,0x2
GOTO L036
GOTO L039
L01C:
BTFSS PORTA,0x3
GOTO L02C
GOTO L01C
CALL L04B
BTFSC PORTA,0x3
GOTO L01C
CALL L04B
BTFSC PORTA,0x3
GOTO L01C
CALL L04B
BTFSC PORTA,0x3
GOTO L01C
CALL L04B
BTFSC PORTA,0x3
GOTO L01C
GOTO L02C
L02C:
MOVF 0x30,W
MOVWF PORTA
CALL L03C
GOTO L011
L030:
MOVLW 0x15
MOVWF 0x30
GOTO L01C
L033:
MOVLW 0x13
MOVWF 0x30
GOTO L01C
L036:
MOVLW 0x7
MOVWF 0x30
GOTO L01C
L039:
MOVLW 0x16
MOVWF 0x30
GOTO L01C
L03C:
MOVF 0x30,W
BSF STATUS,0x5
MOVWF EEDAT
MOVLW 0x38
MOVF EEADR,F
BSF EECON1,0x2
MOVLW 0x55
MOVWF EECON2
MOVLW 0xAA
MOVWF EECON2
BSF EECON1,0x1
BCF EECON1,0x2
BCF STATUS,0x5
CLRF PIR1
RETURN
L04B:
MOVLW 0x3
MOVWF 0x31
MOVLW 0x18
MOVWF 0x32
MOVLW 0x2
MOVWF 0x33
L051:
DECFSZ 0x31,F
GOTO L054
DECFSZ 0x32,F
L054:
GOTO L056
DECFSZ 0x33,F
L056:
GOTO L051
GOTO L058
L058:
RETURN
END resetVec