MPC5748G (Master) is communicating with NAND Flash W25N01GV (Slave) via SPI. When ever I am sending command from MPC, nand flash is giving the correct response and it was validated by capturing the wave using oscilloscope.
The response is the correct one and signal quality was also good. MISO line shows correct data in oscilloscope, But not updated in receive buffer in the code. When checked in POPR, RXFIFO registers also, no data was present at all. What could be the reason for this?
I am attaching the waveforms from the datasheet of NAND FLASH for the command I used.
which pin do you use for SIN (MISO)?
I am using SPI_0 and PI (i.e pin number 76) is configured as MISO pin.
Do you properly set respective MSCR and IMCR (if needed) registers?
I haven't configured it separately but during pin initialization I guess it will be set as per configuration.
What kind of code you are using?
I am using spi driver file generated by s32ds and below provided function is called for transmission.
status_t SPI_MasterTransfer(const spi_instance_t * const instance, const void* txBuffer, void* rxBuffer, uint16_t numberOfFrames);
even for SDK used, check respective MSCR/IMCR registers (it should be MSCR and IMCR)
Be sure MISO line is really connected to the right pin.
Function definition does not say how it is used in your code. Anyway if correct frame is transmitted, slave response is visible on MISO line, and nothing is also seen in RXFIFO, i would expect wrong pin setting or usage.
MISO line is connected to the right pin. I have cross checked it. I guess MSCR and IMCR is configured in the right way. MSCR[SSS] is 00000010, so input mux is assigned value 2 and input_mux_reg is assigned 300. input mux_1 to 7 are disabled. Also for the SPI input pin of MCU, HYSTERESYS, pull select and open drain are disabled. Do i need to modify any of these to receive data properly. If i am wrong, please do correct me.
if PI pin is used as SIN then below setting is expected
MSCR IBE bit set
Hysteresis can be enabled, weak pullup or pull down too, as memory does not drive the output during command and dummy bytes.
attached is modified demo code to use SPI_0 to send 5 bytes with continuous selection.
On DEVKIT board I connect SOUT to SIN to check reception on PI pin.
It works well. This is what I see...
Receive buffer has the same data what is sent.
Below pins are used, so can be connected on DEVKIT easily