S32K144 EVB External interrupt

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

S32K144 EVB External interrupt

2,842 Views
pritampatil
Contributor III

I am working on S32K144 Eval board. i want to do a simple project where i can detect a external interrupt (probably by a switch connected to PTC-12) and switch on a LED. It can be done with simple if-else conditional statement also, but i want to know how to configure external interrupts for S32K144. Example projects have only internal interrupt example.

It will be great if someone could attach here a sample code which has a simple External interrupt( through switch) and toggles the LED whenever interrupt is received.

3 Replies

2,124 Views
Kavin-Sun
Contributor II

Hi. 
Thank you for NXP employee. 

I tried 'External interrupt' using s32K144 EVB.

Using example 'hello_world_s32k144', modified button1 ,2 interrupt example. 

Please refer below comment in 'main.c' file. 

/* Kevin START */

~~

/* Kevin END */

KavinSun_0-1630053755709.png

 

 

1.  changed PIN 12, PIN 13 by input setting like below. 

KavinSun_1-1630053853836.png

2. changed  PTC 12,PTC 13 interrupt option 

KavinSun_2-1630053894182.png

3. Generate Processor Expert Code 

KavinSun_4-1630053950984.png

4. Modified 'main.c' file 
   /* Kevin START */    ~my changed code ~  /* Kevin END */

 

Thank you a lot. 

 

 

0 Kudos

2,297 Views
raresvasile
NXP Employee
NXP Employee

Hi,

Please check flexcan_encrypted_s32k144 example project. You can find there an example on the implementation of the buttons interrupt.

Best regards,

Rares

2,297 Views
pritampatil
Contributor III

Hi,

I tried looking int that code, it was quite confusing as i have never worked on CAN.

It will be really helpful if you can provide a basic sample code for External interrupt.

Pritam

0 Kudos