Online calculator to calculate the timer in CTC mode

Zápisník experimentátora

Hierarchy: Časovač (timer)

To calculate the timer setting in CTC mode, see the previous article. It is not complicated, the problem is to set up all registers correctly. For each timer in Arduine, the setting differs. To avoid having to remember all the settings, I've written an online app that will do this for you.

CTC Timer Calculator

On the Internet, you can find more of these calculators, but none of them generates a valid sample code directly for Arduino. Here are my settings:

  • Frequency of the Arduino - Usually it is 16 MHz.
  • Microcontroller - Currently only ATmega328P can be used.
  • Required Timer - 0, 1 or 2. Timer0 affects internal time functions.
  • Required frequency - Frequency of interrupts.

The result is the source code that flashes the usual LED on pin 13. If you use the example, you will get a flicker on a frequency of 1 Hz. Copy this code to IDE Arduino and test it.