Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

8-bit Timer/Counter0 operation modes.Part1

As our selected Atmega328 microcontroller has three timers, I think it is best to analyze them separately. Timer/Counter0 is probably mostly used timer in various applications. It is capable of operating as a simple counter, frequency generator including PWM, external source clock counter and can generate tree interrupts: one overflow (TOV0) and two independent output compare match interrupts (OCF0A and OCF0B). As you see Timer/Counter0 register, TCN0 has two 8 bit double buffered Output Compare Registers (OCR0A and OCR0B) associated that can be used to generate two different waveforms on microcontroller pins OC0A and OC0B and two interrupts (OCF0A and OCF0B) as well. Each timer interrupt can be enabled individually in TIMSK0 register by setting bits to one. TIFR0 register holds bits indicating interrupt request signals. And of course, there… Continue reading