单片机为PIC16F690.此程序在软件中模拟运行时,一切正常.
INCLUDE "P16F690.INC";闪灯程序,1灯-2灯-3灯-4灯-1-2-3-4依次循环 ORG 0000H NOP BSF STATUS,RP0 CLRF TRISC BCF STATUS,RP0 BSF STATUS,RP1 CLRF ANSEL CLRF ANSELH ST MOVLW 01H MOVWF PORTC;1灯点亮 CALL YS1S MOVLW 02H MOVWF PORTC;2灯点亮 CALL YS1S MOVLW 04H MOVWF PORTC;3灯点亮 CALL YS1S;程序运行完这一步时,就直接运行到标号ST处了??????????? MOVLW 0FH MOVWF PORTC; CALL YS1S GOTO ST YS1S MOVLW 0FFH;延时1秒 MOVWF 40H LP0 MOVLW 0FFH MOVWF 41H LP1 MOVLW 02H MOVWF 42H LP2 DECFSZ 42H GOTO LP2 DECFSZ 41H GOTO LP1 DECFSZ 40H GOTO LP0 RETURN END |