Skip to content

avr timer counter

serhij.zolotukhin edited this page Dec 7, 2025 · 1 revision

======================================================================================================================= ATtiny13A

Busy loop example code:

https://exploreembedded.com/wiki/AVR_Timer_programming

Timer/Counter: 0x32 TCNT0 Timer/Counter (8-bit) - The TCNT0 register hold the timer Count and it is incremented on every timer "tick". 0x36 OCR0A Timer/Counter – Output Compare Register - that a value can be set in the Output Compare Register (OCR0), and whenever TCNT0 reaches that value, the Output Compare Flag (OCF0) flag is Set. 0x2F TCCR0A COM0A1 COM0A0 COM0B1 COM0B0 – – WGM01 WGM00 0x33 TCCR0B FOC0A FOC0B – – WGM02 CS02 CS01 CS00 - The configuration of the Timer can be set using the * The Frequency of the Clock Source with CS02, CS01, CS00 bits. (Clk, Clk/8, Clk/64 ... )

0x38 TIFR0 – – – – OCF0B OCF0A TOV0 – Timer/counter Interrupt Flag Register(TIFR) * Output Compare Flag (OCF0) ? * Timer OverFlow Flag(TOV) ?

My side bar

Clone this wiki locally