LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

timer services

I am trying to implement the timer services for the Blackfin 537 target.
I am using the 'BF Timer Open.vi' and selecting ADI_TMR_GP_TIMER_0 for generral purpose timer 0.
I then imagine I must use 'BF Timer GP Control.vi' to configure the period etc. and then read back a value.
So far I'm having no luck using BF Timer GP Control.vi' and was wondering how to set up a counter to simply count at a particular rate (wrapping around when it reaches the terminal count).so I can read the value whenever I want.
Maybe I've got the sequence of the BF Timer GP Control.vi commands wrong...I don't have a clue.
Is there any examples of how to use these timers?



0 Kudos
Message 1 of 6
(7,418 Views)
Hi Macbeth,
 
  
0 Kudos
Message 2 of 6
(7,394 Views)

Hi macbeth, sorry for the last msg, I send it without finished....Smiley Sad

I work with GP timers without any problem. There is a program with timers in the examples! To understand the parameter of GP Control Timer VI, see in the Device Driver and System services, page 8-36 and 8-37. If you want a single delay, you can work only with Width register. To read the value of the Counter register, is a good choice to make it through Inline C Node. Smiley Wink

 
The Caribbean
0 Kudos
Message 3 of 6
(7,389 Views)

Thanks C.

I did read through that section but found it a bit vague for what I'm trying to do. I'm not a C programmer.

Basically I want to use a timer to time the duration of another function I have.

For example I want to set up a timer, enable it, execute my function, read the timer, and get the difference between the Start & Stop values to determine the time duration that  my function took to execute.I'd like to do this with microsecond resolution. 

I couldn't find out what the base clock of the timer is or how to change it if possible. I believe it is 133 MHz which is far too fast for my usage.

Thanks.

M




 
0 Kudos
Message 4 of 6
(7,375 Views)

Hi Macbeth,

If you are interested in checking for the performance of your code, I would suggest using the in built cycle counting facility. In VisualDSP++, go to help and search for "Basic Cycle Counting Facility" or START_CYCLE_COUNT. This would be a better way to do benchmarking. Hope this helps.

0 Kudos
Message 5 of 6
(7,362 Views)

Hi Macbeth, Can you solve your problem with the answer of Nitin? If you still interesting in use the GP timers, let me know to help you with the settings. Smiley Happy

See you...!

 

Caribbean

0 Kudos
Message 6 of 6
(7,225 Views)