Changing PWM counter value?

I am setting a single slop PWM with this registers for the first time :

 REG_TCC0_PER = 150;
 REG_TCC0_CC0 = 75;

Then I am trying to change the counter value and D.C while its still running, with this :

  REG_TCC0_PERB = 200;     
  REG_TCC0_CCB0 = 45;

But this not seems to work, although I saw it here somewhere :frowning:

I also wondering whats the different from the counter in this register(3) :

REG_TCC0_CC3=55;

Each timer has a given number of channels (or outputs). Timer TCC0 has 4 channels. Each channel has its associated counter compare CC register, so there's CC0, CC1, CC2 and CC3.

Set the PER and CCx registers before enabling the timer. Thereafter you can change the buffered PERB and CCBx registers.

Remember that when using the PER, PERB, CC0 and CCB0 you need to check (poll) the appropriate synchronization bit.