Skip to main content
Graduate
July 30, 2024
Solved

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

  • July 30, 2024
  • 3 replies
  • 2885 views

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.

    This topic has been closed for replies.
    Best answer by TDK

     

    > 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

     

    3 replies

    Super User
    July 30, 2024

    Hi,

    ADC is unsigned - always. (0...Vref = max.)

    And on F373 ADC is 12bit - so how you get 16 bits data : read 16 times  and add ?

    Graduate
    July 30, 2024

    Hi Friend, STM32F373 has 12-bit ADC and has SADC which is 16-bit.

    Super User
    July 30, 2024

    Hi,

    ok, right. So on SADC ...

    try setting : without offset , gain = 1 .

    +

    ADC is unsigned - always. (0...Vref = max.) (without offset setting).

    Graduate
    July 30, 2024

    When I do gain=1;

    I get max:32765 at 1.65V.

    TDKAnswer
    Super User
    July 30, 2024

     

    > 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

     

    Graduate
    July 30, 2024

    Thank you very much. it worked.