mchr3k / arduino-libs-manchester

173 stars 113 forks source link

It's doesn't work under attiny25 #22

Open vahadg opened 9 years ago

vahadg commented 9 years ago

(attiny85 too)because:

define F_CPU 8000000UL

if defined( __AVR_ATtinyX5__ )

...

if F_CPU == 8000000UL

  __TCCR1 = _BV(CTC1) | _BV(CS12) | _BV(CS11) | _BV(CS10);__ // 1/64 prescaler
  __OCR1C = (64 >> speedFactor) - 1;__ 

... OCR1A = 0; // Trigger interrupt when TCNT1 is reset to 0 TIMSK |= _BV(OCIE1A); // Turn on interrupt TCNT1 = 0; // Set counter to 0 interrupt does not occur. If OCR1A > 0 It's occur, but It's work not correct