This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PWM using CAPCOM1/2 in XC164CS

Hello,
Can anyone tell me if could be possible to create a differents PWM with variable duty cycle by using CAPCOM1/2?
How would you configure output pines? I have tried it in Dave, but I dont see.
Thanks.

Parents
  • What does CC2_CC16 register mean? I tried to search into user manual, but I don't find it.

    CC2 => Capture Compare Module 2
    CC16 => Capture Compare Channel 16

    How can I control the period of the PWM signal?

    You have chosen Compare Mode 3:
    Set Output Pin on each Match.
    Reset output pin on each timer overflow;
    Only one interrupt per timer period.
    Allocated to T7

    Basically CC2_T7 is your period in this case.

    So when the CC2_CC16 compare value is equal to CC2_T7 then the PWM output goes high and the PWM output goes low when the CC2_T7 overflows (0xFFFF -> 0x48E5). 0x48E5 is your reload value.

Reply
  • What does CC2_CC16 register mean? I tried to search into user manual, but I don't find it.

    CC2 => Capture Compare Module 2
    CC16 => Capture Compare Channel 16

    How can I control the period of the PWM signal?

    You have chosen Compare Mode 3:
    Set Output Pin on each Match.
    Reset output pin on each timer overflow;
    Only one interrupt per timer period.
    Allocated to T7

    Basically CC2_T7 is your period in this case.

    So when the CC2_CC16 compare value is equal to CC2_T7 then the PWM output goes high and the PWM output goes low when the CC2_T7 overflows (0xFFFF -> 0x48E5). 0x48E5 is your reload value.

Children