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.

C6747 GPIO interrupts - GPIO doesnt raise an event

Hi,

I'm using the C6747 and in my application I want to receive an interrupt from GPIO Bank 3 Pin 14. As I understood from all Datasheets and userGuides, the GPIO can cause an event (Specifically, event number 52) which I can routed directly to the Interrupt selector or to the ECM.

Now, I know the GPIO PIN receives its value from my HW (I can see on the data in the value changes) and I know that by manuelly setting the EVTFLG (using EVTSET) I can get the ECM to recognize the event and the intrrupt selector to invoke my ISR BUT I cannot see that changes in the GPIO cause the Event.

It something like this : external PB ----> GPIO3_14 ---X--> EventFlag ----> ISR invoked.

This is how I configured the PINMUX and the GPIO Regs :

sysRegs->KICK0R = 0x83e70b13;

sysRegs->KICK1R = 0x95A4F1E0;

sysRegs->CFGCHIP0 = CSL_FMKT(SYSCFG_CFGCHIP0_PLL_MASTER_LOCK, FREE);

/* Selecting the actual physical pin to react as an GPIO pin - PUSH BUTTONS*/

sysRegs->PINMUX11 |= CSL_FMKT(SYSCFG_PINMUX11_PINMUX11_23_20, GPIO3_14);

/* Make sure the GPIO module power is on */

Psc_ModuleClkCtrl(Psc_DevId_1,PSC_GPIO_LPSC, TRUE);

/* Configure GPIO3_14 (GPIO3_14_PIN) as an input - PUSH BUTTONS */

u32_temp = gpio3Regs->DIR ;

u32_temp = ( (u32_temp & CSL_GPIO_DIR_DIR14_MASK) |(CSL_GPIO_DIR_DIR_IN << CSL_GPIO_DIR_DIR14_SHIFT) );

gpio3Regs->DIR |= u32_temp;

/* Enable GPIO Bank interrupt for bank 3 - PUSH BUTTONS */

u32_temp = gpioRegs->BINTEN ;

u32_temp = ( (u32_temp & CSL_GPIO_BINTEN_EN3_MASK) |(CSL_GPIO_BINTEN_EN3_ENABLE << CSL_GPIO_BINTEN_EN3_SHIFT) );

gpioRegs->BINTEN |= u32_temp;

/* Configure GPIO(GPIO3_14_PIN) to generate interrupt on rising edge - PUSH BUTTONS */

u32_temp = gpio3Regs->SET_RIS_TRIG;

u32_temp = ( (u32_temp & CSL_GPIO_SET_RIS_TRIG_SETRIS14_MASK) |(CSL_GPIO_SET_RIS_TRIG_SETRIS_ENABLE << CSL_GPIO_SET_RIS_TRIG_SETRIS14_SHIFT) );

gpio3Regs->SET_RIS_TRIG= u32_temp;

  • You might be doing something wrong with the SET_RIS_TRIG register.  At a minimum you're making it more sophisticated than it needs to be.  There are separate "SET" and "CLR" registers so that you don't need to do read-modify-write operations.  Simply write 1 to the bits where you want an interrupt.  Writing a 0 has no effect.

    You could easily verify if you have pin muxing correct by looking to see if the IN_DATA register changes along with changes on the pin.

  • hi Brad, Thanks for your reply...

    about the pinmux, I'm pretty sure I'm configured fine because I can see the data on the IN_DATA register when I'm changing the Value on the pin.

    What I don't see is the ISR being invoked (Even though I entered the event number under a specific interrupt in the *.tcf file and enabled it)  or even the relevant event  flag raised in the EVT_FLAG register as specified in the DPS megamodule document. (by the way, when I set the event flag manually via the EVT_SET register, It does invoke the event)

    Ill try to take another look at the SET_RIS_TRIG, maybe its not configured properly.

    On the same opretunity, Can you tell me if the event (not interrupt) that corresponds with a curtain GPIO will be raised if I configure a GPIO pin direction as an output pin and write data in the OUT_DATA register? this can also be a tool that will help me point my exact problem.

    Thanks,

    Yoav.

     

  • Yoav Gold said:

    On the same opretunity, Can you tell me if the event (not interrupt) that corresponds with a curtain GPIO will be raised if I configure a GPIO pin direction as an output pin and write data in the OUT_DATA register? this can also be a tool that will help me point my exact problem.

    Yes, configuring the GPIO as an output will still cause the event to be raised.  That was intentional to make it easier for us to verify correct operation.  I utilize that trick in the example code posted in this wiki page Configuring GPIO Interrupts.