MPC5777C: external interrupt on IRQ pin

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

MPC5777C: external interrupt on IRQ pin

Jump to solution
2,190 Views
fraidling
Contributor II

Hello,

i test the different Interrupts. Setting an software flag and execute the assigned ISR works.

Now i try to get an interrupt triggered with an input pin on the Evaluationboard MPC57xxxMB + MPC5777C (i just use Core0):

Initialization for IRQ0:

xcptn_xmpl ();              /* Configure and Enable Interrupts */

SIU.PCR[IRQ0_pin].R = PA_IRQ | IBE;      /* Input pin PCR450: Mode alternative 1 = IRQ0,  input buffer enable */

SIU.DIRER.B.EIRE0 = 1;                           /* enable external interrupt on  IRQ0 */
SIU.IREER.B.IREE0 = 1;                           /* Interrupt on rising edge  */
SIU.EIISR.B.ESEL0 = 0;                            /* input = external interrupt*/
SIU.DIRSR.B.DIRS0 = 0;                           /* Interrupt request for event on IRQ0 */

INTC.PSR[46].R = PROCESSOR0 | PRIO;          /* Interrupt to Core0, Prio 15 */

Main: [...]

ISR:

void IRQ0_ISR(void)
{

     ctr++;

    //Clear Flag:
   SIU.EISR.B.EIF0 = 1;
   //INTC.SSCIR[46].B.CLRn = 1;  

}

ISR vector File:

void IRQ0_ISR(void);

[...]

(uint32_t) &IRQ0_ISR, /* Vector # 46 SIU_EIISR[EIF0] SIU SIU External Interrupt Flag 0 */
(uint32_t) &dummy, /* Vector # 47 SIU_EIISR[EIF1] SIU SIU External Interrupt Flag 1 */
(uint32_t) &dummy, /* Vector # 48 SIU_EIISR[EIF2] SIU SIU External Interrupt Flag 2 */
(uint32_t) &dummy, /* Vector # 49 SIU_EIISR[EIF3] SIU SIU External Interrupt Flag 3 */
(uint32_t) &dummy, /* Vector # 50 SIU_EIISR[EIF15:EIF4] SIU SIU External Interrupt Flags 15-4 */

I hope the Code is understandable, here are my questions because it doesnt work:

  1. is the correct vector assigned
  2. do i miss a register in initialization
  3. which flag trigger the ISR and is to be cleared: the one in INTC or in SIU.EISR
  4.  do IRQ4-15 trigger the same Interrupt (in SIU.EISR are 15 flags but in INTC just 5 for IRQ)

I used the MPC5748G-SW2-extInterrupt example as reference, if you have some recommendations for simple PWM and Timer examples you would help me in advance!

Florens

0 Kudos
1 Solution
1,339 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, you are missing SIU_A IMUX3 register setting.

pastedImage_1.png

I will share example code early.

View solution in original post

3 Replies
1,339 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I've just published simple working example for this here:

https://community.nxp.com/docs/DOC-334903 

1,340 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, you are missing SIU_A IMUX3 register setting.

pastedImage_1.png

I will share example code early.

1,339 Views
fraidling
Contributor II

You are right David.

I added: "SIU.IMUX3.B.MUXSEL0 = 0b01;" in the IRQ Initialization part and it works as intended.

Thanks alot for the example.

0 Kudos