hi
danke erstmal

beide fehler behoben
neuer code:
Code:
#define F_CPU 4096000

#include <avr/io.h>
#include <avr/interrupt.h>
#include <inttypes.h>
#include <stdint.h>

int16_t timer=0;
int8_t status=0;


void initTimer(void)
{
	TCCR0B |= (1<<CS00)|(1<<CS02);
	TCNT0 = 0;  
	TIMSK |= (1<<TOIE0);
}

void initInterrupts(void)
{
	sei();
}

ISR(TIMER0_OVF_vect)
{
    timer=timer+1;
}

int main (void) 
{
   initTimer();
   initInterrupts();
   DDRB = 0xff;

   while(1) 
   {                
	if(timer>=4000)
	{
		timer=0;
		if(status==0)
		{
		PORTB = 0xff;
		status=1;
		}
		else
		{
		PORTB = 0x00;
		status=0;
		}
	}

   }                       
   return 0;
}
leider läuft der debugger nun die ganze zeit durch die interrupt funktion und setzt auch nicht den port bei einem timer größer als 4000 um (arbeitet die if funktion nicht ab).

brauche also nochmal hilfe