MPC5777C PIT interrupts error

cancel
Showing results for 
Search instead for 
Did you mean: 

MPC5777C PIT interrupts error

1,068 Views
duyhung
Contributor II

Hi all,

I use MPC5777C on Green Hills - Multi, i build demo code to blink led base on Example MPC5748G PIT ISR .

 

Now if demo code run PIT no interrupts it ok but I user PIT with interrupt it hang. I think it do not find address of vector table when PIT interrupt occurs.

I set MPC5777C_IsrVecTab.c file,

 

set PIT interrupts is location at 301 in vector table,

void INTC_Init(void) {  //-1--------------------------------------------------------------------   /* The Block Configuration Register is used to configure options of the INTC.       Initialize INTC for software vector mode */   INTC.MCR.R = 0x00000000;        //-2--------------------------------------------------------------------   /* configure IVORx offsets      This file also includes a trap for all core exceptions, excluding IVOR4 exceptions which have seperate handler */   e200zX_Interrupt_Setup();   //-3--------------------------------------------------------------------   /* configure Interrupt Base pointer      Set INTC ISR vector table base address */   INTC.IACKR.B.VTBA = (uint32_t) &IntcIsrVectorTable[0]; //-4--------------------------------------------------------------------   // assign VECTOR TABLE address //  INTC_0.IACKR[0].R = (uint32_t) IntcIsrVectorTable; //-5--------------------------------------------------------------------   // set lowest priority to enable interrupts from higher ones   INTC.CPR.B.PRI = 0; //-6--------------------------------------------------------------------   // assing required peripheral priorities   //INTC.PSR[226].R = 0x8001;    // PIT0   INTC.PSR[301].B.PRC_SEL = 0x00;    // PIT0   INTC.PSR[301].B.PRI = 0x01;    // PIT0 //-7--------------------------------------------------------------------   // Enable interrupts   asm(" wrteei 1"); }//INTC_Init

 

set

    .equ  INTC_IACKR, 0xFFF48010  # Interrupt Acknowledge Register address

    .equ  INTC_EOIR,  0xFFF48018  # End Of Interrupt Register address

 

Where am I missing ?

Do you have complete example of this PIT with interrupt ? Can you give me references ?

 

Thanks & Regards

D.Hung

Original Attachment has been moved to: MPC5777C_IsrVecTab.c.zip

Labels (1)
5 Replies

146 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Do you have properly initialized IVOR registers? I am asking because these are not present with e200z420 but they are present with e200z7 used on MPC5777C device.

0 Kudos

146 Views
duyhung
Contributor II

I initialized it same with MPC5748G. Seems to me wrong in the initialization IVOR registers. Can you help me solution?

Thanks & Regards

D.Hung

0 Kudos

146 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I am attaching the solution. Pay attention to Vector_SW_VLE_e200z7.s and intc_sw_handlers.s where I had to made some changes. Otherwise it is based on mentioned approach.

146 Views
duyhung
Contributor II

Thank you ! Code it run ok. I see you changes Function to Setup the Core Interrupt Registers. Do you have document explaining the changes ?

#=================================================

#  Function to Setup the Core Interrupt Registers

#=================================================             

e200zX_Interrupt_Setup:

    #IVPR = address base used with IVOR's

    e_lis r5, __IVPR@h  

    e_or2i r5, __IVPR@l

    mtIVPR r5

    se_bmaski r3,0

    se_and   r3,r5

    e_add16i r5,r3,0x00@l

    mtivor0 r5

   

    e_add16i r5,r3,0x10@l

    mtivor1 r5

   

    e_add16i r5,r3,0x20@l

    mtivor2 r5

   

    e_add16i r5,r3,0x30@l

    mtivor3 r5

   

    e_add16i r5,r3,0x40@l

    mtivor4 r5

   

    e_add16i r5,r3,0x50@l

    mtivor5 r5

   

    e_add16i r5,r3,0x60@l

    mtivor6 r5

   

    e_add16i r5,r3,0x70@l

    mtivor7 r5

   

    e_add16i r5,r3,0x80@l

    mtivor8 r5

   

    e_add16i r5,r3,0x90@l

    mtivor9 r5

   

    e_add16i r5,r3,0xA0@l

    mtivor10 r5

   

    e_add16i r5,r3,0xB0@l

    mtivor11 r5

   

    e_add16i r5,r3,0xC0@l

    mtivor12 r5

   

    e_add16i r5,r3, 0xD0@l

    mtivor13 r5

   

    e_add16i r5,r3,0xE0@l

    mtivor14 r5

   

    e_add16i r5,r3,0xF0@l

    mtivor15 r5

    se_blr

   

.size e200zX_Interrupt_Setup,$-e200zX_Interrupt_Setup

0 Kudos

146 Views
nguyencongtruon
Contributor I

Hi Hung,

I meet the same issue with MCP5748G when I run code. Can you help me to fix it .
Thank you very much .

0 Kudos