About SPI of MKL05Z32

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

About SPI of MKL05Z32

Jump to solution
1,102 Views
thoomanwang
Contributor V

The SPI interface chip and external I use MKL05Z32 MCU communication, MKL05Z32 communication as MASTER, peripheral chip as the slave, SPI driver is used in the http://cache.freescale.com/files/32bit/software/KL05-SC.zip in the SPI driver, but cannot read the peripheral chip return data, using logic analyzer to obtain the following graph. Excuse me for how to configure SPI interface to get numerical peripheral chip.

1.jpg

Why can not read to return the value of the peripheral chip is CS signal and Clock signal disappears error.

Labels (1)
Tags (2)
0 Kudos
1 Solution
696 Views
thoomanwang
Contributor V

Problems found, the reason is the chip selection signal (CS=0)  provided by the SPI interface provided by Freescale after the start delay for a very short time began to send commands, and peripheral chip is selected needs to wait for more time to accept commands, so the cause can not be normal communication, suggested that Freescale add a register, the user can according to the use of the chip free definition of delay time.

View solution in original post

0 Kudos
4 Replies
696 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Thooman Wang,

I'm not assure of the exactly reasons that cause this issue, as I don't know the operate protocol of the slave device.

And I didn't find something wrong with it after I've reviewed the spi.c in KL05-SC

So I'd like to suggest that you can built a spi communication between two KL05 by use the SPI driver just like the tip(SPI communication b/w two FRDM-K20D50M Boards) shows.

If the spi communication is well, then can prove the SPI driver can work. On the other hand, there're some bugs with the SPI driver.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
697 Views
thoomanwang
Contributor V

Problems found, the reason is the chip selection signal (CS=0)  provided by the SPI interface provided by Freescale after the start delay for a very short time began to send commands, and peripheral chip is selected needs to wait for more time to accept commands, so the cause can not be normal communication, suggested that Freescale add a register, the user can according to the use of the chip free definition of delay time.

0 Kudos
696 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Thooman Wang,

Do you mean the delay time between the chip selection signal enabled (CS=0) and send command is too short, then cause the device couldn't accept command correctly?
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
696 Views
thoomanwang
Contributor V

Yes, kl05 chip using SPI communication, the system settings after CS signals can transmit data, effective to transmit data between the CS signal from the time interval is too short (only about 5us), and I use the chip (SPI Slave) requires at least 15 US, this is why I had always communication failure.

0 Kudos