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.

RM57L843: N2HET PIN CONFIGURE AS GIO PIN as Input enable interrupt

Part Number: RM57L843
Other Parts Discussed in Thread: HALCOGEN

Hi TI Team,

I want to use the N2HET PIN CONFIGURE AS GIO PIN as Input, when the input to the pin high or low enabling the interrupt.

Please provide some example program for that.

Thanks and Regards,

A. Ajith Kumar

  • Hi Ajith Kumar,

    (+) TMS570LS1227: The HET is used as a GIO input to trigger a falling edge interrupt - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Please refer above thread, there i attached a code for LC4357 for similar requirement.

    Take it as reference and do the modifications as per it.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thanks for your response,

    The above thread was used edge interrupt to create an interrupts, There was only 8 edge interrupts there, So we can use 8 pin as edge interrupts. BUt I want to use 20 pins as gio interrupts.

    First I have configured the het port1 pins as gio and set as input direction.When the pins are high or low the program flow gets into an interrupts.

    I have attached the program below,

    #include "HL_sys_common.h"
    #include "HL_gio.h"
    #include "HL_het.h"

    void main()

    {
    _enable_interrupt_();
    gioInit();
    hetInit();
    gioSetDirection(hetPORT1,0x00000000);

    gioEnableNotification(hetPORT1, 4);
    gioEnableNotification(hetPORT1, 9);
    gioEnableNotification(hetPORT1, 2);
    gioEnableNotification(hetPORT1, 18);
    gioEnableNotification(hetPORT1, 16);
    gioEnableNotification(hetPORT1, 30);
    gioEnableNotification(hetPORT1, 14);
    gioEnableNotification(hetPORT1, 12);
    gioEnableNotification(hetPORT1, 22);
    gioEnableNotification(hetPORT1, 27);
    gioEnableNotification(hetPORT1, 29);
    gioEnableNotification(hetPORT1, 31);
    gioEnableNotification(hetPORT1, 24);
    gioEnableNotification(hetPORT1, 26);
    gioEnableNotification(hetPORT1, 10);
    gioEnableNotification(hetPORT1, 28);
    gioEnableNotification(hetPORT1, 8);
    gioEnableNotification(hetPORT1, 23);
    gioEnableNotification(hetPORT1, 11);
    gioEnableNotification(hetPORT1, 1);
    while(1);
    }

    void gioNotification(gioPORT_t *port, uint32 bit)
    {
    //stop motor
    }

    Here i have enabled the gio High and gio low interrupts in halcogen.But i was not gettng into the interrupt what was the mistake i have made.

    Please guide me,

    Thanks and Regards,

    A. Ajith Kumar

  • Hi Ajith Kumar,

    You can't enable GIO notifications for the HET pins which are configured in GIO mode.

    Because if you see the definition of the function gioEnableNotification:

    They will enable the notification only when the port is gioPORTA or gioPORTB, other than these ports it won't enable the notification.

    So, we can only enable 8 notifications for one HET module, here we have total two HET modules right. That mean we can configure up to 16 HET interrupts.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    How to use N2HET2 pins as edge interrupt,I have tried n2het2[5] as edge 0. But its not working.Please the procedure in halcogen to create edge 0 in n2het2 timer.

    Thanks and Regards,

    A.Ajith Kumar

  • Hi Ajith Kumar,

    N2HET18_AS_INPUT_EDGE_TRIGGERING_TEST_LC4357.zip

    This is a tested example from my side. Please use it as a reference and do the necessary modifications.

    I tested this example by setting a breakpoint in "edgeNotification" function. And as soon as i applied a falling edge signal on HET1[18], it hits the breakpoint.

    --

    Thanks & regards,
    Jagadish.

  • HI Jagadish,

    I have worked with HET1 port i have got the edge interrupt when falling or rising edge perfectly. When i trying in HET2 port was not working i have enabled the VIM channel 63 and 73.But when applying a rising/falling signal to the pin was not hitting the breakout. What was changes to made in halcogen for HET2.

    Thanks and regards,

    A.Ajith Kumar

  • Hi Ajith Kumar,

    Here is the working example for HET2_5 falling edge interrupt.

    N2HET2_EDGE_TRIGGERING_TEST_RM57.zip

    In this example, i configured D12 of the controller pin to the N2HET2_5 functionality, and i tested this example in RM57 launchpad and it is working fine.

    As you can see, after applying a falling edge code hits the breakpoint.

    I am suspecting one reason for failing at your end:

    As you can see there are multiple pins for N2HET2_5 functionality, so make sure to configure the functionality to the right pin and make sure to test at the right pin. Otherwise, it won't work.

    In my example i used D12 pin for testing, and this pin have the default functionality of N2HET2_5, so i don't need to make any changes at mux configurations. But if you are trying to use D16 then you should configure it in the pin mux table of HALCoGen.

    --

    Thanks & regards,
    Jagadish.