Тема: ATtiny45 timer1
CTC
void setup(){
DDRB |= (1 << PB0);
PORTB |= (1 << PB0);
cli();
OCR1A = 243; // 0...255 8bit
TCCR1 |= (1 << CTC1); // CTC mode
TCCR1 |= (1 << CS13)|(1 << CS12)|(1 << CS11)|(1 << CS10);// Prescaler 16384
TIMSK |= (1 << OCIE1A);
// (8000000/((243+1)16384))=2,00115266 Hz
sei();
}
void loop(){}
ISR(TIM1_COMPA_vect) {
PORTB ^= (1 << PB0);
}