Gast
#1134193
hallo
ich habe folgendes problem mit einem atmega8.
diese isr läuft auf einem atmega8 nicht.
*********************************************
ISR (TIMER1_COMPA_vect)
{
LCD_update();
}
void Timer_io_init (void)
{
TCCR1A |= (1 << WGM11) | (0 << WGM10) ;
TCCR1B |= (1 << CS10) | (1 << CS11) | (1 << CS12);
//CLOCKSOURCE;
// Start timer 1.
#if defined(TIMER1_SETUP_HOOK)
TIMER1_SETUP_HOOK();
#endif
// Clear TIMER1 on compare match, CK/1024
OCR1A = 7;
MCUCR = (1 << SE); // TCNT1 Compare Match IRQ app. 60 Hz using
1MHz
TIMSK = (1 << OCIE1A);
sei ();
}
diese routine läuft auf einem atmega168 ohne probleme.
******************************************************
ISR (TIMER0_COMPA_vect)
{
LCD_update();
}
void Timer_io_init (void)
{
TCCR0A = (1 << WGM01);
/*CLOCKSOURCE;*/
TCCR0B =(1 << CS00) | (1 << CS02);
/*
* Start timer 1.
*/
#if defined(TIMER0_SETUP_HOOK)
TIMER0_SETUP_HOOK();
#endif MCUCR = (1 << SE); // TCNT1 Compare Match IRQ app. 60 Hz using
1MHz
OCR0A = 7;
MCUCR = (1 << SE); // TCNT1 Compare Match IRQ app. 60 Hz using
1MHz clock
TIMSK0 = (1 << OCIE0A);
sei ();
}
kann mir einer verraten wieso die routine auf dem einen atmega168 läuft
und auf dem atmega8 nicht.
habe timer1/2 ausprobiert, aber es will kein timer laufen.
die fuses sind wie werkseinstellung.fhb:0xd9 flb:0xe1
für eure hilfe schon mal im voraus vielen dank