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
Visitor acidka
Visitor
323 Views
Registered: ‎08-01-2017

Zynq-7000 TTC counter and RC

Hello all.

 

I have some misunderstanding with TTCs in Zynq-7000. When I started I used this user guide to understand how TTCs with PWM are working. I have to change RC timer in handler so my time intervals would be always different and I have a problem with it.

First time I tryed  to make it with think that if I change RC timer counter would be reset and start to increment from 0 to new RC, but when I realized it I saw a problem: when I am using timer with PWM sometimes I don't have impulses, but have interrupt. Then I tryed to use reset timer counter by bit in XTTCPS_CNT_CNTRL register.

After this I tryed to measure time to all my RCs for timer and I saw that sometimes (about 1 of 5) it become +0.5 seconds when all time is 25 seconds. I thought that may be because I waste too much time at timer handler, some things like count prescaler and write to timer register I used asm insertions. Then I thought that I have to consider counter and I done it at my RC: RC = RC - (counter)<<prescaler, after this I reset counter. And I have to notice if my RC is smaller then counter<<prescaler then RC would be my Match_value. Some part of RC would be lost because of prescaler and I notice it by new variable which would be add to new RC.

Now it seems to have stable error, but there is something I haven't noticed because by same amount of RCs (before subtraction counters) I use to 2 timers don't end at one time. Can someone say for me what is my error?

 

Thanks.

0 Kudos