cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
2,103 Views
Registered: ‎07-30-2016

Zynq TTC Queries

Hi

 

I am working with seL4 microkernel on Zedboard. I am writing a timer driver to access the onboard TTC. While doing so , I have gone through the Zynq Manual but it has very limited description about the details of registers and values. I am confused about some keywords as well after looking at general examples. 

 

i) Prescaler -> I know that prescaler acts as a divider of clock. So you can increase the number of clock cycles before a count is done in the ttc. But the SDK explains prescaler as follows:

 

* This function sets the prescaler enable bit and if needed sets the prescaler
* bits in the control register.
*
* @param InstancePtr is a pointer to the XTtcPs instance.
* @param PrescalerValue is a number from 0-16 that sets the prescaler
* to use.
* If the parameter is 0 - 15, use a prescaler on the clock of
* 2^(PrescalerValue+1), or 2-65536.
* If the parameter is XTTCPS_CLK_CNTRL_PS_DISABLE, do not use a
* prescaler.
*
* @return None

So , assuming I am running Zynq at 100 Mhz and I have given prescaler value as 4 to this function. So does the counter increment ever 2^4 cycles ( at every 100/16) or does it increment at every 2^5(100/32).

 

ii) This confusion arises from the fact that the Clock Control Register (XTTCPS_CLK_CNTRL_OFFSET ) as defined in zynq manual states that this controls Controls prescaler, selects clock input, edge . Can someone guide me to a document or know the exact division of this 32 bit register to those values. {example CCR [1:0] represents what?}

 

iii) Some of the examples I have seen defined something called output frequency, it is not a parameter or register to the TTC. What is this output frequency used for and how does it affect the counter?

 

If someone can help me out, I would be very grateful. I am stuck on this for a while now.

 

Thanks

Neelesh

0 Kudos
0 Replies