Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About davis1d0

  • Rank
  1. I've setup the PWM function on my pic to run two channels, which will be used to control the turning on of two igbts, but for some reason I can not get the Dead Band Delay to work. The PWM is working fine, but no matter what adjustments I make to my PWM1CON register no delay appears on the scope. My code is below, any help would be great. Thanks By the way I'm working with a 12Mhz clock. Main: banksel TRISC movlw b'00000010' movwf TRISC movlw b'00010000' movwf TRISD banksel PR2 movlw b'01000000' movwf PR2 banksel CCPR1L movlw b'00011010' movwf CCPR1L movlw b'10001100' movwf CCP1CON banksel PWM1CON movlw b'00001000' ;Bit 7 sets auto reset movwf PWM1CON ;Bits 6:0 Dead Band Delay banksel PIR1 bcf PIR1,TMR2IF banksel T2CON movlw b'00000100' ; Sets up the timer w/ a 1/16 scaler movwf T2CON ; Timer2 Register banksel TRISC clrf TRISC clrf TRISD banksel ECCP1AS bcf ECCP1AS,ECCPASE