/* pwm_phasecorrect_01.c ATmega88 @ 8MHz */
#include <avr/io.h>

int main(void)
{
	DDRB |= (1<<PB1);	// OC1A = Ausgang
	ICR1 = 1000;		// ICR = Top Wert bei 1000
	OCR1A = 750;		// Compare Match für OC1A bei 500
	
	// Mode 10: PWM, Phase Correct, Prescaler = 8, Clear OC1A on compare match
	TCCR1A = (1 << COM1A1) + (1 << WGM11);
	TCCR1B = (1 << WGM13) + (1 << CS11);
	
	while(1)
	{
		asm ("NOP");	// Nichts tun
	}
}