AnsweredAssumed Answered

MPC5777C: external interrupt on IRQ pin

Question asked by Florens Fraidling on Jun 23, 2017
Latest reply on Jun 29, 2017 by Florens Fraidling

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

Outcomes