Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
2 answers
821 views

How do I measure a pulse width using the ATmega328P interrupts and timers?

I am using an ATmega328P MCU with an 8 MHz internal oscillator. I need to measure the pulse width of an incoming pulse. The frequency of this pulse is approximately 500 Hz. Once every 2 ms, one pulse ...
turqay mammadov's user avatar
0 votes
1 answer
3k views

How to set two timers running at the same time in atmega328p?

I want to set up two timers running two ISR-s with different resolutions. One timer for counting milliseconds for clock time, another for counting microseconds when ...
flowian's user avatar
  • 109
0 votes
1 answer
869 views

How to use two timers for one interrupt vector on avr?

I want to use timer1 and timer2 for same vector TIMER#_COMPA_vect isr on atmega328p. Idea is to start and stop one when requested, for time sensitive functions. And ...
flowian's user avatar
  • 109
1 vote
2 answers
6k views

Arduino Atmega328 sleep mode with internal timer interrupt

I am trying to reduce the current consumption of my Atmega328 -Arduino- by using the sleep modes. In my code, I want to wake-up every 10ms, read the value from ADC, ...
Farzad's user avatar
  • 11