Detailed analysis of timer 0

After working with timers for a bit I started wondering what the difference was between PWM, Fast PWM, CTC and other timer modes.

So with a couple of hours work testing the various modes with the logic analyzer, I present the findings below:

For example:

Phase-correct PWM:

Fast PWM:

The differences between "phase correct" and "fast" are:

  • Phase correct has the cycles centered in the period, whereas with fast mode the edges line up
  • Fast mode operates at twice the frequency (hence it's faster)

See the page mentioned above for example code, and screenshots of other modes.

Very nice... found those tables you've come up with very helpful... Amtel's datasheet does seem to be at its cryptic best in this section :slight_smile:

As a point of interest, one of the practical uses i made once of the signal detection capabilities you've outlined is to detect IR signals of 78khz range from a photodiode+comparator (found in some Aircon remote controls) when I wasn't able to find one of those TSOP1738 type detector ICs for the high freq range.