NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » timer/counter modules interrupts

April 07, 2011
by sask55
sask55's Avatar

I have a question about Atmega168 and 328p timer/counter modules, specifically the interrupt handlers. In

http://www.nerdkits.com/forum/thread/786/

forum thread Mike advises to “1) Change the name of the interrupt handler from SIGNAL(SIG_OUTPUT_COMPARE0A) to the new notation ISR(TIMER2_COMPA_vect).” I was unable to get my code that worked fine on a 168 to run on a 328p without changing the interrupt handlers to the new notation. Other than the fact that one handler is using the #0 timer and the other is using the #2 timer what is the difference between these two notations?

ISR(TIMER2_COMPA_vect).

SIGNAL(SIG_OUTPUT_COMPARE0A)

Am I missing something or is this a bit of code that may not be completely interchangeable between the two chips? More specifically why did the SIGNAL(SIG_OUTPUT_COMPARE0A) not seam to work when I loaded it on to a ATmega 328P?

Darryl

April 07, 2011
by Noter
Noter's Avatar

Bretm has a good answer on this thread - http://www.nerdkits.com/forum/thread/1447/

Post a Reply

Please log in to post a reply.

Did you know that a microcontroller can measure an RC time constant? Learn more...