|
;********************************************** ;********* 這是PIC16C57C表頭 ******* ;********************************************** INDF EQU 0H TMR0 EQU 1H PCL EQU 2H STATUS EQU 3H FSR EQU 4H RA EQU 5H RB EQU 6H RC EQU 7H ;---------------------------------------------- ;OPTION: ;012 PS0/PS1/PS2=000: RTCC=1:2 WDT=1:1 ; PS0/PS1/PS2=000: RTCC=1:256 WDT=1:128 ;3 PSA: RTCC=0 WDT=1 ;4 RTE: 低到高觸發(fā)=0 高到低觸發(fā)=0 ;5 RTS: 外部觸發(fā)=1 內(nèi)部時(shí)鐘=0 ;---------------------------------------------- ;STATUS: C EQU 0 ;有進(jìn)位或無借位為1 DC EQU 1 ; Z EQU 2 ;運(yùn)算結(jié)果為0時(shí)=1 PD EQU 3 ; TO EQU 4 ;看門狗溢出時(shí)為0,上電時(shí)為1 PS0 EQU 5 PS1 EQU 6 PS2 EQU 7 ;ROM PS2/PS1/PS0=000 000H-1FFH ; PS2/PS1/PS0=000 200H-3FFH ; PS2/PS1/PS0=000 400H-5FFH ; PS2/PS1/PS0=000 600H-7FFH ;************************************************* ;** RAM BANK0=08H---1FH FSR5/6=0/0 ** ;** BANK1=30H---3FH FSR5/6=1/0 ** ;** BANK2=50H---5FH FSR5/6=0/1 ** ;** BANK3=70H---7FH FSR5/6=1/1 ** ;************************************************* ; ______________ ; T0CKI-| 1 28 |-MCLR ; VDD-| 2 27 |-OSC1/CLKI ; NC-| 3 26 |-OSC2/CLKO ; VSS-| 4 25 |-RC7 ; NC-| 5 24 |-RC6 ; RA0-| 6 23 |-RC5 ; RA1-| 7 22 |-RC4 ; RA2-| 8 21 |-RC3 ; RA3-| 9 20 |-RC2 ; RB0-| 10 19 |-RC1 ; RB1-| 11 18 |-RC0 ; RB2-| 12 17 |-RB7 ; RB3-| 13 16 |-RB6 ; RB4-| 14 15 |-RB5 ; ~~~~~~~~~~~~~~~ ; 16C57C ;--------------------------------------------- ORG 000H MAIN: ;************************************* ;****** 這是清零子程式 ****** ;************************************* RESET_: BSF FSR,6 BSF FSR,5 MOVLW 1FH MOVWF FSR BCF FSR,6 BCF FSR,5 MOVLW 10H MOVWF 8H RESET7XH: BSF FSR,6 BSF FSR,5 CLRF INDF DECF FSR,F BCF FSR,6 BCF FSR,5 DECFSZ 8H,F GOTO RESET7XH BSF FSR,6 MOVLW 1FH MOVWF FSR BCF FSR,6 MOVLW 10H MOVWF 8H RESET5XH: BSF FSR,6 CLRF INDF DECF FSR,F BCF FSR,6 DECFSZ 8H,F GOTO RESET5XH BSF FSR,5 MOVLW 1FH MOVWF FSR BCF FSR,5 MOVLW 10H MOVWF 8H RESET3XH: BSF FSR,5 CLRF INDF DECF FSR,F BCF FSR,5 DECFSZ 8H,F GOTO RESET3XH MOVLW 1FH MOVWF FSR MOVLW 017H MOVWF 8H RESET1XH: CLRF INDF DECF FSR,F DECFSZ 8H,F GOTO RESET1XH RETLW 0 ORG 7FFH GOTO MAIN END |