CPU, Interrupted — Timers II
When last we spoke on this subject I had left you with a time-accurate but impractical timer interrupt handler. #define F_CPU 16000000 uint8_t Timer_ms = 0; static void initTIMER1( void ) { // CTC mode (WGM1[3:0] = 0x04) TCCR1A = 0; TCCR1B = _BV(WGM12); // CLK/8 prescaler (see datasheet for table) TCCR1B |= _BV(CS11); //… Read More »