Ihave written this code .Iwant the ccp module to generate 0.5 duty cycle signals at 200khz in the half bridge mode but after simulation I am failing to get the required signal at the output.
TITLE "PWM based pulse generator"
#INCLUDE P16F887.INC
BANKSEL CCP1CON
CLRF CCP1CON
BANKSEL TMR2
CLRF TMR2
BANKSEL PR2
MOVLW 0X09
MOVWF PR2
BANKSEL CCPR1L
MOVLW 0X80
MOVWF CCPR1L
BANKSEL INTCON
CLRF INTCON
BANKSEL TRISC
BSF TRISC,2
BANKSEL TRISD
BCF TRISD,5
BANKSEL PIE1
CLRF PIE1
BANKSEL PIR1
CLRF PIR1
BANKSEL CCP1CON
MOVLW 0X8C
MOVWF CCP1CON
BANKSEL T2CON
BSF T2CON,TMR2ON
BANKSEL PWM1CON
MOVLW 0X02
MOVWF PWM1CON
END
---------- Post added at 03:19 ---------- Previous post was at 02:12 ----------
is it possible to set up the ccp module such that the program will be executing the main program and simultaneously producing the pulses in half bridge mode can you please give me an example if possible.