1

So i understand that a prescaler divides a clock, and PR2 is the period register which when the timer TMR2 reaches the value it increments from 0.

Why is a post scaler needed to divide a non-clock signal.

From the diagram it looks like the post scaler is trying to divide the comparator signal for when the first timer TMR2 reaches PR2 value.

I dont understand, couldnt another timer be used to identify when TMR2 reaches N iterations of reset?

Essentially i dont know what a post scaler performs and why it is used to divide a non-clock signal

enter image description here

Yogi Bear
  • 91
  • 7

1 Answers1

3

This is just an added feature to the timer that allows it to further divide the comparator output by a value from 1 - 16.

Some MCUs have this feature and others don't. It's not strictly necessary but clearly the designers of this one thought it was useful enough that they included it.

Obviously if you set it to "1" it will have no effect.

jwh20
  • 7,917
  • 1
  • 17
  • 28
  • SO is there actually any difference between a prescaler and postscaler except for their positions i guess? – Yogi Bear Jan 08 '21 at 13:56
  • 1
    Well they are both dividers. The prescaler controls how fast the timer clocks. The post-scaler divides the timer output by some value. Overall it just gives you more flexibility in controlling the counters. Personally I have never found a need for the post-scaler in any MCU I have used that had one. But, as is so often the case, there may be multiple ways to get the same result. – jwh20 Jan 08 '21 at 14:05
  • Think of it as a way to reduce the number of interrupt calls – Pete W Jan 08 '21 at 14:47
  • Dude please dont say anything like that because it doesnt help – Yogi Bear Jan 08 '21 at 15:47
  • I just a video and i understand what ti does not – Yogi Bear Jan 08 '21 at 15:51