About SPI of MKL05Z32

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

About SPI of MKL05Z32

跳至解决方案
1,985 次查看
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.

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,579 次查看
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 项奖励
回复
4 回复数
1,579 次查看
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 项奖励
回复
1,580 次查看
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 项奖励
回复
1,579 次查看
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 项奖励
回复
1,579 次查看
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 项奖励
回复