下面是我用PIC10F200写的一个简单的程序,但始终没有波形输出 主要就是在上电的时候输出一个脉冲波形 我又检查不出来什么问题 好几年没有用过PIC单片机了,哪位大侠帮帮忙!
list p=10F200 ; list directive to define processor #include <p10F200.inc> ; processor specific variable definitions
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF
; '__CONFIG' directive is used to embed configuration word within .asm file. ; The lables following the directive are located in the respective .inc file. ; See respective data sheet for additional information on configuration word.
;***** VARIABLE DEFINITIONS temp EQU 0x10 temp1 EQU 0x11
;********************************************************************** ; ORG 0xFF ; processor reset vector
; Internal RC calibration value is placed at location 0xFF by Microchip ; as a movlw k, where the k is a literal value.
ORG 0x00 ; coding begins here init ;IO初始化,设置GP0/GP1输出0,GP2/GP3为输入 MOVLW 0x00 MOVWF OSCCAL MOVLW 0xc0 OPTION MOVLW 0x0C TRIS GPIO MOVLW 0x00 MOVWF GPIO
start ;延时20ms CALL delay10ms CALL delay10ms ;GP0输出高 MOVLW 0x01 MOVWF GPIO ;延时70ms CALL delay10ms CALL delay10ms CALL delay10ms CALL delay10ms CALL delay10ms CALL delay10ms CALL delay10ms CALL delay10ms ;GP1输出高 MOVLW 0x03 MOVWF GPIO ;延时10ms CALL delay10ms ;GP1输出低 MOVLW 0x01 MOVWF GPIO ;延时10ms CALL delay10ms ;GP1输出高 MOVLW 0x03 MOVWF GPIO
;延时10ms CALL delay10ms SLEEP
done NOP GOTO done
delay10ms MOVLW 0x0e MOVWF temp d2 MOVLW 0xed MOVWF temp1 d1 DECFSZ temp1,1 GOTO d1 DECFSZ temp,1 GOTO d2 RETLW 0
END ; directive 'end of program'
|