/* pwm_1khz_02.c ATmega88 @ 1MHz */
#include <avr/io.h>

int main(void)
{
	DDRB |= (1<<PB1);	// OC1A = output
	ICR1 = 1000;		// Top Value = 1000
	OCR1A = 700;		// Compare Match bei 700
	
	// Clear OC1A on Compare Match
	TCCR1A = (1 << COM1A1) + (1 << WGM11);
	
	// Mode 14, Fast PWM, OCR1A = TOP, Prescaler = 8
	TCCR1B = (1 << WGM13) + (1 << WGM12) + (1 << CS11);
	
	while(1)
	{
		asm ("NOP");	// Nichts tun
	}
}