devonsc
Advanced Member level 4
Newbie - PWM using PIC
Hi there,
Do you guys mind guiding on regarding the following matter? I tried writing the code for to generate a PWM signal. As shown in the following is what I get after referring to a website. However, would like to ask if Line A and Line B is necessary? Am I right to say that with the presence of Line C, I can ignore both Line A and Line B? Thanks in advance.
********************************************
PWM:
MOVLW B'00010001' ; BITS OF 9 TO 2
MOVWF CCPR1L
BCF CCP1CON,CCP1X ; Line A
BCF CCP1CON,CCP1Y ; Line B
MOVLW B'00000100' ; TMR2 = ON, PRESCALE = 1
MOVWF T2CON
MOVLW B'00001100' ; Line C
MOVWF CCP1CON
RETURN
********************************************
Hi there,
Do you guys mind guiding on regarding the following matter? I tried writing the code for to generate a PWM signal. As shown in the following is what I get after referring to a website. However, would like to ask if Line A and Line B is necessary? Am I right to say that with the presence of Line C, I can ignore both Line A and Line B? Thanks in advance.
********************************************
PWM:
MOVLW B'00010001' ; BITS OF 9 TO 2
MOVWF CCPR1L
BCF CCP1CON,CCP1X ; Line A
BCF CCP1CON,CCP1Y ; Line B
MOVLW B'00000100' ; TMR2 = ON, PRESCALE = 1
MOVWF T2CON
MOVLW B'00001100' ; Line C
MOVWF CCP1CON
RETURN
********************************************