cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
4,668 Views
Registered: ‎05-28-2014

Timer - XTmrCnt API

Jump to solution

Hi,

 

 I'm using MicroBlaze with standalone BSP, and I'm trying to figure out how to use the timer.

I have expected some API which do start/stretch timer in resolution of milliseonds, but could not find such API.

I observed the example generated with the BSP, and see that there is start and stop API but no time expired. There is only RESET_VALUE, which I don't understand it's meaning in time terms.

 

I would also like to ask if there is any pdf documentation guide for the software APIs , and  for HW timer device (I opened microblaze processor reference guide and did not find section for timer).

 

Thanks very much,

Ran

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
6,032 Views
Registered: ‎09-05-2011

Re: Timer - XTmrCnt API

Jump to solution

Are you working on an AXI based or PLB based system?

If using AXI Timer, the axi timer attaches itself as a slave to an AXI-Lite interface and operates on s_axi_aclk clock. 

 

In SDK, to check the frequency at which the timer operates, you can follow the steps below:

 

1. In SDK workspace, File > New > Board Support Package

2. Select Standalone as 'Board Support Package OS' and click finish

3. Open the xparameters.h file. For a Microblaze based project, you will find this file in standalone_bsp_0 > microblaze_0 > include folder.

4. Look for the definition for peripheral AXI_Timer_0. You will see the parameter that defines the timer clock frequency in HZ. 

 

tmrctr.png

View solution in original post

0 Kudos
5 Replies
Highlighted
Xilinx Employee
Xilinx Employee
4,667 Views
Registered: ‎08-02-2007

Re: Timer - XTmrCnt API

Jump to solution

Hi,

 

The information about the API's is available in the location

 

SDK_Install\sw\XilinxProcessorIPLib\drivers\tmrctr_vx_xx_x

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Explorer
Explorer
4,665 Views
Registered: ‎05-28-2014

Re: Timer - XTmrCnt API

Jump to solution

Hi Hem,

 

Thanks for the quick response,

I am trying to figure out how to set the timer in time resolution (milliseconds)

XTmrCtr_SetResetValue()  API is configuring "reset value" into timer counter. What is the meaning of this value in time reoslution ?

 

from API documentation:

Set the reset value for the specified timer counter. This is the value that is loaded into the timer counter when it is reset. This value is also loaded when the timer counter is started."

 

Thanks,

Ran

0 Kudos
Explorer
Explorer
4,650 Views
Registered: ‎05-28-2014

Re: Timer - XTmrCnt API

Jump to solution

Hi,

 

I now se ethat this question already been asked and answered.

The 

 

http://forums.xilinx.com/t5/Embedded-Processor-System-Design/XPS-Timer/m-p/46649/highlight/true#M1717

 

I understand now that it depends on the frequency that is fed into XPS timer.

But how can I retrieve this info ?

I opened the .xm file in SDK, but can't find this info inside.

 

Thanks,

Ran

 

0 Kudos
Highlighted
Scholar
Scholar
6,033 Views
Registered: ‎09-05-2011

Re: Timer - XTmrCnt API

Jump to solution

Are you working on an AXI based or PLB based system?

If using AXI Timer, the axi timer attaches itself as a slave to an AXI-Lite interface and operates on s_axi_aclk clock. 

 

In SDK, to check the frequency at which the timer operates, you can follow the steps below:

 

1. In SDK workspace, File > New > Board Support Package

2. Select Standalone as 'Board Support Package OS' and click finish

3. Open the xparameters.h file. For a Microblaze based project, you will find this file in standalone_bsp_0 > microblaze_0 > include folder.

4. Look for the definition for peripheral AXI_Timer_0. You will see the parameter that defines the timer clock frequency in HZ. 

 

tmrctr.png

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
4,638 Views
Registered: ‎05-28-2014

Re: Timer - XTmrCnt API

Jump to solution

Got it, Thanks very much!

0 Kudos