LPSPI -Transfer Complete Interrupt

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

LPSPI -Transfer Complete Interrupt

1,650 Views
daniel_petrakaj
Contributor I

Good afternoon,

I am newbie in ARM world and I would like to kindly ask for help. I am using S32K148EVB-Q176. I would like to use LPSPI0 interrupt for complete transfer. I found  that I have to set TCIE bit in IER register to 1 to allow it. Unfortunately i do not know exact syntax how to write down, I would like to kindly ask for some example. Moreover I have no idea how to delete IRQ status flag after ISR routine

Thank you for your help

0 Kudos
Reply
2 Replies

1,530 Views
daniel_petrakaj
Contributor I

I tried to set it in this way

  LPSPI0-> IER = 0x200; //set TCIE to 1
  INT_SYS_InstallHandler(LPSPI0_IRQn, &LPSP0_ISR, (isr_t*) 0); // handler for ISR routine function

void LPSP0_ISR (void)
{

    PINS_DRV_SetPins(PTB, 1<<0U);
    PINS_DRV_ClearPins(PTB, 1<<0U);
    LPSPI0-> IER |= LPSPI_IER_TCIE_MASK ; //delete flag
}

It working partly, unfortunately than program always stop in LPSP0_ISR function in debugging mode. Please do you have idea what is wrong?

0 Kudos
Reply

1,530 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Daniel,

You only need to clear the LPSPI_SR[TCF] flag by writing 1 to it (w1c) instead of the last line in the interrupt routine.

pastedImage_1.png

Regards,
Daniel

0 Kudos
Reply