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.

N2Het Edge Interrupts

Other Parts Discussed in Thread: HALCOGEN

Hi there,

I'm using RM46.

I want to use HET-Pins as 'normal'  input pins (like GIOA) with interrupt capability (falling or rising edge)

- is it possible to configure HET1 module (with HalCoGen) to generate interrupts on rising/falling edges WITHOUT writing any N2HET code?

- if YES:
Are there really maximum timing restrictions for edge-detection-interrupts (see user manual 23.2.5.8 Edge Detection Input Timing) in this case?

Best regards, Andy

  • Andy,

    The "Edge 0-7" and "Edge Interrupts" pages in the HalCoGen HET tabs should do the trick for generating the interrupt.

     However, the instruction that is used is ECNT which is a loop resolution instruction.   So you will need to make sure your minimum pulse width (pulse width high or pulse width low) is greater than a loop resolution period or else the edge might be missed.

    Last comment - You can always read the IO pin state while the HET is running the edge detect program, through the HETDIN register.  Mentioning this because you said you want similar behavior as the GIO module.

    EDIT:  The resolution limit due to ECNT is due to the particulars of the stock HalCoGen HET program.  So you can relax this limit but you have to change the program to a custom one which you mentioned you want to avoid.  Just clarifying.
    At some point I think you'll probably find it worthwhile to learn to program HET.   The HET IDE is a great place to start and includes template code for functions like 'PWM' and tutorials that you can run.

  • I am also trying to use the Halcogen utility to do a simple GPIO-like edge detection to generate an interrupt and am having some difficulty.  I'm currently operating on the TMS570 HDK 1227 flavor, using HalCoGen 03.06.00.


    1) I configure edge0 under HET1 tab, "Edge 0-7" and "Edge Interrupts", enable interrupt, rising edge, on NHET[4]. I have tried this with both the high-level and low-level interrupt selected.  See #3 below.

    2) I configure NHET[4] under the HET1 tab, "Pins", to be input.

    3) I enable the HET high level and HET low level interrupts under the VIM tab.

    4) Generating the code in Halcogen, both the Het1LowLevel interrupt ISR and Het1HighLevel interrupt ISR are generated, and contain the edgeNotification() function call.

    5) I call the enable notifications API for edge

    6) My input signal on NHET[4] is >> the loop resolution (currently set <100ns, the signal is 25us wide)



    With all this, neither the low level nor high level het edge ISRs are triggered.  I verify that the INTENAS is set to 0x020000 for edge0 notifications.  I can see the DIN register go from 0x0000 to 0x0010 so NHET[4] is seeing the data edge but it never makes it to INTFLG.

    What am I missing?

    Thanks in advance,

    Joe Shidle

  • I now have edge detection working.  The problem seems to be that I was running my loop resolution timer too short at ~90ns (prescalar 3).

    This was causing the overflow exception in HETEXC2 (bit 0) to get set which per the spec will shut down interrupts and/or not set the INTFLG bits.

    Increasing the loop resolution to 360ns (prescalar 5) alleviates this problem, allowing the INTFLG to get set and my het1HighLevel ISR is called.

    Thanks for your time,

    Joe Shidle

  • Joe,

    It sounds like you have figured out the issue.  Am I correct in thinking this?

    If not, please let us know.  Thank you.