Hello everybody.
I was reading tonight about the PWM module of the pic.
Reading the manual, it says that duty period is set by PR2. PR2 is 8 bits. After that is says that duty cycle is set by CCPR1L and 2 bits from CCP1CON making a total of 10bits.
Questions:
1) Since duty cycle is a fraction of the duty period which is 8-bits, how come its 10bits?
2) There is a comparator between timer2 and CCPR1H to decide when it is the end of the duty cycle. Timer2 is 8bits and the 2 LSBits are coming from the prescaler (manual). But if it is coming from the prescaler it means that those 2 bits are always constant right? I dont really get this.
Thank you for reading. Any help would be appreciated!!!
I was reading tonight about the PWM module of the pic.
Reading the manual, it says that duty period is set by PR2. PR2 is 8 bits. After that is says that duty cycle is set by CCPR1L and 2 bits from CCP1CON making a total of 10bits.
Questions:
1) Since duty cycle is a fraction of the duty period which is 8-bits, how come its 10bits?
2) There is a comparator between timer2 and CCPR1H to decide when it is the end of the duty cycle. Timer2 is 8bits and the 2 LSBits are coming from the prescaler (manual). But if it is coming from the prescaler it means that those 2 bits are always constant right? I dont really get this.
Thank you for reading. Any help would be appreciated!!!