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.

Help on F28M36 external NMI input needed

Other Parts Discussed in Thread: CONTROLSUITE

Dear all,

on my F28M36 I want to use GPIO15 (PB7) as an external NMI interrupt. I am not sure how to initalise this interrupt in my software.

I did:

    GPIOPinUnlock(GPIO_PORTB_BASE, GPIO_PIN_7);
    GPIOPinConfigure(GPIO_PB7_NMI);                            // NMI
    GPIOPinLock(GPIO_PORTB_BASE, GPIO_PIN_7);

to unlock, change the pin type and lock again.

Additionally I registered the interrupt with:

    IntRegister(FAULT_NMI, MasterNMI);


with my MasterNMI function. Unfortately this function is never reached. 

I want an NMI interrupt when PB7 drops from 3.3V to 0V. 

Any help is very welcome. Thanks a lot in advance!

  • Hi,

    Could you check the register values in CCS register view after configuration to make sure GPIO pin is setup for NMI functionality? If it's correct then you could force the NMI by setting the NMISET bit in INTCTRL of NVIC and see if that calls the NMI handler.

    Regards,

    Vivek Singh

  • Thank you very much for your answer, Vivek.

    Forcing the NMI interrupt in the NMI Flag Force Register or by setting NMISET bit in INTCTROL calls the NMI handler.

    But I guess the connection to GPIO15 (PB7) is missing. I tried a lot now, but I haven´t found the right way to configure the GPIO to NMI...

    After doing this:
    GPIOPinUnlock(GPIO_PORTB_BASE, GPIO_PIN_7);
    GPIOPinConfigure(GPIO_PB7_NMI); // NMI
    GPIOPinLock(GPIO_PORTB_BASE, GPIO_PIN_7);

    the GPIO_PORTB register show following:
    GPIOAPSEL = 0x0000 0000
    GPIOPCTL = 0x4000 0000
    GPIODEN = 0x0000 007F
    GPIOAFSEL = 0x0000 0080

    Do I need something else?
  • Hi,

    You have value 0x7F in GPIODEN register which means digital function is not enable on pin 7 (PB7) . Please write '1' at bit 7 to enable the digital functionality on this pin and see if that helps. You can call following function to do the same (after GPIOPinConfigure).

    GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_PIN_TYPE_STD_WPU);

    Hope this helps.

    Regards,
    Vivek Singh
  • Hi,
    Did it help to resolve the issue?

    Vivek Singh
  • Hello Vivek,

    no, I did not manage it to use the NMI input directly. I use a GPIOB interrupt instead. After long searching I ended up with this settings which I will use now.

    GPIOPinUnlock(GPIO_PORTB_BASE, GPIO_PIN_7);
    GPIOPinTypeGPIOInput (GPIO_PORTB_BASE, GPIO_PIN_7); // GPIO POWER_FAILn input
    GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_PIN_TYPE_STD_WPU);// NMI
    GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_7,GPIO_RISING_EDGE);
    GPIOPinIntEnable(GPIO_PORTB_BASE, GPIO_PIN_7);

    IntRegister(INT_GPIOB, MasterNMI);
    IntEnable(INT_GPIOB);

    My suggestion is to implement a NMI example in the next controlSUITE version.

    Thank you very much for your help!
  • Hi,

    My suggestion is to implement a NMI example in the next controlSUITE version.

    We'll look into it.

    Regards,

    Vivek Singh