Need Help using overflow ISR for Timer 0 & 2 (8 Bit) in arduino uno

I was trying to put ISR for Timer0 & Timer 2 for overflow interrupt. Need help writing ISR

I have tried this one which one was used for timer 1 but not working for both together

ISR(TIMER0_OVF_vect) // ISR for timer overflow { TCNT0 = 0; // preload timer off++; } ISR(TIMER2_OVF_vect) // ISR for timer overflow { TCNT2 = 0; // preload timer on++; }

What is this?

  TCNT0 = 0;                                                                // preload timer

After it overflows it will be zero.

As m newbie Timer counts from o to 255 for 8bit mode So after getting overflow it'll be 0 and again starts counting

M i wrong?

I need to read the timing of ON & OFF time of the signal but cant use the interrupts as need to do the processing on the received message.

So using timer i can receive the proper signals and by the time i can process on the received message

How shud i use timer in such a way to read the on & off time of the signal

try.ino (8.13 KB)

That code does not contain the line:

ISR(TIMER0_OVF_vect)                                                        // ISR for timer overflow

So can you ask the question again?

You asked about using TIMER0_OVF_vect, but when asked to post the code, it did not contain any reference to TIMER0_OVF_vect.

That's like ringing the vet and saying your cat has a problem, and then showing up with your dog instead. Grrr.