data=fgetc(COM1);
spi_write(data);
spi_read();
delay_ms(10);
data1=spi_read(0);
data1=data1<<1; //solving the problem like that
printf("The Response=%x\n\r",data1);
I suspect you may be using the wrong signaling with your SPI. You can setup the SPI for any of the 4 modes. Using the wrong mode can cause a problem like this. Also it looks like you are shifting left.
What is the device you are communication to with SPI?
How have you setup the SPI?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum