我用的片子是16F505,想让C口的1,2位输出一个脉冲信号,程序如下: list p=16F505
#include "p16F505.inc"
org 0x000 goto MAIN ; '__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.
MAIN BSF STATUS,PA0 MOVLW 0x00 MOVWF OSCCAL ;;内部RC晶振校准 CLRWDT CLRF TMR0 BCF STATUS,PA0 MOVLW b'00000000' OPTION BCF STATUS,PA0 MOVLW b'00001111' ;;;;;;;;;;;;;;;;;;端口B TRIS PORTB MOVLW b'00000000' ;;;;;;;;;;;;;;;;;;端口C TRIS PORTC START BSF PORTC,1 BSF PORTC,2 MOVLW 0x59 MOVWF 0x55 DECFSZ 0x55,1 GOTO $-1 MOVLW 0X00 MOVWF PORTC MOVLW 0x10 ;;50us jinzhoukexin ;MOVWF AA ;CHAO SHENG MAI KUAN 81uS ;DECFSZ AA,1 MOVLW 0x59 MOVWF 0x56 DECFSZ 0x56,1 GOTO $-1 GOTO START ; remaining code goes here END ; directive 'end of program'
但写完单片不知道为什么不出,是不是程序上的毛病?硬件也看了,没有那错了,请高手赐教,谢谢~! |