hi Isaac,
i could receive the data into my variable but the problem now is that i can read only last byte(LSB) from SPI0_D. I have some modifications in my code which is as follows.
UINT16 SPI_write_16bits_data(UINT8 MSB, UINT8 LSB){
UINT16 final_data;
wdin ^= 0x08; /* 0000 x000 0000 0000 ****x=wdin bit used to toggle*****/
MSB |= wdin; /* Refresh extreme switch wdog *******************************/
SPI_write(MSB); /* i dont receive this data ***************************************/
SPI_write(LSB); /* i receive data which i get from this write ******************/
spi_data[1] = SPI_read();
spi_data[0] = SPI_read(); /* this data will get to final_data *******************************/
final_data = spi_data[1];
final_data = final_data << 8;
final_data |= spi_data[0];
return final_data;
}
Regards,
Jashan M