cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
446 Views
Registered: ‎11-18-2018

Timer Formula

 Hello friends,

I am using Arty A7-35T, so what's the correct formula for calculating timer speed?.

In this instruction: XTmrCtr_SetResetValue(&TimerCounterInst, TIMER_CNTR_0, TMR_LOAD), I am using the next formula:

(0xFFFFFFFF - TMR_LOAD)/s_axi_clk = Interruption time

If: 

          Interruption time = 1 s

          s_axi_clk = 83.33Mhz

----> TMR_LOAD = 0xFB087C2F

Is this correct?, because I do not get the expected result.axi_timer_0.jpg

Thanks,

 

 

0 Kudos
1 Reply
Highlighted
Scholar
Scholar
361 Views
Registered: ‎02-01-2013

I can't help you with that freaky software stuff, but the AXI Timer can function as an up counter or a down counter. The value you load into it, as well as the expected response time, really depend on which way the counter is counting. 

If you want a timeout to occur in ~1 second, and your time base is 83.333 MHz, you need to load the counter with +83,333,333 or -83,333,333--depending on the direction of timer count. Your formula, above, implies you're expecting an up counter.  You need to confirm that that's how the time is counting. (Check the timer control/status register--TCSRn.)

-Joe G.

 

0 Kudos