spi daisy chain

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

spi daisy chain

2,809 次查看
davidwiebe
Contributor I

I would like to connect x number of Kinetis L chips in a daisy chain configuration and shift out the contents via SPI. Think of it as one giant shift register.

标签 (1)
0 项奖励
回复
3 回复数

2,285 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi David,

Do you mean you want to connect several KLs via their SPI port? if so, it would be easy to implement. For example, you may connect 10 KLs like the following:

The previous KL's MISO connected with the next KL's MOSI, all the 10 KLs are configured as SPI slave, and their CLKs and CSs are connected with the external master's clk and cs signals. Please note the second KL will wait one data before it fetch the first valid data because the first data are from the previous KLs' shift register, and so on.

Hope that helps,

B.R

Kan

0 项奖励
回复

2,285 次查看
joginderrana
Contributor II

HI, I am very new to Freescale Kinetic microcontrollers. I am working on FRDM-k20d50m development board and trying to develop an application to interface two slaves on this development board. My requirement is to send data to 1st slave and then receive data from the same slave and then to deploy same operation on 2nd slave. If I am using one slave at a time and disconnect the other one then it works fine but if I connect two slaves the at same time I am not receiving any data from slave. The basic code to initiate SPI communication between two slaves is as below:

/* Below block of code reads data from first slave*/

  SM1_SelectConfiguration(SPI, ChipSelect, AttributeSet); (WHAT WOULD BE THE SYNTAX IF I WANT TO SELECT CHIP-1; AS OF NOW I AM USING VARIABLE CHIP SELECT_1 =1, TO SELECT CHIP-1)

  SM1_SendBlock(SPI, out_data, sizeof (out_data));

  SM1_ReceiveBlock(SPI, &in_data, sizeof (in_data));

  /* Below block of code reads data from second slave*/

  SM1_SelectConfiguration(SPI, ChipSelect_1, AttributeSet_1);

    SM1_SendBlock(SPI, out_data, sizeof (out_data));

        SM1_ReceiveBlock(SPI, &in_data_1, sizeof (in_data_1));

Please help me to make the communication possible with two slaves at the same time.

I have attached my settings screen shots. PFA.

0 项奖励
回复

2,285 次查看
Paul_Tian
NXP Employee
NXP Employee

Hi, David

Sorry, so what is your question on your application?

Best Regards

Paul

0 项奖励
回复