What math formula for frequency of TC?

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

In my program I have tc_irq() function which is automatically called with some frequency.
After tries and experiments I know (probably), what RC value should I set to have frequency of 200kHz -- in my oppinion it should be 150 or 149 (don't know exactly which one). Also there are clock sources: TC_CLOCK_SOURCE_TC2 (I use this one) = fPBA / 4, TC_CLOCK_SOURCE_TC3 = fPBA / 8, TC_CLOCK_SOURCE_TC4 = fPBA / 16, TC_CLOCK_SOURCE_TC5 = fPBA / 32.
What math formula may I use to compute frequency for known RC value and TC_CLOCK_SOURCE? I use oscilator of 12MHz and frequency of uC is 60MHz.
I invented that math formula should be
freq = 60MHz * 2 / (4 * (RC + 1)) or
freq = 60MHz * 2 / (4 * RC),
but I am not sure.

Thanks in advance for your help.