#include p16f1823.inc ; processor specific variable definitions
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
__CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_LO & _LVP_OFF
ORG 0XF000
DE 0X92,0X4,0X0,0X0,0X8B,0X95,0X9F,0XA9
DE 0XB3,0XBD,0X4,0X4,0X4,0X4,0X4,0X4
ORG 0000H
GOTO START ;跳转到主程序
ORG 0004H ;定义中断向量
BANKSEL IOCAF
CLRF IOCAF
BANKSEL TOSH
CLRF TOSH
MOVLW 15H
MOVWF TOSL
RETFIE
INTPP ORG 0015H
MOVF 70H,F
BANKSEL EEADRL
MOVWF EEADRL
BCF EECON1, CFGS
BCF EECON1, EEPGD
BSF EECON1, RD
MOVF EEDATL,W
BANKSEL PORTC
MOVWF PORTC
INCF 70H,F
GOTO $-0
START
MOVLB 03H
CLRF ANSELA
CLRF ANSELC
BANKSEL TRISC
CLRF TRISC
BSF TRISA,4
BANKSEL IOCAP
BSF IOCAN,4
MOVLW B'10001000'
MOVWF INTCON
CLRF 70H
BANKSEL PORTC
MOVLW 0AAH
MOVWF PORTC
GOTO $-0
END |