The PWM and ADC are working separately fine, but not working simultaneously.
I am using AVR studio 4 with compiler optimization disabled.
The program is running timer 2 fast PWM mode in non-inverting mode, and adc channel 0 for feedback from the design, the multimeter shows correct feedback voltage value but controller gives flicker in the design.
The OCR2 must be in the range of 200 to 220 for the correct operation of the design.
milan I have PORTC0 is ADC0 in atmega8, I have just tried to set the DDRC=0x00, to make it as input pin but still it didn't work.
embRTS I have also tried the ISR for the PWM generation but that didn't work so I moved to the timer2 wave generator mode. Now I am retrying the ISR for PWM generation. I will get back soon after testing.
If you need I can upload the schematic?
Thank again for help...