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.