how to start running timer and how to use locks in xc langua

If you have a simple question and just want an answer.
User avatar
jeevanicherukuri
Member++
Posts: 17
Joined: Fri Dec 26, 2014 4:41 pm

how to start running timer and how to use locks in xc langua

Post by jeevanicherukuri »

I need to measure time taken by a task to acquire lock from other task which is already using lock. I wrote program using combination of xc and assembly languages. But, the compiler is thinking that assembly mnemonics as constants and showing errors. 

Since i need to access timer i.e. to start and stop timer, is there any syntax in xc language? Also, i need to access lock : any syntax in xc language?

I need to measure that time and get the value in console window.so, i am writing code in xc language.

 

sanjanavee
New User
Posts: 2
Joined: Fri Mar 20, 2015 10:23 am

Post by sanjanavee »

Hi,

There is a lock handling library- 

https://www.xmos.com/download/public/Lo ... rc0.a).pdf

There was no example found pertaining to this but perhaps this would help. And as for timers, you could probably refer to the XMOS Programming Guide under section 3- Timing.

Guest

Post by Guest »

You can find the example for the usage of locks from the following github repository:

https://github.com/xcore/sc_util

Regarding timers, timers are free running 32 bit counters in xCORE architecture. You cannot start or stop a timer. The counter starts from zero when the overflow happens. Hope this helps. You can find mor einformation on XS1 timers in the architecture manual from the following link: 

https://www.xmos.com/download/private/T ... df?acton=1

 

https://www.xmos.com/support/tools/prog ... 53&page=24