cancel
Showing results for 
Search instead for 
Did you mean: 

16 Bit SDADC is only giving 15 Bit value

RKage.3
Associate

I am running both SDADCs on a STM32373C-EVAL evaluation board. One of them is giving me the correct values from 0-65.535 but the second one is giving me 0-32.767 on the same voltage.

I have configured them using the Cube IDE and Hal. They are set up exactly the same. Both values are stored as uint32_t for good measure. does anyone have any idea what could be going on?

Sampling code for reference:

  HAL_SDADC_Start(&hsdadc1);
  HAL_SDADC_Start(&hsdadc2);
 
  HAL_SDADC_PollForConversion(&hsdadc1, 10);
  HAL_SDADC_PollForConversion(&hsdadc2, 10);
 
  raw1 = HAL_SDADC_GetValue(&hsdadc1);
  raw2 = HAL_SDADC_GetValue(&hsdadc2);

1 REPLY 1
Igor Cesko
ST Employee

Please check if both SDADCs are configured in the same mode:

Differential mode

Single-ended offset mode

Single-ended zero reference mode

And eventually please check the used gain for both SDADCs.

It is better to check those configuration directly on SDADC registers during debug.

Regards

Igor