Where to find SPI interrupt flag ?

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

Where to find SPI interrupt flag ?

1,551 Views
mkdomenico
Contributor II

Hello there,

 

I am quite new to embedded development, thus, I am sorry if my question may seem trivial. I am currently working with a S32K144 demo board (revision X1) with the IAR IDE.

 

I am configuring the low-power SPI module. I have set the LPSPI0_IRQHandler interrupt to fire on reception of a least one word (IER register RDIE bit set to 1 with RX Water = 0). This interruption starts fine, but I cannot find the corresponding interruption-flag to lower, thus once the interrupt has fired, it runs permanently.

 

Can you please help me fix this issue?

Thanks,

 

Regards,

Domenico

Labels (1)
0 Kudos
3 Replies

1,200 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

have you read all the data from FIFO? The interrupt is triggered if RDF in status register is set. And "The Receive Data Flag is set whenever the number of words in the receive FIFO is greater than RXWATER."

So, try to read all the data from FIFO. You can check RXCOUNT in FSR register.

Regards,

Lukas

0 Kudos

1,200 Views
mkdomenico
Contributor II

Hi,

Thanks for the fast reply. I have read all data from RX FIFO. RXCOUNT in FSR is 0. (I made the interrupt display the content of the register)

My output looks like this: (a line starting with an exclamation mark is a line written by the interrupt)

  FSR  : 00000000000000000000000000000000
! SR   : 00000000000000000000011100000011
! FSR  : 00000000000000010000000000000000
! Reading data: 0x8000
! FSR  : 00000000000000000000000000000000
! SR   : 00000000000000000000011100000001
! FSR  : 00000000000000000000000000000000
! Reading data: 0x0
! FSR  : 00000000000000000000000000000000
! SR   : 00000000000000000000011100000001
! FSR  : 00000000000000000000000000000000
! Reading data: 0x0
! FSR  : 00000000000000000000000000000000
...

The interrupt writes out the FSR register, reads the FIFO data and writes the FSR again. As you can see, even when the FIFO is empty, the interrupt keeps getting triggered. Even the RDF in the SR is back at 0 after reading.

Regards,

Domenico

0 Kudos

1,200 Views
mkdomenico
Contributor II

Hi again,

In the end, I am not going to use that interrupt and I will use some workaround. Thanks for your help.

Regards,

Domenico

0 Kudos