This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Obtaining a high resolution using the HET timer

Other Parts Discussed in Thread: HALCOGEN

Hi, 

We wish to utilize the full 32 bit resolution of the N2HET global timer. By default, it gives us only 25 bits of resolution. We tried changing the following driver settings in Halcogen to increase the resolution : 

So we changed the loop time to make it equal to that of the main clock. But when we program the microcontroller and use the hetGetTimestamp instruction while debugging, it always returns a zero ! 

Are there any other settings we are missing out on?

Thanks,

Abhishek.

  • Hello Abhishek,

    I have forwarded your post to one of our NHET experts so they can discuss your implementation and possible solutions.

  • Abhishek,

    The CNT instruction in NHET can only count to 25 bit.  Normally, the NHET program will increment the counter value in every LRP loop.  The LRP loop is the one that can be configured by the Halcogen.  The LRP loop defines how many cycles it takes to executes all instructions in that loop.  

    I am not very clear on what resolution you are talking about.  What is your application and what is your definition of your resolution?  what do you want NHET to accomplish for you.

  • Hi Henry,

    By high resolution, I mean that I want the NHET timer to increment by 1 after each clock cycle of the main clock. Currently it increments by 128  in a single step after 128 cycles of the main clock. So I concluded that it assumes the least significant bits to all be equal to zero. 

    For my application, I need to note the precise difference between two events in terms of clock cycles. Currently that difference appears as 0 for anything between 0 and 127, 128 for anything between 128 and 255, and so on.

    So it would be great if I could get the timer to increment at a frequency equal to that of the system clock. As I mentioned in my previous post, I simply tried increasing the frequency of the NHET timer using Halcogen. But then the NHET timer started giving just zero for all time! Are there any settings I'm forgetting?

    Thanks and Regards,

    Abhishek.

  • Abhishek,

    There's a similar question here:

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/309426/1077232.aspx#1077232

    With perhaps a little more explanation about your LRP/HRP = 0 issue.

    For your need - are the two events on the same pin? If so then you can use the CAP function (PCNT based) that comes w. the HalCoGen program to achieve what you want.