SPI Master and slave configuration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
SPI connection master sending some data if the data matches the data recived by the slave the led glows.
I am not able to recieve the data, and glow the led on the slave, is there something wrong in my code. A suggestion would be great.

Thank you,
Ravi.

Code for master configuration:#include
int main(void)
{

uint16_t data[]={0xAB};
uint16_t i;
DAVE_Init(); // Initialization of DAVE Apps
for(i=0;i<10;i++)
{
SPI001_WriteData(&SPI001_Handle0,&data,SPI001_STANDARD); //send one byte
}
while(1);
return 0;
}

Master = Hexagon board with a pin extender
MRST= pin 2.5
MTSR = pin 3.13
clouk out= pin 3.0
Chip select = pin 3.11

code for slave configuration
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)

uint16_t data[10],j;
DAVE_Init(); // Initialization of DAVE Apps

for(j=0;j<10;j++)
{
SPI003_ReadData(&SPI003_Handle,&data);
}
if(data== 0xAB);
{
IO004_ResetPin(IO004_Handle0);
}

while(1)
{

}
return 0;
}


slave configuration = Relax kit
MRST= pin 0.1
MTSR = pin 0.0
clouk in= pin 0.10
Chip select = pin 0.9
0 Likes
0 Replies