SPI problem

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

SPI problem

跳至解决方案
1,153 次查看
josemartinez
Contributor III

Hi everyone,

I'm triying to use the SPI with kinetis K20, I want to use it as a Slave and other device will be a Master, this device will generate a CLK signal and it will send de data. The CLK is 2 MHz.

I have done the configuration the image shows. I'm not able to receive any data, I don't know why, probably I'm doing something wrong, its the first time I work with kinetis. If some one can help me....

Thank you in advance.

标签 (1)
0 项奖励
1 解答
821 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi,

Have the data been ready in the K20 SPI's data register before external master launch the reading operation? I have some customers met such problem due to this, please kindly check it in your application code.

Hope that helps,

B.R

Kan

在原帖中查看解决方案

0 项奖励
5 回复数
822 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi,

Have the data been ready in the K20 SPI's data register before external master launch the reading operation? I have some customers met such problem due to this, please kindly check it in your application code.

Hope that helps,

B.R

Kan

0 项奖励
821 次查看
josemartinez
Contributor III

Thanks for your answer, I had something wrong in my code, I correct it and now its working well.

Thanks

Jose

0 项奖励
821 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

I have make a demo on TWR-K40X256 boards with [SPISlave_LDD] & [SPIMaster_LDD], which could use TWR-K40X256 J4 jumper.

J4-1 PTA16 SPI0_SOUT (ALT2)

J4-4 PTA15 SPI0_SCK (ALT2)

J4-6 PTA14 SPI0_PCS0 (ALT2)

J4-7 PTA17 SPI0_SIN (ALT2)

J4-8 GND

I also attached my test project for your reference.

Both SPI slave and master can receive the data.

Wish it helps.

0 项奖励
821 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

From your attached picture, I could not find the SPI mode selected. Which processor expert component you are using? If it is [Init_SPI] component?

Thank you.

0 项奖励
821 次查看
josemartinez
Contributor III

Hi,

Thanks for your answer. The component I'm using is SPISlave_LDD.

Thanks

0 项奖励