MPC5674f SPI DSPI_POPR register

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

MPC5674f SPI DSPI_POPR register

Jump to solution
903 Views
mayconkruger
Contributor I

Hi, I am currently developing one application to read from a external spi memory (code anexed).

 

I've configured DSPI module as SPI, and disabled  TX/RX FIFO's(on the SPI_Init function).

 

The problem is when I first try to read from DSPI_POPR register I get only 0 as the returned value. But the second time I try reading the DSPI_POPR I get the expected value which as stored in the  external memory. So, I dont understand why do I have to read DSPI_POPR register twice to get the expected value.

 

I also had to use the ROOE flag from DSPI_MCR register, otherwise the data received by DSPI_POPR =0

MPC5674F_REG_DSPI_A.MCR.B.ROOE = 1;        //why is this overflow flag necessary???

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

Labels (1)
Tags (1)
1 Solution
669 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

It is typical behavior for overflow/underflow situation. It is needed to realize that every PUSH is needed to along with POP operation as both receive/transmit operation works simultaneously.

 

In the thread below you may see example code for reference:

https://community.nxp.com/thread/381921

View solution in original post

1 Reply
670 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

It is typical behavior for overflow/underflow situation. It is needed to realize that every PUSH is needed to along with POP operation as both receive/transmit operation works simultaneously.

 

In the thread below you may see example code for reference:

https://community.nxp.com/thread/381921