Go Down

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

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

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:

https://github.com/MarkEMarkEMark/WS2801MEO

(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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy