UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
5,642 Views
Registered: ‎02-18-2014

Triple Timer Counter Setup

Jump to solution

Using 2014.1 xsdk tools.

zc702 board

 

Big Picture Scope:

 

I'm trying to develop some software that will have timers running in the background that will kick off a few handlers, this is to be done in a linux environment and does not need to be real time.

 

I was reading about the TTC in the TRM and felt like it would do the job.

 

Current Problem:

For most peripherals built in the PS, there has been a driver that came with it. Is there a character/block driver associated with the TTC that i should be able to find in the /dev/ directory?

 

And if there is does someone know of some documentation they can point me to that would fill in the gaps to how to use this? I've spent majority of the day searching and everything i find seems to be for standalone applications.

 

Also, how does the TTC notifiy software? Is it through a hardware interrupt?

 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
Scholar milosoftware
Scholar
8,202 Views
Registered: ‎10-26-2012

Re: Triple Timer Counter Setup

Jump to solution

What I meant was that if you want to run things in Linux based on a timer, you don't need to write a driver. Just write an application that uses the timer functions that Linux already provides (and Linux will use timer hardware under the hood). Just write it so it runs on your PC, and then simply compile it for the board and run it there.

 

Not having to directly interface with hardware is one of the nice features that Operating Systems provide you with.

3 Replies
Scholar milosoftware
Scholar
5,626 Views
Registered: ‎10-26-2012

Re: Triple Timer Counter Setup

Jump to solution

Just use Linux's timer and Linux will take care of the hardware abstraction for you. It uses a TTC already for timing when running on the Zynq.

 

If you insist on using the TTC, you'll have to write your own driver.

 

Most stable way to handle timers in an application is to calculate the time to the next event, and use a condition_timed_wait to block a thread until that time. And you can use the condition to interrupt the timer. If you have a main loop in your application, integrate the timer into that (that's what GUI frameworks always do).

0 Kudos
Explorer
Explorer
4,413 Views
Registered: ‎10-14-2015

Re: Triple Timer Counter Setup

Jump to solution

Hi @milosoftware,

can you explain in more detail how to do that, or can you tell me where to find more information?

 

Basically, I would like to create a simple function that, every time the interrupt triggers, it would set some flags according to the value of the counter. These flags of course should be accesible in userspace

 

Best Regards

Rocco

0 Kudos
Scholar milosoftware
Scholar
8,203 Views
Registered: ‎10-26-2012

Re: Triple Timer Counter Setup

Jump to solution

What I meant was that if you want to run things in Linux based on a timer, you don't need to write a driver. Just write an application that uses the timer functions that Linux already provides (and Linux will use timer hardware under the hood). Just write it so it runs on your PC, and then simply compile it for the board and run it there.

 

Not having to directly interface with hardware is one of the nice features that Operating Systems provide you with.