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.

TMS320C6657: C6657

Part Number: TMS320C6657
Other Parts Discussed in Thread: SYSBIOS

Hi All,

i am trying to get one external interrupt(from FPGA) to DSP(C6657). i want to call Testfun(), whenever the interrupt comes. but the when i give the interrupt from FPGA it comes to the DSP on GPIO 3, verified by

CSL_GPIO_getInputData(g_hGpio,2,&uTestpin), where i verifed the interrupt comes to the GPIO Pin 2(GPIO2). But the function,Testfun() is not invoked. this is my code, can any body tell, where the problem is.

#define KICK0 (*(unsigned int*)(0x02620038))

#define KICK1 (*(unsigned int*)(0x0262003C))
#define KICK0_KEYVAL 0x83e70b13
#define KICK1_KEYVAL 0x95a4f1e0
#define PIN_CONTROL_0 (*(unsigned int*)(0x02620580))

g_hGpio = CSL_GPIO_open(0);

(1)//unlock boot cfg registers and configure GPIO pin 0-15 mux

KICK0 = KICK0_KEYVAL;
KICK1 = KICK1_KEYVAL;
//Configuring the chip_pin_control0 register
PIN_CONTROL_0 = 0xFFFFFFFF;

(2)CSL_GPIO_bankInterruptEnable(g_hGpio, 0); //BINTEN 1 for bit '0'

(3)Set direction and rising or falling edge detection.

//0 to 3 //pin 0 to 3
for (Uint8 u8Pin = g_u8GpioPin00; u8Pin <= g_u8GpioPin03; u8Pin++)
{
CSL_GPIO_setPinDirInput(g_hGpio,u8Pin);
CSL_GPIO_setRisingEdgeDetect(g_hGpio,u8Pin);
CSL_GPIO_setFallingEdgeDetect(g_hGpio,u8Pin);

}

(4)

/ Set HW Interrupt
Hwi_Params hwiParams;
Hwi_Params_init(&hwiParams);

hwiParams.enableInt = 1;
// set the argument you want passed to your ISR function
hwiParams.arg = 1;

// set the event id of the peripheral assigned to this interrupt
hwiParams.eventId = 73; //event number mapped to GPIO 2
hwiParams.priority =1;

// don't allow this interrupt to nest itself
hwiParams.maskSetting = Hwi_MaskingOption_SELF;

myHwi = Hwi_create(3, (ti_sysbios_hal_Hwi_FuncPtr) &TestFunc, &hwiParams, &eb); 
if (Error_check(&eb)) {
printf("CMain::CMain(): Hwi_create failed.\n");

//TestFunc() which is not invoking.when i am toggling the interrupt from FPGA,

void TestFunc()

´{

int Test = 0;

}

Thanks,

Ramana.

  • Hi Ramana,

    I’ll need some time to gather data in the lab. Please allow me a few days and I’ll get back to you.

    BR
    Tsvetolin Shulev
  • Hello!

    At step 3 you assign rising edge detection, and immediately next line set for falling edge detection. I am not sure, that is allowed, I am afraid you just reassign the pin for the falling edge detection. I know nothing about your FPGA operation, whether it keeps request high - then you receive no falling edge. Please clarify that first.

  • Hi i found one intersting thing. we connected gpio pins 0..3 and 8...15. 8 to 15 are fine when i took the corresponding Event Ids only 0,3 are not working. As the output of DSP shows like below. i dont know why they say invalid interrupt numbers for 0..3. as i told you, with this function
    CSL_GPIO_getInputData(g_hGpio,2,&uTestpin) i clearly see the interrupt is coming on GPIO 0..3.

    Dsp output : ti.sysbios.family.c64p.Hwi: line 189: E_invalidIntNum: Invalid interrupt number: intr# 3
  • Hi,

    it is fine,i tested with other pins. you are setting the pin for both falling edge and rising edge. so when the FPGA or other extenal device gives a rising or falling edge interrupts, we can detect both.

    Ramana