From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset Interrupt Timer 0 on LM3S9862

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.

 

Thank you.

0 Kudos
Message 1 of 4
(6,047 Views)

Hi Mumansky,

 

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.  

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 2 of 4
(6,033 Views)

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. Smiley Happy

 

-Mark

0 Kudos
Message 3 of 4
(6,028 Views)

Hey Mark,

 

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-synchronization-microcontrollers/

Interrupt Synchronization: http://what-when-how.com/microcontrollers/interrupt-synchronization-microcontrollers/

Lollipop's Intro to Microcontrollers 2nd Edition: http://books.google.com/books?id=IbIckVNNu5kC&printsec=frontcover#v=onepage&q&f=false

 

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!

Tim A.
0 Kudos
Message 4 of 4
(6,023 Views)