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.

TMS570LS0332 - prv bit of N2HET

Hello,

On my application, I am using N2HET to generate a periodic interrupt when a rising edge of a square signal is detect on a pin.

This works fine, but at the application start up, with prv bit set to 1 (in the BR instruction with interrupt enabled), if the input signal is already 1 at the time the N2HET is turned on, an interrupt is generated immediately without waitting a rising edge. 

Does the prv bit is really taken into account by N2HET for the first time the instruction with edge detection capability is executed ?

With regards,

JDM

  • Hi Martin,
    N2HET actually uses internal latches to detects the edge. Every NHET pin x has an internal latch Lx, which synchronizes the pin signal to the next NHET loop, and an internal latch Px, which synchronizes it to the next but one NHET loop. Once the instruction is executed it will decode Lx/Px in the following way: If Lx=Px then no edge has occurred, if Lx/Px=0/1 then a falling edge has occurred, if Lx/Px=1/0 then a rising edge has occurred.

    Every time the instruction is executed the previous bit (C25) is updated with the edge detection information based on the Lx/Px. So the previous bit is not used as input information for the internal edge detection.
  • Hi Charles,
    I thank you a lot for your answer.
    With regards,
    JDM