代码如下 ,不知道哪里设置的不对一直没波形输出,请大佬指点下,非常感谢!!!
#include "p16f15313.inc"
__CONFIG _CONFIG1, _FEXTOSC_ECH & _RSTOSC_HFINT1 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_OFF
__CONFIG _CONFIG2, _MCLRE_OFF & _PWRTE_OFF & _LPBOREN_OFF & _BOREN_OFF & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_OFF
__CONFIG _CONFIG3, _WDTCPS_WDTCPS_31 & _WDTE_OFF & _WDTCWS_WDTCWS_7 & _WDTCCS_SC
__CONFIG _CONFIG4, _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_ON
__CONFIG _CONFIG5, _CP_OFF
ORG 0x0000
GOTO START
START
BANKSEL RA5PPS
MOVLW 09H
MOVWF RA5PPS
BANKSEL T2CON
MOVLW 01H
MOVWF T2CLKCON
MOVLW 20H
MOVWF PR2
BANKSEL CCPR1L
MOVLW 10H
MOVWF CCPR1H
MOVLW 0C0H
MOVWF CCPR1L
MOVLW 9FH
MOVWF CCP1CON
BANKSEL TRISA
BCF TRISA,5
BANKSEL T2CON
BSF T2CON,T2ON
GOTO $+0
END
|