06-28-2010 04:22 PM
I have successfully run the timed loop example for the blackfin. I created an almost duplicate vi...and it doesn't run. My program runs and allows the user to press one button and the corresponding LED illuminates. After that, there seems to be no action.
Any suggestions?
Thanks.
06-29-2010 03:59 PM
Hummer1,
I assume that you used the BF537 Timed loop callback.lvproj shipping example as your basis (?). Your Main Timed Loop.png shows that you are getting your callback VI Reference from "Timmed Interrupt from Clock.vi". Is this the Timed Interrupt Handler for Loop.png? I didn't know if you were pointing to the correct interrupt VI.
I know that in general that you want to spend as little time as possible in the interrupt VI and I wonder if checking the button is pushing it to the limit for some reason. What happens if you just have the Global.VI and Fire External Timing Source.VI code in the interrupt VI and move the BF Get Button Pushed.VI to the main timed loop. Does the functionality work then?
06-29-2010 04:18 PM
The BF Get Button Pushed.vi can only be used in the interrupt vi.
I ran the example as provided to make sure that I had all the build options set right...and it ran ok.
When I tried to build it using "from scratch" using the exact same elements, it ran, but when the first button was pressed, the LED came on, but never extinguished...(looks like there is only the first interrupt created.)...I thought that it might be because the example doesn't clear the button, so I added the clear button (but to do that I had to know which button, so I added the BF Get Button Number from the previous example, which worked.).
This one does the same thing...builds, runs, first button push lights LED, second and all subsequent button pushes ignored.
And, yes, Timmed (sp) interrupt from clock is the ISR that I wrote as the interrupt handler...which is designated in the interrupt vi. properties of the right click on the ADSP build object.
Interesting.
Hummer 1
06-29-2010 04:22 PM
It is named properly in the Project file ...
06-29-2010 04:29 PM - edited 06-29-2010 04:29 PM
Hummer1,
What was the functionality you saw from the shipping example? Did the LED flash everytime you pressed a button or just everytime you ran the ISR.vi? I don't have a BF537 at my desk right now to check this out myself. Does your built application stop only when a certain button is pressed (meaning if you press button 2 instead of 1 does it still appear to not run anymore)?
06-29-2010 04:33 PM
The example worked correctly, each time a button (any button) was pressed, the LED number 1 changed state.
When mine runs, the first time you press a button (any button) LED number 1 changes state from off to on. The system is unresponsive after that.
Hummer 1
PS...I think this is the same ISR but with the name correct on the PNG file to avoid confusion.
06-29-2010 04:36 PM
I did notice that the processor choice on the timed loop in the example was set to 0. In my program, I have tried to set it to 0 and have also left it at -2. Either way produces the same result.
Hummer1
06-29-2010 04:37 PM
Hummer1,
Two things:
1) Try using "0" instead of "-2" for the CPU infinity on the Timed Loop
2) If you run the code in debug mode, does the Numeric global VI correctly see what button was pressed?
06-29-2010 04:37 PM
Nevermind on #1
06-29-2010 04:38 PM
As to the global variable, I don't know. Let me try that. I believe at this point it will work on the first press and not on the following...but let me check.