how to sync a TC clked by PWM with a TC clked by PBA?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi,

I want to build up a 32bit hardware timer, so I let TC2 by clocked by PWM2 with frequency of PBA/2/65536, and TC0 by clocked by PBA/2.

But now I don't know if there is way to sync PWM output to PBA clocks.

I checked the peripheral clock masking, but if the TC or PWM's input clocked are masked, then it's not possible to enable their counters.

Anyone knows the way???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it seems it could work if i use the BURST function to block the PBA clock of low 16bit time and then it could be in sync.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

just measured the result, and it got a delay of one PBA clk between the low 16bit timer output waveform and high 16bit timer input PWM clk.

I think this problem comes from the mismatch of PBA/2 clock source for driving TC and another PBA/2 for PWM.

but i can't find a fix....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

have you seen the TC erratum on some revisions on the Timer input clock? (there is sometimes a /2 ratio)

-sma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes, but my UC3B is not engineering sample.

So there shouldn't be error in TC, right?