I need to program Atmega8/16 with PWM but after certain number of pulses I need to stop the PWM.
I have found working code for PWM on the forum.
// Setup for PWM //fast pwm WGM=6, non-inv mode TCCR1A=0xA2; TCCR1B=(1<<WGM12);
But I am unable to find which interrupt I need to setup to capture the PWM timer overflow (so that I can put a counter in it and disable pwm after certain count).
Could any one point me to some sample code ?