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.

1 ACCEPTED SOLUTION

Accepted Solutions
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".

View solution in original post

13 REPLIES 13
AScha.3
Chief III

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 ?

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

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

Hi,

ok, right. So on SADC ...

try setting : without offset , gain = 1 .

+

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

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

When I do gain=1;

I get max:32765 at 1.65V.

But this seems ok : at Vref. 3.3 -> 1/2 = 1.65V = 32k .

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

No, when gain=1/2 i get 32767 at 3.3V

when gain=1 I get 32767 at 1.65V

WHY "no" ?

>when gain=1 I get 32767 at 1.65V

Yes, thats right. Full scale is at 3.3 , as you wrote in your first post:

> I have single-ended input 0V to 3.3V.

ok now ?

Or what you want then ? other range ?

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

ıs it possible to get 16 bit (65535) for 0 to 3.3V single ended input? I never get 65535 in full scale.

What you get now at 3v3 input ? (gain 1 , no offset) + read data as uint16_t .

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