AnsweredAssumed Answered

SPI Problem in KL25z and PE on KDS

Question asked by Avner Gidron on Dec 24, 2015
Latest reply on Jan 7, 2016 by Marek Neuzil

Hi to all,

I am working on the kl25z  with the KDS and  PE acording to Erich Styger great tutorial:  SPI | MCU on Eclipse  .  I have a temperature  sensor I am connecting  throw SPI (with  32-bit wide),  which only have  a MISO. in  addition  I connect to a EEPROM using the same SPI (SPI0), which have both MISO and MOSI, and I use other pins for CS.

I have created the SPI_Master_LDD  component in PE for the communication with both of the SPI devices working without the SPI interrupt mode.

 

My problem: I try to read the data from the temperature  sensor using only  the SM1_ReceiveBlock without calling the SM1_SendBlock  but that is not working. when I try adding the SM1_SendBlock with a dummy data, it does 8-bit reading and then  8-bit writing and goes around 4 times (because the data size is 32-bit). the problem is because the temperature  sensor is not allowing writing it is sending part of the bits during the clock cycle used for the dummy writing, and what I get is not the complete data  (this is verified using a scope).

 

am I doing something wrong? Is there a way to make the reading work without calling SM1_SendBlock?

Thanks in advance

Avner

Outcomes