Wonder if someone can hep me out
I'm working on some existing code to generate an interupt every 4096 clock cycles
// CTC with OCR0A as TOP TCCR0A = (1 << WGM01); // clk_io/1024 (From prescaler) TCCR0B = ((1 << CS02) | (1 << CS00)); // Generate an interrupt every 4096 clock cycles OCR0A = 3; // Enable Timer/Counter0 Compare Match A interrupt TIMSK0 |= (1 << OCIE0A);
The interrupt is firing, but I'm not sure of the interval and I think this is for an atmega328p running at 16Mhz
I'm using an Atmega32PB with an external clock source running at 20Mhz.(connected to just the one clock input pin) I've read though the Atmel docs, but it's making my head spin.
Will the above apply for my setup or need I make some changes?
Would be very grateful if someone could enlighten me