intermediate

Timers, Counters and Clock Arithmetic

Use the hardware timers that sit behind millis(), PWM and tone(): how a timer counts, prescalers and overflow time, compare-match and CTC mode, calculating the compare value for a target frequency, picking a prescaler that fits, fast and phase-correct PWM frequencies, the three timers of the ATmega328P, and notes and frequencies.

65 min

Timers, Counters and Clock Arithmetic

Use the hardware timers that sit behind millis(), PWM and tone(): how a timer counts, prescalers and overflow time, compare-match and CTC mode, calculating the compare value for a target frequency, picking a prescaler that fits, fast and phase-correct PWM frequencies, the three timers of the ATmega328P, and notes and frequencies.

In this lesson:

  • timer
  • prescaler
  • ctc
  • compare match
  • ocr
  • overflow
  • pwm frequency
  • tone
  • atmega328p

🔒 This lesson is part of a paid plan

This lesson is part of the Pro plan. Upgrade to unlock the full lesson, the labs and the exam.

Upgrade Now

Official References

This lesson is part of a paid plan

Upgrade to Pro to unlock this course, its labs and its exam.

View Pricing Plans