avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Issue with interrupt handler on Atmel Mega 8


From: Jerome Kerdreux
Subject: [avr-gcc-list] Issue with interrupt handler on Atmel Mega 8
Date: Tue, 1 Nov 2005 17:52:57 +0100

I'm trying to use the timer 0 on a mega 8.  Everything works fine, 
(I mean, i can see the timer TCNT0 incrementing) but when I want 
to route the interrupt to an handler, I get a infinite reset. 


Here a snipset of the code (full code, is attached) 

SIGNAL(SIG_OVERFLOW0)
{
  uptime ++;
  return 0;
}

void inittimer()
{
 // 1024 prescaler 
  sbi(TCCR0,CS02);
  cbi(TCCR0,CS01);
  sbi(TCCR0,CS00);

  // set the interrupt handle
  sbi(TIMSK,TOIE0);
  uptime = 0;
}



If I comment the sbi(TIMSK..) all works fine. What can I do to fix
that .? 


Thanks for any help.

Attachment: test_avr.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]