Gast
#2610272
Hallo, hat jemand Erfahrungen mit dem ATtiny10 und der Timer-Funktion ?
Hier mein Code:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdint.h>
// Declare your global variables here
ISR (TIMER0_OVF_vect){
TCNT0=60000;
if ((PORTB && 0x2) == 0x2){
PORTB &= ~(1<<PB1);
}
else{
PORTB |= (1<<PB1);
}
}
int main(void)
{
DDRB=0xf;
TIMSK0 |= (1<<TOIE0);
TCCR0B |= (1<<CS00);
TCCR0B &= ~(1<<CS01);
TCCR0B |= (1<<CS02);
TCNT0=60000;
sei();
while (1)
{
PORTB |= (1<<PB0);
PORTB &= ~(1<<PB0);
}
}
Ich möchte den Timer OVERFLOW abfangen, wo ist der Fehler ?
Vielen Danke für Eure Hilfe !
Gruß Luke