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.

TMS320F280049C: Extrnal interrupt triggering

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Dear all, 

I have an F280049C launchpad and I want to trigger an ISR using the GPIO59 by applying a 3V to pin11. Unfortunately, the code does not jump into the ISR code and I get the following message:

Can't find a source file at "/home/a0225147/c2000ware/repos/f28004x/release_pkg/driverlib/f28004x/driverlib/interrupt.h"
Locate the file or edit the source lookup path to include its location.

Does anybody know a solution for this?

Below you can find my code:

In Lab.h:

extern interrupt void xint1ISR(void);

in Gpio.c

    Interrupt_enable(0x00230104U);                                    // Enable interrupt 1.4
GPIO_enableInterrupt(GPIO_INT_XINT1); // Enables inturrupt in XINT1 XBAR_setInputPin(XBAR_INPUT4, 59); // Connect XBAR to input pin11 GPIO_setInterruptPin(59, GPIO_INT_XINT1); // Connect XINT1 to pin 59 GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_BOTH_EDGES); // Enable both edges

in DefaultIsr_5.c

interrupt void xint1ISR(void)                            // PIE1.8 @ 0x000D4E  WAKE interrupt (LPM/WD)
{
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);      // Must acknowledge the PIE group

// Next two lines for debug only - remove after inserting your ISR
    asm (" ESTOP0");                                    // Emulator Halt instruction
    while(1);
}

Thank you in advance.

Best regards,

Stergios

  • Hi Stergios,

    Thanks for the question! Just to clarify, could you go into detail when this error message ("Can't find a source file") is occurring? Does this error message occur during compilation? If so, then the path that is mentioned in that error may be the issue. It looks like the path it is searching for the interrupt.h file in does not exist, so it is likely an issue in the project properties.

    Would you be able to try the following:

    1. In Code Composer Studio, go to Project->Properties->Build->C2000 Compiler->Include Options
    2. Ensure that the options listed under "Add dir to #include...." are all using references and not actual paths:
      1. Basically, make sure these are all using syntax like the following, where there is a "$" symbol:

        ${COM_TI_C2000WARE_SOFTWARE_PACKAGE_INCLUDE_PATH}

      2. This will look for the files using variable paths instead of a static path

    Let me know if the other issue mentioned (the interrupt not triggering) is resolved by this!

    Regards,

    Vince

  • Hi Vince,

    Thank you very much for your reply. 

    I checked the path and they look like this:

      

    The error message occurs after the debug when I click on the Resume button.

    Moreover, the error does not appear if I remove this line code:

    Interrupt_enable(0x00230104U);

    but still, it does not trigger the interrupt.

    Btw, I modify the Lab5 files after I completed it successfully(if that helps you to understand what I am doing).

    Thank you.

    Bests,

    Stergios

     

  • Hi Vince,

    I modified my code to this:

        Interrupt_enable(INT_XINT1);
        GPIO_enableInterrupt(GPIO_INT_XINT1);
        Interrupt_register(INT_XINT1, &xint1ISR);
    
        GPIO_setDirectionMode(25, GPIO_DIR_MODE_IN);  // GPIO25 = input
        GPIO_setInterruptPin(25,GPIO_INT_XINT1);      // XINT1 connected to GPIO25
        GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_FALLING_EDGE);

    Now it jumps to the xint1ISR but also when the GPIO25 is not enabled. Do you have any idea why?

    Thank you!

    Best regards,

    Stergios

  • Hi Stergios,

    Thanks for the follow up information! It is is possible that the GPIO25 interrupt is not cleared before the GPIO itself is enabled, which could be triggering this false interrupt. To debug this, I would highly recommend starting with the example "gpio_ex3_external_interrupt.c" from the C2000Ware library (latest version of C2000Ware highly recommended):

    Location: C2000Ware_*versionnumber*\driverlib\f28004x\examples\gpio\gpio_ex3_external_interrupt.c"

    This example may be the exact configuration needed for what you are looking to do, and so will be greatly helpful in developing your software! I would start with this example, and modify as needed to fit the use case being implemented.

    Let me know if this helps with your debugging!

    Regards,

    Vince

  • Hi Vince,

    Thank you very much for your reply. I checked the example and now my code looks like this:

        Interrupt_register(INT_XINT1, &xint1ISR);
        Interrupt_enable(INT_XINT1);
    
    
        GPIO_setPinConfig(GPIO_25_GPIO25);            // GPIO25 = GPIO25
        GPIO_setDirectionMode(25, GPIO_DIR_MODE_IN);  // GPIO25 = input
        GPIO_setQualificationMode(0, GPIO_QUAL_SYNC);  // XINT1 Synch to SYSCLKOUT only
        GPIO_setInterruptPin(25,GPIO_INT_XINT1);      // XINT1 connected to GPIO25
        GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_RISING_EDGE);
    
        GPIO_enableInterrupt(GPIO_INT_XINT1);

    I just shuffled the commands and now it works :)

    A minor thing: If I have the PIN31 connected to ground the interrupt is not triggered which is fine. But even if I remove it from the ground and have it floating the interrupt is triggered. My question then is: doesn't it need 3.3Volts for being triggered?

    Thank you!

    Best Regards,

    Stergios

  • Hi Stergios,

    Awesome, glad to hear it is working now!

    For the interrupt triggering after removing ground, it is possible that the Pad config is set to floating input. I would suggest setting a pull-up enable for the pin like the following:

    GPIO_setPadConfig(25, GPIO_PIN_TYPE_PULLUP);     // Enable pullup on GPIO25

    Let me know if that helps!

    Regards,

    Vince

    Also, if I was able to answer your question, please press the green Verify Answer button below, thanks!

  • Thank you very much Vince!

  • Hi Stergios,

    Glad to help!

    Regards,

    Vince