Hi,
I have got a dozen of Arduino mini Pro clones havin an ATMEGA168 instead of the ATMEGA328.
My code compiles without error and loads once I have changed the processor type to ATMEGA168 7 3,2V 8MHz.
Sketch uses 8138 bytes (56%) of program storage space. Maximum is 14336 bytes.
Global variables use 420 bytes (41%) of dynamic memory, leaving 604 bytes for local variables.
Maximum is 1024 bytes.
But it does not run, like it does on the ATMEGA328.
Can it be that the interrupt processing is another one?
//set timer2 interrupt at 2kHz
TCCR2A = 0;// set entire TCCR2A register to 0
TCCR2B = 0;// same for TCCR2B
TCNT2 = 0;//initialize counter value to 0
// set compare match register for 2khz increments
OCR2A = 249;// = (16*10^6) / (2000*32) - 1 (must be <256)
// turn on CTC mode
TCCR2A |= (1 << WGM21);
// Set CS20 , CS 21 and CS22 bit for 128 prescaler
TCCR2B |= (1 << CS22) | (0 << CS21) | (1 << CS20);
// enable timer compare interrupt
TIMSK2 |= (1 << OCIE2A);
sei();//allow interrupts