Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

c6657 set up an interrupt on a GPIO16 through CIC0

Other Parts Discussed in Thread: SYSBIOS

I set up an interrupt on GPIO16 through CIC0. The systhem interrupt(CIC0 input) number is 0 and the host interrupt(CIC0 output) number is 1. Event id=23. I use the INT4. GPIO16 is setted the input IO. However, it can't run into the interupt dealing fuction when the gpio16 is high.

My code use sysbios module. Can I use csl on this situation.

static void SetInterrupt()
{
    // CSL_GpioHandle hGpio;
    Error_Block eb;
    Hwi_Params hwiParams;
    Hwi_Handle hwi0;
    int sysInterrupt=0;
    System_printf("enter main()\n");
    System_flush();

    // Open the CSL GPIO Module 0
    hGpio = CSL_GPIO_open (0);
    KICK0 = 0x83e70b13;
    KICK1 = 0x95a4f1e0;
    PIN_CONTROL_0 = 0xFFFF0000;
    CSL_GPIO_setPinDirInput ( hGpio, 16) ; //set pin as input
    CSL_GPIO_setRisingEdgeDetect (hGpio, 16); // Set interrupt detection on GPIO pin 1 to rising edge
    CSL_GPIO_bankInterruptEnable (hGpio, 1);
    // Enable GPIO per bank interrupt for bank zero
    //chip-level INTC0 is for corepac0~1
    hnd = CSL_CPINTC_open(0);
    if (! hnd) {
        return;
     }
    //disable all host interrupt
    CSL_CPINTC_disableAllHostInterrupt(hnd);
    //configure no nesting support in the cpintc module
    CSL_CPINTC_setNestingMode (hnd, CPINTC_NO_NESTING);
    CSL_CPINTC_clearSysInterrupt (hnd, 0);
    //enable system interrupt 0
    CSL_CPINTC_enableSysInterrupt (hnd, 0);
    //map system interrupt 0(gpio16 gpint) to host interrupt 1
    CSL_CPINTC_mapSystemIntrToChannel (hnd, 0, 1);
    //enable host interrupt 1
    CSL_CPINTC_enableHostInterrupt (hnd, 1);
    //enable all host interrupts
    CSL_CPINTC_enableAllHostInterrupt(hnd);

    Error_init(&eb);
    Hwi_Params_init(&hwiParams);
    hwiParams.eventId = 23;
    // params.eventId = 86;
    // hwiParams.enableInt = 1;

    // params.arg = sysInterrupt;
    hwiParams.enableInt = 1;
    hwiParams.arg = 1;
    hwiParams.priority =1;
    hwi0=Hwi_create(4, (ti_sysbios_hal_Hwi_FuncPtr) &hwiFunc, &hwiParams, &eb);
    // hwiParams.enableInt = 1;
    if(hwi0==NULL)
    {
        System_abort("Hwi create failed");
    }
}

void hwiFunc(UArg sysInterrupt)
{

    // CSL_CPINTC_disableHostInterrupt(hnd, 1);
    // CSL_CPINTC_clearSysInterrupt(hnd, sysInterrupt);
    flag = 1;
    // CSL_CPINTC_enableHostInterrupt(hnd, 1);
}

  • Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com). Please read all the links below my signature.

    Please refer below wiki for configuring keystone interrupts. 

  • Hi,

    GPIO user guide needs to be updated for BINTEN register that bit 0 is for Bank 0 (GPIO pins 15:0) and bit 1 is for Bank 1 (GPIO pins 31-16).

    So you need to set bit 1 to 1 in BINTEN to enable the interrupt of GPIO pins 31-16.
    GPIO_BITEN = 0x2 ;

    Please take a look at the following thread which discussed the similar topic. We are trying to update the GPIO user guide to address this as well. Thanks.

    e2e.ti.com/.../956887.aspx

    Thanks,