twainerm
Newbie level 4
I am using quad spi to talk to an external ADC device. I am unable to read data back from ADC. quad spi IP is configured to master.
when I hook up my board to logic analyser, I do some read data but I am not able print it out or use it for any calculation. Also I see that data from ADC on logic analyser is available as the same clock that i send data to ADC.
Here is my code.
Now here when i print rd_data, I get zero.
Please can anyone help me understand what the issue is and how to fix it.
Mark
when I hook up my board to logic analyser, I do some read data but I am not able print it out or use it for any calculation. Also I see that data from ADC on logic analyser is available as the same clock that i send data to ADC.
Here is my code.
Code:
u8 wr_data[3];
u8 rd_data[3];
ConfigPtr = XSpi_LookupConfig(SpiDeviceID);
Status = XSpi_CfgInitialize(SpiInstancePtr, ConfigPtr,
ConfigPtr->BaseAddress);
Status = XSpi_SelfTest(SpiInstancePtr);
Status = XSpi_SetOptions(SpiInstancePtr, XSP_MASTER_OPTION | XSP_MANUAL_SSELECT_OPTION);
XSpi_Start(SpiInstancePtr);
XSpi_IntrGlobalDisable(SpiInstancePtr);
wr_data[0] = 0x01;//start bit is lsb
wr_data[1] = 0xA0;//
wr_data[2] = 0x55;// can be anything.
XSpi_SetSlaveSelect(SpiInstancePtr, 0x01);
Status = XSpi_Transfer(SpiInstancePtr, wr_data, rd_data, 3);
Now here when i print rd_data, I get zero.
Please can anyone help me understand what the issue is and how to fix it.
Mark
Last edited by a moderator: