Hi,
I 'm working in MKM34Z256VLQ7 microcontroller. SPI is not working for me. While debugging from MCUXpresso i can able to see only the configuration and status value update in registers (SPI1->S), but no changes in data register SPI1->DL/DH when i write or read to/from slave, it remains 0.
When trying to communicate with slave, i found that clock and chip select are going fine. Still the MISO And MOSI signals are not correct. i used the same configuration from driver examples.
config->enableMaster = true;
config->enableStopInWaitMode = false;
config->polarity = kSPI_ClockPolarityActiveHigh;
config->phase = kSPI_ClockPhaseFirstEdge;
config->direction = kSPI_MsbFirst;
#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS
config->dataMode = kSPI_8BitMode;
#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */
#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO
config->txWatermark = kSPI_TxFifoOneHalfEmpty;
config->rxWatermark = kSPI_RxFifoOneHalfFull;
#endif /* FSL_FEATURE_SPI_HAS_FIFO */
config->pinMode = kSPI_PinModeNormal;
config->outputMode = kSPI_SlaveSelectAsGpio;//kSPI_SlaveSelectAutomaticOutput;
config->baudRate_Bps = 500000U;
I am facing this issue for both SPI10 And SPI1. Whether i need to configure anything other than this.
Tried using both internal(4MHz) and external clocks(4MHz).
My apologies for not being able to reach out you on time!
Are you still facing this issue? I recommend to check if other registers of the SPI are holding desired values.
You mentioned that the MOSI and MISO lines are not correct. I would recommend disconnect all of the KM34 (Master) SPI signals and proceed to send write command , and test if the MOSI line is transmitting accordingly. Then pull down the MISO line , so you can get FFs when issuing a read.
If the above fails, check that you have the proper muxing for the MISO and MOSI pins and if possible test with other pins.
If you are still having problems or concerns, you can share your project so I can check your problem with SPIx->DL/DH registers.
Best regards,
Diego.