PA3040
Advanced Member level 3
Dear All,
As we all aware in the PWM operation is like bellow.
After configure all register for PWM
1 First load value for period register ( PR2 = 20)
2 Then Load duty cycle register (CCPR1L = 5)
3 Now Timer2 ON ( bsf T2CON,TMR2ON)
Then
TMR2 compare with PR2 register, when match occurred (TMR2 = PR2) OR TMR2 = 20 as per above )
Then
TMR2 compare with CCPR1H register , when match occurred (TMR2 = CCR1H) OR TMR2 = 5 as per above)
so my program is working properly
Only doubts I observed is when I load register to the watch window in the MPLAB TMR2 register always reset when match occurred to the PR2 register to the TMR2 register, even TMR2 register is matching with CCPR1H register
Please advice
As we all aware in the PWM operation is like bellow.
After configure all register for PWM
1 First load value for period register ( PR2 = 20)
2 Then Load duty cycle register (CCPR1L = 5)
3 Now Timer2 ON ( bsf T2CON,TMR2ON)
Then
TMR2 compare with PR2 register, when match occurred (TMR2 = PR2) OR TMR2 = 20 as per above )
Then
TMR2 compare with CCPR1H register , when match occurred (TMR2 = CCR1H) OR TMR2 = 5 as per above)
so my program is working properly
Only doubts I observed is when I load register to the watch window in the MPLAB TMR2 register always reset when match occurred to the PR2 register to the TMR2 register, even TMR2 register is matching with CCPR1H register
Please advice