cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F373 SADC how to get 0-3.3V 16 bit(65535)?

MehmetKaya
Associate III

Hello Friends,

I use STM32F373 for 16-bit SADC.

I have single-ended input 0V to 3.3V. VREFSD+=3.3V and VREFSD- =0V

When input Voltage change from 0V to 3.3V I get values 0 to 32767. Is it not possible to get 16-bit (65535) data?

Always signed?

my configuration;

ConfParamStruct.InputMode = SDADC_INPUT_MODE_SE_OFFSET;
ConfParamStruct.Gain = SDADC_GAIN_1_2;
ConfParamStruct.CommonMode = SDADC_COMMON_MODE_VSSA;

Thanks a lot.

13 REPLIES 13

1.65V to 3.3V always 32767.

32767.

HAL_SDADC_Start(&hsdadc1);

HAL_SDADC_PollForConversion(&hsdadc1, 100);

adcResult = HAL_SDADC_GetValue(&hsdadc1); // unsigned int adcResult;

TDK
Guru

 

> SDADC_INPUT_MODE_SE_OFFSET

With this, values will always be 0 to 32767.

TDK_1-1722337891631.png

 

You want single ended zero reference mode instead. Not offset.

The output will still be signed, but the full range of 65535 values will be present.

TDK_0-1722337862480.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Thank you very much. it worked.