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 interrupt API for RM46

Other Parts Discussed in Thread: HALCOGEN

I have been going over the code generated by HALCoGen. I have not seen a prototype for a hetNotification function/ISR as I have seen for other modules. I do see pwmEnableNotification functions but since I am using a custom N2HET program I am not sure that would work. Using the API, is there a way to make and register the ISR? Or do I have to resort to Register transfers? Finally is there some sort of configuration in HALCoGen that I am missing?

  • Please take a look at the following two application report as references for how to use N2HET. Ha;cogen only provides the basic functions.

    www.ti.com/.../spna220.pdf
    www.ti.com/.../spna217.pdf

    Thanks and regards,

    Zhaohong
  • I went through these, but they dont show how to raise an interrupt from a N2HET instruction.
  • Take a look a the default NHET example from Halcogen. It shows how to enable interrupt from a NHET instruction. You also need to check the NHET section of the TRM.

    Thanks and regards,

    Zhaohong

  • Hi,

    The ISR functions het1LowLevelInterrupt() and het1HighLevelInterrupt() only become visible in het.c if you enable the corresponding VIM channels (channel 10 and channel 24) in the "VIM Channels" tab.
    pwmEnableNotification() will not work for a custom N2HET program.
    For the N2HET, the Interrupts are tied to the instruction numbers. If a particular instruction with interrupt enabled (lets say instruction number 3) has generated an interrupt, and the corresponding bit(3rd bit for instruction 3) is set in HET INTENAS register, then the ISR is called. You can check the TRM(section N2HET Module -> N2HET Functional Description -> Interrupts and Exceptions)  for more info.

    HALCoGen does support an "Advanced Config mode" which lets you upload your own HET program(.c,.h files). You can find the option in the HET Global Timing configuration tab. It also lets you statically configure the HET interrupt settings for your program. 

    This appnote(spna225) might help in understanding the HALCoGen HET program.

    Thanks and Regards,
    Vineeth