Hi everyone,
There are 4 SPI registers in the MPC5744P : SPI0 -SPI4 .When communicating with another chip using master mode , I found that only one SPI register (SPI2) was able to receive and read data from the slave chip .For other 3 registers , correct waveform can be observed by the oscilloscope on the SCK、SDO、SIN and CS pins ,and they have the same SPI timing as SPI2 register , but the received data of these three registers were awlays 0 .
Meanwhile , SPI2 register has 2 pins of SIN --A[2] and A[13] ,I found that only use A[2] as the SIN can read the received data ,using A[13] has the same problem as described above.
Is there some specific configuration for specific SPI registers or I missed something when Configure the SPI register? I want to know the reason why in the same configuration, only a SPI register can communicate properly?
Hoping for your help.
Thank you sincerely.
Bruce
Hi, do you have properly setup particular SIU_IMCR register? IMCR register says how to route signal from particular input buffer to particular module (thus it is input configuration).
Hi David,
Thank you for your reply. I am not sure whether I have setup particular SIU_IMCR register properly.
Taking DSPI_2 SIN for example .
First I use A2 pin as the SIN ,so my program statement is :SIUL2.IMCR[47].B.SSS = 2; //A2 as SIN of DSPI2.
Then program works well and I can read the received data.
However ,when I changed to use A13 pin , I changed the statement to :SIUL2.IMCR[47].B.SSS = 1; //A13 as SIN of DSPI2.
Then I can only receive 0 after debugging.
So did I make some mistakes when change the statement? Could you please tell me where might be my problem ?
Thank you
Bruce
Also, do you have enable input buffer for A13 pin (SIUL2_MSCR13[IBE])?
Hi David,
Thank you for your guide, just like you said , I did not enable the input buffer for A13 .Now the SPI works well.
Thank you agin.
Bruce