MOVLB 01H ;BANK1
BSF TRISC,3
MOVLB 0CH
MOVLW 00H
MOVWF PWM2CON0
MOVLB 00H ;BANK0
MOVLW 7CH
MOVWF PR2
MOVLB 0CH
MOVLW 00H
MOVWF PWM2DCH
MOVWF PWM2DCL
MOVLB 00H
BCF PIR1,1
MOVLW 02H
MOVWF T2CON
BSF T2CON,2
MOVLB 0CH
BSF PWM2CON0,7
MOVLB 00H
PWM_W
BTFSS PIR1,1
GOTO PWM_W
MOVLB 01H
BCF TRISC,3
MOVLB 0CH
BSF PWM2CON0,6
bcf PWM2CON0,4
这段程序是按照data sheet上的步骤写的,可是始终没有pwm输出,哪位大侠指导一下,感激不尽 |