AD7173 read data incorrectly

Hi, 

I'm developing an API for this ADC. I could write and read data to and from the registers correctly but I can't get the Adc data correctly. As I understand, after reset (64 clock cycles of HIGH DIN), the ADC is ready to be used, so all i need is to request the data from the data register (0x04) right? However, this doesn't work so I also tried to set up register myself as below. This is my test setup.

AD7173_Reset ();

// Configure channel 0: This setting should automatically be applied after reset

uint16_t ch0Config = CH_EN|SETUP0|AINPOS0|AINNEG1;
AD7173_WriteToCH0 (ch0Config);  

// This is to test if my write was correct
uint16_t ch0 = AD7173_GetChannelSetting (CH0);
TEST_ASSERT_EQUAL_HEX16 (0x8001, ch0);


// Configure setup0
uint16_t setup0Config = BIPOLAR|REF_INT;
AD7173_WriteToSetupCon0 (setup0Config);

// Configure filter0: data rate 31250 sps
uint16_t filter0Config = kSPS_31;
AD7173_WriteToFiltCon0 (filter0Config);

// Skip offset and gain compensation: should be 0x800000 and 0x5xxxxx0 after reset

// Configure ADC mode register
uint16_t adcModeConfig = us_32|SINGLE_CONV;
AD7173_WriteToADCMode (adcModeConfig);

// Configure interface mode register
 uint16_t ifModeConfig = 0;
 AD7173_WriteToIFMode (ifModeConfig);

// Implement delay base on sinc5+sinc1 filter for that ODR (page 31)
SysClock_usDelay (161);

uint32_t mV = AD7173_GetmV (); // i havent implement conversion because I want to read the raw value
TEST_ASSERT_EQUAL_HEX32 (0,mV);

But I can never get a reasonable result. It returns the same value no matter what channel or input: 0x00axxxxx0. Can someone help me with this?

Thank you,



just want to clarify why i test Hex32 instead of float value. I havent implement the conversion because i wanted to read the raw value coming from the data register
[edited by: MLac791 at 6:52 PM (GMT 0) on 20 Jun 2019]