2021-02-23 11:23 AM
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);
2021-03-05 01:56 AM
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