I'm having trouble getting this timer code (adapted from the OSCCAL function in the butterfly gcc code). It doesn't really seem to go at all when I call it with 50000 (microseconds). Any ideas? Thanks!
void pause(unsigned int microsec) { cli(); // mt __disable_interrupt(); // disable global interrupt TCNT1 = 0; // clear timer1 counter CLKPR = (1<<CLKPCE); // set Clock Prescaler Change Enable // set prescaler = 16, Inter RC 16Mhz / 16 = 1Mhz CLKPR = (1<<CLKPS2); OCR1A = microsec; TCCR1B = (1<<CS11); while ( !(TIFR1 & (1<<OCF1A)) ); TCCR1B = 0; sei(); return; }