processor 16F883
#include <P16F883.INC>
__config _CONFIG1, 0x23A4
__config _CONFIG2, _WRT_1FOURTH & _BOR40V
org 0x0000
GOTO MAIN
NOP
NOP
NOP
INTER
NOP
RETFIE
org 0x0100
MAIN
BCF STATUS,RP1
BSF STATUS,RP0
MOVLW 0x71
MOVWF OSCCON ; INTERNAL OSC 8MHz
BCF STATUS,RP0
CLRF PORTC
MOVLW 0xD8
BSF STATUS,RP0
MOVWF TRISC ; SET RC0 RC1 RC2 RC5 AS OUTPUT
BCF STATUS,RP0
CLRF 0x20
LOP
NOP
MOVLW 0x50
MOVWF DELY
CALL DELAY
BTFSS 0x20,0
goto LOP1
goto LOP2
LOP1
bsf 0x20,0
bsf PORTC,0
GOTO LOP
LOP2
BCF 0x20,0
BCF PORTC,0
GOTO LOP
DELAY
MOVWF DELY
DELAY1
NOP
NOP
NOP
NOP
NOP
NOP
DECFSZ DELY,F
GOTO DELAY1
RETURN
程序很简单,目的是得到RC0输出的方波
可程序通过ISP写到16F883,居然测不到波行
很是费解!
请大虾帮我看看 |