Electrical – A question about timer resolution and frequency range

timer

In a manual of this data-acquisition hardware the timer output is state as:

"One timer output channel(32-bit)"

If a timer is 32-bit, what else info is needed to calculate the max and min freq. timer can produce(as a PWM output)? Should we need the processor speed?

edit:

I found more info about the timer output:

enter image description here

Best Answer

Generally, timers embedded in microcontrollers tend to have a prescaler before them, so the clock to the timer need not be the system clock frequency. Once you have the max and min frequency available from the prescaler, this will give the timing resolution of the timer.

Unfortunately, the document you linked to appears to be for a development board containing the microcontroller, rather than for the microcontroller itself. The latter document will contain the information you need.

Given the 64MHz clock, you have a timing resolution of 15.625nS.

You are still missing the specifications for the PWM hardware attached to the timer.

The maximum PWM frequency you can achieve depends on that hardware. If it's completely programmable and can run at full speed, then theoretically you could produce a 50% duty cycle at 32MHz. However, you'd probably want better resolution than that, maybe 256 levels, which would give you 64M/256 = 250kHz.

If the PWM hardware allows you 32 bits, then the slowest could be 64M/2^32 = 15mHz. That's probably unlikely though, you rarely get more than 16 bits for PWM registers, giving you 976Hz minimum.

But if there's a prescaler involved before the timer, then the minimum rates could be even lower.

You need to find more documentation.