pwm and compare in pic16f877

Discussion in 'Embedded Systems and Microcontrollers' started by roven, Oct 6, 2006.

  1. roven

    Thread Starter New Member

    Oct 1, 2006
    hi! can pls anyone help me w/ pic16f877, i'm a newbie. i'm using the compare and pwm feature together. i'm using the counter mode of compare and i have a problem with CCPR1L. My CCPR1L is not a fixed value, i would like to write a new value everytime a compare occurs(i.e. everytime the CCPR1IF is set). But the problem is that when i write to it, the TMR1L seems to get written the same value.

    How do i change CCPR1L without affecting TMR1L? any suggestions? i cud post my code if you like. Thanks in advance!