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.

RM48L952: IRQ assembly handler

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

Hi, I am attempting to write an IRQ assembly handler. The handler calls a function defined in under mode to turn an LED on. The context switch occurs correctly, but the IRQ is not firing correctly for the time period I have set in Halcogen. When I debug step by step I see that the interrupt flags in HET and VIM registers are not getting cleared. Can you guide me on what flags are to be cleared and where I should do them to ensure the IRQs are firing properly? I attempted to clear them after which the IRQs stopped firing.

Regards,

Smruthi

  • Hello,

    When the interrupt condition in an instruction is true and the interrupt enable bit of that instruction is set, an interrupt flag is then set in the N2HET Interrupt Flag Register (HETFLG). The address code for this flag is determined by the five LSBs of the current timer program address. The flag in the N2HET Interrupt Flag Register (HETFLG) is set even if the corresponding bit in the N2HET Interrupt Enable Set Register (HETINTENAS) is 0. To generate an interrupt, the corresponding bit in the N2HET Interrupt Enable Set Register (HETINTENAS) must be 1.
    In the N2HET interrupt service routine, the main CPU must first determine which source inside the N2HET created the interrupt request. This operation is accelerated by the N2HET Offset Index Priority Level 1 Register (HETOFF1) or N2HET Offset Index Priority Level 2 Register (HETOFF2) that automatically provides the number of the highest priority source within each priority level.

    Clearing the flag can be done by writing a one to the flag. Alternatively reading the corresponding Offset Index Priority Level 1 Register (HETOFF1) or Offset Index Priority Level 2 Register (HETOFF2) will automatically clear the flag. If the offset registers are not used by the N2HET interrupt service routine, the flag should be cleared explicitly by the CPU once the interrupt has been serviced.

  • Yes I am reading the NHET Offset register in the c routine that I call from the IRQ assembly function. But this still does not solve the problem. Also, the code runs only in debug mode. If I try to simply load the program and run it, the IRQ is not generated as in my handler I am toggling an LED which does not happen at all. Is there any reference IRQ assembly code that I can look at for comparison? I tried searching the documentation but didnt find anything. 

    Regards,

    Smruthi