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.

TMS570LS1114: counter

Part Number: TMS570LS1114
Other Parts Discussed in Thread: HALCOGEN

Dear support team,

    I want to measure fast pulse frequency.  I want to ask a question is about whether TM570L1114 has ability to count pulse in a fixed time margin. Then I can calculate pulse frequency f=T/N.

I expect the action of counter  would not cause interrupt.

  • Hello,

    The eCAP can be used to measure the frequency and duty cycles of the input pulse signal.

  • Hello QJ,

    thank you for your fast reply.

    I know eCAP can measure the frequency and duty cycles of the input pulse signal,but it can only realize it in interrupt.  Under high frequency condition, it will cause system enter interrupt service frequently, and delay other services on time.  So I worry about it. Then I want to find a counter which can run background ,then i can use T/N method.

    Thanks and Regards,

    user_CAP

  • You can use ecap one-shot mode, and pool the status and read the ecap registers.

    another way, you can N2HET to capture the frequency and duty cycles. The N2HET works as a co-processor. 

  • Hello QJ,

    Interesting idea. 

    First my system is a tight time system which can identify frequency value in (5ms + pulse rising edge). So i always use ecap continuous.

    How to use N2HET to capture the frequency and duty cycles, this co-processor will cause interrupt too. Please in detail!

    Thanks and Regards,

    user_CAP.

  • Hi,

    The N2HET consists of a specialized micromachine that operates a reduced instruction set. The instruction set is listed at the end of N2HET chapter of TRM.

    You can implement timer functions by combining instructions in specific sequences. A simple PWM generator can be implemented with a two instruction sequence: CNT and compare (ECMP or MCMP). A ecap capture function can be implemented using PCNT instruction. You can use either polling mode or interrupt to read the captured data.

    Please read N2HET chapter for details.

    The HALCoGen generates example code for PWM, eCAP, and edge detection:

  • Hello QJ,

         I think I have to work hard to understand and practice N2HET and ECAP functions. I will ask again if I have any questions in the future,  thanks for your reply. 

    Best regards!

    user_cap

  • Hi user_cap,

    I will close this thread. For any question in the future, you can re-open this thread or create a new thread. Thanks