Software :  Reprap Forums The fastest message board... ever.
Here is where to chat about software. RepRap host stuff, PIC/Arduino firmware, AoI, and related stuff. 
[firmware] What is the difference between ISR and SIGNAL?
Posted by: mccoyn ()
Date: November 07, 2009 05:22AM

I'm trying to get the 5D firmware working on my Arduino Duemilanova w/ATMega328. After I changed most the obvious things I uploaded it and ran it. When I watched it with a serial monitor I observed that it repeatedly reset itself, crashing during startup. I narrowed this down to the line that starts up the timer interrupt.

I compared the code in the 5D firmware to this tutorial: [www.avrfreaks.net]

The only major difference I saw was the function signature for the interrupt routine. So I changed the 5D firmware line,

SIGNAL(SIG_OUTPUT_COMPARE1A)

to,

ISR(TIMER1_COMPA_vect)

and it worked. Does anyone know why the SIGNAL code didn't work? Would the ISR version work on the Sanguino and the motherboard? If so, it would be convenient to permanently change this in the firmware.

Options: ReplyQuote
Re: [firmware] What is the difference between ISR and SIGNAL?
Posted by: JohnWasser ()
Date: November 08, 2009 05:49AM

Sounds like the deprecated SIGNAL() macro and "SIG_OUTPUT_COMPARE1A" vector name were not producing a valid service routine. Then when the timer was enabled the un-handled interrupt caused a reset. Changing to the current ISR() macro and current vector name has apparently fixed the problem.

[www.nongnu.org]

Options: ReplyQuote
Re: [firmware] What is the difference between ISR and SIGNAL?
Posted by: joaz ()
Date: November 08, 2009 09:44AM

I've changed that in my firmware. Looks good.

-------------
FiveD Firmware fork (supports Arduino Mega): [github.com]
Reprapsource-Repstrap development Blog: [reprapsource.blogspot.com]

Options: ReplyQuote


Your Name: 
Your Email: 
Subject: 
This forum powered by Phorum.