AnsweredAssumed Answered

Free-run timer and time-stamps on the ADSP-21469

Question asked by daniloz on May 24, 2012
Latest reply on May 25, 2012 by Harshit.Gaharwar

Hi All,


I'm trying to implement a free-tun timer to deliver time-stamps on an ADSP-21469.


First of all, I cannot use the internal "core timer" because it's already in use by the VDK. I also cannot use the VDK Ticks because in my system it's set to 0.1ms and I need a much bigger accuracy. I also don't want to change the Ticks period to not have too frequent re-scheduling and other VDK related stuff.


So, what I thought was to use a Peripheral Timer in PWM single-pulse generation and query for the counter to get the time-stamps. However, there're two problem with this approach:


1- it's not a free-run timer, but I could live with that by setting it to the maximum duration and handling it. Although I'd prefer to have a true free-run timer if possible.


2- the biggest problem with this approach is that I cannot read the timer counter to get the time-stamps. As stated in the ADSP-214xx SHARC Processor Hardware Reference (rev. 1.0 from Feb 2012), page, 17-4, in the "Counter Register (TMxCNT)" description, I quote: "The counter should only be read when the respective timer is disabled. This prevents erroneous data from being returned.". The problem is, if I disable the timer to read the counter, when re-enabling it, it starts to count from the beginning again and I loose my time reference.


One more information, I don't want to have frequent interrupts on my system, so I cannot use the timer as a time base and implement the counter in SW. My goal is to have it all implemented in HW, using the already existing Peripheral Timer on the DSP.


Any help is much appreciated,