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.

CCS / TMS570LS1224:N2HET capture pulse timestamps and number of pulses

Part Number: TMS570LS1224

Tool/software: Code Composer Studio

I want to calculate the frequency by N2HET, but sometimes the frequency is too low, a calculation cycle may not have a pulse. I should calculate the frequency by pulse timestamps and number of pulses. How to capture pulse timestamps and number of pulses by N2HET?

  • Hello,

    The PCNT instruction can be used to capture the high/low pulse time or periods of the input pulse stream.

    L01  PCNT { next=L02, type=rise2fall, pin=0 }

    L02  PCNT { next=L03, type=fall2rise, pin=0 }

    L03  PCNT { next=L01, type=rise2rise, pin=0 }

    The L01 PCNT is to capture the high pulse on the pin 0 and the L01 PCNT captures a low pulse on the same pin, the L03 PCNT captures the period of the pulse on pin 0.