Enable GPIO pin interrupt S32K144 MCU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enable GPIO pin interrupt S32K144 MCU

8,829 Views
mrajanna
Contributor V

Hi,

I would like to enable the interrupt for particular GPIO pin. I want ISR to get triggered when there is change in value on particular GPIO pin.

For example, how can I trigger ISR for below GPIO pin ? Also guide me what changes are required in below pin mux settings?

pastedImage_1.png

Thanks

Mohan

Labels (1)
12 Replies

6,430 Views
sushma
Contributor III

Hello

I'm using S32K144 IDE Version: 2018.R1 ;The above attached file isn't supported in my IDE .

How to set the pad configurations in my IDE?

pastedImage_1.pngjiri.kral@nxp.com

0 Kudos
Reply

6,430 Views
jiri_kral
NXP Employee
NXP Employee

Hi. 

here is similar example using current SDK version. This example is for S32K148, but the configuration is almost the same as for S32K144 https://community.nxp.com/docs/DOC-343587 

Hope it helps. 

Jiri 

0 Kudos
Reply

6,430 Views
sushma
Contributor III

Hello Jiri

I'm still getting these errors and not clearly able to make out what changes in Processor Expert.

pastedImage_7.png

I selected Continue Loading

pastedImage_8.png

pastedImage_9.png

Can you tell how to rectify this issue .

Or tell me which module in PE to add and hoe to alter it to make GPIO to be handled by an Interrupt

Thank you 

0 Kudos
Reply

6,430 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

It looks that requested SDK version is missing on your machine. Did you install updates? https://community.nxp.com/docs/DOC-341068 

Jiri

0 Kudos
Reply

6,430 Views
sushma
Contributor III

Hello Jiri

I followed the software update procedure. It fails as soon as it reaches around 80%. 

So can you instead tell me what all changes I must do in the PE.

I will set my GPIO as my input and later to generate ISR for it, what changes I must make in my interrupt manager and Clock manager to get the settings done right?

jiri.kral@nxp.com

Thank you

Sushma Mantagani

0 Kudos
Reply

6,430 Views
sushma
Contributor III

Hello Jiri

I'm able to hit the interrupt, but it's not getting cleared.

I have done the PE settings as below

pastedImage_1.png

pastedImage_2.png

The code is as follows:

pastedImage_3.png

pastedImage_4.png

pastedImage_5.png

pastedImage_6.png

Kindly help me clear the interrupt, once voltage given to the PORT E 3 is pulled down or no voltage is given.

PINS_DRV_ClearPinIntFlagCmd(PORTE,3); doesn't seem to work

Thank you

Sushma Mantagani

jiri.kral@nxp.com

0 Kudos
Reply

6,430 Views
sushma
Contributor III

jiri.kral@nxp.com‌ Kindly look into this issue and let me know where I may be going wrong

0 Kudos
Reply

6,430 Views
sushma
Contributor III

jiri.kral@nxp.com‌ Can you please extend your help in this regard

0 Kudos
Reply

6,430 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

sorry for delay, the tread is not showing at the top and I missed update. Well, there is nothing special - this is how the pin is cofigured (in my case PORTC, pin 13):

pastedImage_1.png

And this is main.c: 

pastedImage_2.png

When SW4 is pressed out, interrupt is invoked and program stops on breakpoint in interrupt handler. 

It seems that you have pull down enabled, is't this feature caused your issue? 

Jiri 

0 Kudos
Reply

6,430 Views
jiri_kral
NXP Employee
NXP Employee

Hi Mohan, 

in attachment is modified hello_word example to be able handling PORTE pin 16 IRQ. 

Jiri 

6,430 Views
mrajanna
Contributor V

Thanks Jiri.

0 Kudos
Reply

6,430 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Mohan,

select pin functionality ...

pastedImage_1.png

pastedImage_2.png

then within a code enable interrupt for PORTE

INT_SYS_EnableIRQ(PORTE_IRQn);

and add interrupt handler code

void PORTE_IRQHandler(void)
{
     PINS_DRV_ClearPinIntFlagCmd(PORTE, 16);
     PINS_DRV_TogglePins(PTD, (1<<16));
}

BR,

Petr