07-26-2012 08:54 PM
I have a custom built PCB with an LM3S8962 on it. I have timer interrupt 0 running every 100ms and an external interrupt line coming in every second. Is there a way to reset the timer interrupt back to 0 programatically so that my timer interrupt is synced to my external interrupt? Ideally, this would mean that when timer 0 hits 1000ms, it would be synced with the external interrupt line.
07-27-2012 07:56 PM
There is no functionality built into LV for ARM to rezero the interrupt count for timer 0.
Assuming that you just want to have one interrupt running every 100 ms and the other running every 1 s, there are a couple other options for you. You could configure timer1 to trigger every 100 ms, and then have timer1 (in addition to executing other code) trigger an external signal that you route to the trigger for timer0, which you would configure to trigger after counting ten edges. There is an example in the LabVIEW Example Finder (Help>>Find Examples) called Timer Interrupts that illustrates this kind of functionality.
You could also divide down your external 1 hz clock by ten and send that signal to another interrupt, which would guarantee your two interrupts are operating off the same master timebase and synchronized in a 1:10 ratio.
07-29-2012 02:16 PM
Hi Dan, thanks for the suggestions. Let me clarify what my setup is, as I don't think those would work for me. I have a GPS pulse per second signal coming in at 1Hz, which is triggering my external interrupt. I would like my timer interrupt to syncronize with that signal, so essentially my 100ms timer interrupt is slaved/synced to the GPS pps.
Is there a way to do this using inline C if there is no built in Labview method to do it? I'm not as familiar with C, but I could always use the practice.
07-30-2012 10:12 PM
I hope this message finds you well and the Blacksburg summer weather has been good to you.
This is a very excellent question. Sadly, I think the answer is the same old "Yeah, it can probably be done". But I'm not sure how simple or well documented this process would be (which is always the catch right?). Especially within our NI forums as it is very easy to find people with LabVIEW programming experience but not necessarily with C. Especially not so much with respect to the Embedded ARM and Blackfin devices!
So, this may require us to do some outside research. It sounds like the general topic we are exploring is Microcontroller Interrupt Synchronization. It looks like the concept of Gadfly Synchronization is pretty popular as well. Here's a couple cool documents,
Gadfly Synchronization: http://what-when-how.com/microcontrollers/gadfly-s
Interrupt Synchronization: http://what-when-how.com/microcontrollers/interrup
Lollipop's Intro to Microcontrollers 2nd Edition: http://books.google.com/books?id=IbIckVNNu5kC&prin
From what I can tell, it looks like you're looking for something more in line with Interrupt Synchronization. I'll do my best to see if I can't turn up some more reserach on how this might be done for ARM controllers. Sadly, i'm not super familiar with the inline C and registry calls required.
Hope this helps!