we are working ADAS3022EDZ Eval board to communicate SPI through Arduino board. please help me
1) It looks like you attempted to implement the configuration sequence but you did not allow the conversion to complete before you started the rest of your data capture. If you have a us timer I would recommend adding a wait 1us between your clear_conversion(); statement and the readback.
// Configure Device
gioSetBit(spiPORT3, 0, 0);spiTransmitAndReceiveData(spiREG3, &dataconfig1_t, 8, HV_SPI_TX_Data_Master,&HV_SPI_RX_Data_Master);gioSetBit(spiPORT3, 0, 1);
2) Similarly in the channel code you'll need to add a wait or use busy going low as an interrupt to either asynchronously or synchronously time the transmission of the data word after convert start.
gioSetBit(spiPORT3, 0, 0);
spiTransmitAndReceiveData(spiREG3, &dataconfig1_t, 1, HV_SPI_TX_Data_Master_1,&HV_SPI_RX_Data_Master);
HV_SPI_Voltage = (float) ((((float)HV_SPI_RX_Data_Master / 32768.0) * INPUT_VOLTAGE_RANGE));gioSetBit(spiPORT3, 0, 1);
3) Finally I would recommend you verify your code conversion statement is correct such that the 16-bit signed data is correctly interpreted to generate signed integers. Given the float type I'm concerned the code will interpret the output at 0-65535 instead of -32768 to 32767. You can probably fix that by changing the inner cast statement to signed 16 bit integer cast and then float around that information when you do the divide by 16. I don't have an Arduino IDE or interpreter installed myself so I can't verify that I'm 100% correct but it should be easy for you to do so.
Hope that helps
One thing I noticed and forgot to mention last time I responded was to change your SPI mode to MODE 0, CPHA = 0, CPOL = 0.
I will be on holiday over the balance of the week but I'm going to ask a colleague to watch this thread. Please included updated timing diagrams of your code execution if the SPI Mode trick doesn't fix your readback. Please also indicate what your input conditions are so that we can help assess the trouble you are seeing.