2024-07-30 01:52 AM
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.
Solved! Go to Solution.
2024-07-30 04:11 AM
> SDADC_INPUT_MODE_SE_OFFSET
With this, values will always be 0 to 32767.
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.
2024-07-30 02:17 AM
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 ?
2024-07-30 02:19 AM
Hi Friend, STM32F373 has 12-bit ADC and has SADC which is 16-bit.
2024-07-30 02:38 AM - edited 2024-07-30 02:40 AM
Hi,
ok, right. So on SADC ...
try setting : without offset , gain = 1 .
+
ADC is unsigned - always. (0...Vref = max.) (without offset setting).
2024-07-30 02:50 AM
When I do gain=1;
I get max:32765 at 1.65V.
2024-07-30 02:53 AM
But this seems ok : at Vref. 3.3 -> 1/2 = 1.65V = 32k .
2024-07-30 02:58 AM
No, when gain=1/2 i get 32767 at 3.3V
when gain=1 I get 32767 at 1.65V
2024-07-30 03:02 AM
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 ?
2024-07-30 03:04 AM
ıs it possible to get 16 bit (65535) for 0 to 3.3V single ended input? I never get 65535 in full scale.
2024-07-30 03:09 AM - edited 2024-07-30 03:14 AM
What you get now at 3v3 input ? (gain 1 , no offset) + read data as uint16_t .