Dear all,
I found some problem on ATMEGA64, first I'm using only timer0 in output compare mode to make a system basetime every thing work perfectly.
// Base timer using timer0 TCCR0 = (1<<WGM01)|(1<<CS02); OCR0 = BASETIME; TIFR = (1<<OCF0); TIMSK = (1<<OCIE0);
Next step I'm trying to use Timer1 in input capture mode and add code below.
// Base timer using timer0 TCCR0 = (1<<WGM01)|(1<<CS02); OCR0 = BASETIME; TIFR = (1<<OCF0); TIMSK = (1<<OCIE0); // Timer1 input capture TCCR1B |= (1<<ICNC1); TCNT1 = 0; OCR1A = MAX_DATA_LENGHT; TCCR1B |= (1<<CS10); TIMSK |= ((1<<TICIE1)|(1<<TOIE1)|(1<<OCIE1A));
My system not work after add above code. So, I'm trying to find the cause of this issue.
//TIMSK |= ((1<<TICIE1)|(1<<TOIE1)|(1<<OCIE1A));
After I cut above line from my code, my system is work perfectly again.
Has anyone ever found like this issue ? How to solve ?
For more in formation my system are use INT0, SPI, USART0, Watchdog module.
Regards,