Go Down

Topic: [Fixed] Timer on Due not working for me - any ideas? (Read 1 time) previous topic - next topic


Jan 25, 2013, 06:23 pm Last Edit: Feb 17, 2013, 06:14 pm by MarkEMarkEMark Reason: 1

I posted this in the Timer thread, but that seems to have died. Sorry for posting again in a new thread...

I've implemented Sebastian Vik & cmaglie's timer code (http://arduino.cc/forum/index.php/topic,130423.msg1013688.html#msg1013688) . I've got it working as is, with the LED. And I also tried a Serial.println and that works fine too.

However after transplanting the code to something more meaty (a RGB Pixel light string) - the TC3_Handler only executes once.

The LEDs driver is using the hardware SPI channel - could it be anything to do with that? To rule out a clash of interrupts with the LED driver, I tried TC4/5 then TC0, and also only 1Hz - but I still get nothing.

Any ideas? I'll post a video of the lights, if I get it working. (The code works otherwise - if I base the timer on time, it works fine)

I'll post the code, but you'd need the lights to see it:


(note the previous version of the code on GitHub works without the timer)


I know that no one else was currently interested in this topic, but I hate it when I Google a problem, and find an orphan question with no replies. :smiley-mr-green:

I sorted this issue by painstakingly testing every line in the code, to see what broke the interrupt calls.

I found that there was a 'delay(1)' in the LED driver code. I commented this out, and it worked.

So no delays in interrupt code, folks!

Go Up