WHY MISO ECHO BACK WHAT MOSI SENT, EVEN THE MISO PIN IS ALREADY DISABLED.
I make a code that is just send SPI data, and the MISO should not return anything. Here is my code:
int main(void)
{
char user_data[] = "Hello World!";
GPIO_ButtonInit();
SPI2_GPIOInits();
SPI2_Inits();
SPI_SSOEConfig(SPI2,ENABLE);
while(1)
{
while(GPIO_ReadFromInputPin(GPIOC,GPIO_PIN_NO_13));
delay();
SPI_PeripheralControl(SPI2,ENABLE);
uint8_t dataLen = strlen(user_data);
SPI_SendData(SPI2,&dataLen,1);
SPI_SendData(SPI2,(uint8_t*)user_data,strlen(user_data));
while(SPI_GetFlagStatus(SPI2,SPI_BUSY_FLAG));
SPI_PeripheralControl(SPI2,DISABLE);
}
return 0;
}
So, there should be no any SPI receivedata from MISO, but when I look the data at the logic analyzer, the MISO sent back the data from MOSI. It is like echoing, Or Is it because of the SPI nature?
this code I sent "Hello world!" the string length is 12.
First, I send the length of the string to the slave, Then, I send the Hello world! sentence to the slave.
the thing is, every data transmit from the MOSI, there will be a data sent back from MISO which is the sentence of the Hello world!
example in my picture, when I send the length 12, the MISO will exchange the " ! ". which is the last letter of hello world!
Then, when letter H is being sent, the MISO will reply back the length of the string data which is sent previously. Why is this happening? anyone can help me?
