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.

RM46L852: How to enable/disable Interrupt notification from a HET pin

Part Number: RM46L852

Hello, Friends

I involved in a project (RM46L852), that use a HET pin ( hetPort1, PIN_HET_7) as interrupt pin. 

For the GIO, I can use below function to get notification, 

void gioEnableNotification(gioPORT_t *port, uint32 bit)
{
/* USER CODE BEGIN (11) */
/* USER CODE END */

    if (port == gioPORTA)
    {
        gioREG->ENASET = (uint32)1U << bit;
    }
    else if (port == gioPORTB)
    {
        gioREG->ENASET = (uint32)1U << (bit + 8U);
    }
    else
    {
        /* Empty */
    }
}
 

But how about HET pin, which function should be use, or it needs add USER CODE in above function?

Thanks!

  • Hi Arthur,

    If the NHET pin is used as GPIO pin, the input interrupt is not supported.

  • Hi, QJ

    Thanks for your quick reply!
    I see. Actually, we use a HET pin (eg N2HET1[7]) to catch the external pulse to see if the pulse arrives, and to get the notification.
    Typically, the pulse width is about 50us, but it is variable.
    Besides the interrupt method, can I use the HET pin to catch the pulse?

    Regards, 

    Arthur

  • HI Arthur,

    For using the pins as N2HET pins, the interrupts can be generated by any instruction that has an interrupt enable bit in its instruction format.

    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. 

  • Hi, QJ

    Ok, I can follow it and try to create the interrupt. 

    Thanks for your always support!

    Best regards, 

    Arthur