void init_TC1_pwm(void) { //clear OCnA on compare match, BOTTOM (non-inverting mode) TCCR1A = (1 << COM1A1); //the counting sequence is determined by the setting of the waveform generation mode bits in Timer TCCR1A |= (1 << WGM10); TCCR1B |= (1 << WGM12); //256 presclaer clock select bits TCCR1B |= (0 << CS10) | (1 << CS12); //enable interrupts TIMSK0 |= (1 << OCIE1A); }