'TCCR0' was not declared in this scope (Timer Int)

Hi,

For a reason I have an error "'TCCR0' was not declared in this scope"

void setupTimer()
{
 
   TCCR0|=(1<<CS02)|(1<<CS00);  // Prescaler = FCPU/1024
   TIMSK|=(1<<TOIE0);               //Enable Overflow Interrupt Enable
   TCNT0=0;                                //Initialize Counter
   countTimer=0;                           //Initialize our varriable
   sei();                                    //Enable Global Interrupts
}

I have at the top of the file :

//For the timer (interrupt)
#include <avr/io.h>
#include <avr/interrupt.h>

What do I need to do? I have open the datasheet of the AVR168 and I see that it's not TCCR0 but TCCR0A or TCCR0B, the same thing occur for TIMSK that doesn't exist but in the datasheet, I see TIMSK0. Once I change TCCR0 for TCCR0A and TIMSK for TIMSK0, I have new errors:

C:\Users\Patrick\AppData\Local\Temp\build12295.tmp\core.a(wiring.c.o): In function `__vector_16':

C:\Program Files (x86)\arduino\hardware\cores\arduino/wiring.c:31: multiple definition of `__vector_16'

o:C:\Users...\Temp\build12295.tmp/Temporary_6849_6762.cpp:57: first defined here
Couldn't determine program size: C:\Program Files (x86)\arduino\hardware/tools/avr/bin/avr-size: 'C:\Users...\Temp\build12295.tmp\MatrixMain.hex': No such file

Any advice?

Edit:
[edit]
When I remove the function ISR(TIMER0_OVF_vect), all compile... what's wrong with ISR(TIMER0_OVF_vect)?
[/edit]

The latter issue is an unintended side-effect of how recent versions of the IDE compile/link code. I think (hope) it will be fixed in the next release.

--Phil.

So we can't use Timer with Arduino? :-/

Timer0 is used for the Arduino millis and delay functions defined in wiring.c. Try timer1 or timer2.

Thank you, Timer 2 works.