LPSPI -Transfer Complete Interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPSPI -Transfer Complete Interrupt

1,530 次查看
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

标记 (3)
0 项奖励
回复
2 回复数

1,410 次查看
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 项奖励
回复

1,410 次查看
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 项奖励
回复