Hallo!

Ich will bei einem mega32 den Timer0 verwenden und wenn er überläuft, soll ein Interrupt ausgelöst werden.

Dazu konfiguriere ich den Timer 0 so:


Code:
#include <avr/io.h>
#include <stdlib.h>
#include <util/delay.h>
#include <stdint.h>
#include <avr/interrupt.h>

void timer0_init()
{	
	TCCR0A|=0b00000000;		// Normaler Timer, KEIN PWM	
	TCCR0B|=0b00000010;		// Prescaler auf 8, d.h. alle 0,8us 1x erhöhen
	TIMSK0|=0b00000001;		// Interrupt beim Timer overflow enable

}

Der compiler schreibt folgende errors:

../timer0_init.c: In function 'timer0_init':
../timer0_init.c:21: error: 'TCCR0A' undeclared (first use in this function)
../timer0_init.c:21: error: (Each undeclared identifier is reported only once
../timer0_init.c:21: error: for each function it appears in.)
../timer0_init.c:22: error: 'TCCR0B' undeclared (first use in this function)
../timer0_init.c:23: error: 'TIMSK0' undeclared (first use in this function)


Ich habe mir daraufhin das neueste Datenblatt (März 2009) von Atmel heruntergeladen, und darin steht dass die register TCCR0A, TCCR0B und TIMSK0 heißen.
Meine winavr Version ist auch ganz neu, ich hab sie vor ner woche runtergeladen.

Brauche ich irgendwelche speziellen includefiles? ich hab jetzt einfach mal alles inkludiert weil es nicht funktioniert...

Woran kann das liegen dass der compiler so herumzickt?

lg Christoph