Hi, I'm trying to make an script for testing with an basic h-bridge with external HVIC.

I've setup the phase corected pwm on all 3 timers, timer 2 and timer 1 seems to work fine.

timer0 gives me an PWM, but it's not phase corrected anny help ?

DDRB=(1<<PINB1)|(1<<PINB2)| (1<<PINB3); //output

DDRD=(1<<PIND3)| (1<<PIND6)|(1<<PIND5); // output

TCCR2A |=(1<<COM2B1)|(1<<COM2B0);

OCR2A=0;

OCR2B=0;

ICR1=TOP;

TCCR2A ^= (1<<COM2A1); //clear OC2B on compare match up counting, set on down counting

TCCR2B = (1<<WGM20)|(1<<CS20); //phase correct and no prescaling

TCCR1A =(1<<COM1B1)|(1<<COM1B0); //set OC1A at match on up counting, clear on down counting ; Phase correct

OCR1A=0;

OCR1B=0;

ICR1=TOP;

TCCR1A^=(1<<COM1A1); //clear OC1B on compare match up counting, set on down counting

TCCR1B=(1<<WGM13)|(1<<CS10); //phase correct and no prescaling

TCCR0A |=(1<<COM0B1)|(1<<COM0B0); //set OC0A at match on up counting, clear on down counting ; Phase correct

OCR0A=0;

OCR0B=0;

ICR1=TOP;

TCCR0A^=(1<<COM0A1); //clear OC0B on compare match up counting, set on down counting

TCCR0B=(1<<WGM00)|(1<<CS00); //phase correct and no prescaling