cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G431KBT question about ADC input range and gain compensation, SE vs differential and oversampling ENOB

ChazLuke
Associate II

The data sheet on page one shows 0 to 3.6V input range but rm0440 says the ADC input range is -Vref to +Vref.where I believe the Vref is 3.6V? Can you explain the difference in specifications? Also, can you explain how this range changes with being single ended vs differential? Also, there is a gain compensation register for the ADC that can go from 0 to 3.999756x. Does this voltage range assume a compensation value of 1x? If I use different gain compensation values, how does that affect the input range specification? 

I have an input that is about half of 3.6V. Can I use gain compensation to reach close to fullscale? I need to multiplex between 4 different inputs.

If I use oversampling will the ENOB improve? At normal sampling 12 bits has a little over 10 ENOB. With oversampling how much increase in ENOB can I expect. I realize this is dependent on how much oversampling is done. I just want to know if there are some static errors that will limit this.

1 ACCEPTED SOLUTION

Accepted Solutions

Correct. It's not used at all in single ended mode. You can use that pin for something else.

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

View solution in original post

7 REPLIES 7
TDK
Guru

> The data sheet on page one shows 0 to 3.6V input range but rm0440 says the ADC input range is -Vref to +Vref.where I believe the Vref is 3.6V? Can you explain the difference in specifications? Also, can you explain how this range changes with being single ended vs differential? 

VREF- is VSSA which is 0V. It is not -3.6V.

The converted input range is VREF- (0V) to VREF+ and is the same in single ended and differential modes. In differential mode, both inputs need to be within this range. You can never convert negative voltages.

There is no "VREF" mentioned without a + or - at the end.

 

Gain compensation is a post-processing step on the data. It does not increase accuracy.

 

Anecdotally, you can get around 16 ENOB with enough oversampling as the noise is roughly normally distributed. However, this will drift over time. Temperature is the biggest issue here as everything is dependent on temperature. Using a good external reference will vastly improve accuracy and stability.

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

Thanks for the response. You've helped clarify some things and I've had more time to dig thru all the documents.

Single ended then is 0V to 3.6V. Using Pin+ as input, for Pin- can I just ground it, or does it need to be at 3.6V/2? My assumption here is that Pin+ = 0V, ADC output = 0     For Pin+ = 3.6V, ADC output = Fullscale

Differential is 0 V to 3.6V on both pins so differential can effectively go over 2X 0 to 3.6V. With differential each input needs to have a common mode of 3.6/2.

Example Pin+ can be at 0 while Pin- can be at 3.6, effectively -3.6 differential, ADC output = 0

Example Pin- can be at 0 while Pin+ can be at 3.6, effectively +3.6 differential, ADC output = Fullscale

Example Pin- = 3.6/2 and Pin+ = 3.6/2, ADC output = Fullscale/2

For differential effectively this gives a 3.6VX2 swing.

Whether you have SE or DIFF does the input voltage range then match the Fullscale range of the ADC? Can I assume there is some sort of scaling to make that happen when you choose the register setting for SE vs DIFF?

RM0440 makes this statement in 21.4.7 "The ADC sensitivity in differential mode is twice smaller than in single ended mode.". What does this mean? sensitivity is twice smaller. This sounds convoluted. What are we trying to say here, one doesn't reach fullscale, or one has higher quantization floor, or one has better SNR?

Gain Compensation is post conversion and is not analog? I guess the purpose is to maintain the dynamic range of the processing that comes after the conversion? Sounds like I need to use the internal opamp if I want true gain before conversion?

For the ENOB discussion, the 12bit case only reaches an effective ENOB of around 10. I assume the oversample case is the same and that we won't really reach an ENOB of16. I understand the processing gain that comes from oversampling and averaging. Noise is random while signal isn't. I guess the final ENOB will probably be limited by non-linearities.

> Whether you have SE or DIFF does the input voltage range then match the Fullscale range of the ADC?

Your assumptions here are correct. With differential, the LSB is twice what the LSB is in single ended mode. A differential reading of 0 V will be at midscale, rather than at 0 counts in single ended mode. A reading of 3.6V will be full scale either way. Agreed the RM statement is awkward, but probably technically correct.

> Gain Compensation is post conversion and is not analog? 

Per the reference manual:

TDK_0-1724121747144.png

It can be useful in oversampling.

I assume the oversample case is the same and that we won't really reach an ENOB of16. I understand the processing gain that comes from oversampling and averaging.

Yes, probably. You can get 1 LSB of precision or short-term repeatability, but it won't be accurate to that degree due to other errors in the system.

> Noise is random while signal isn't. I guess the final ENOB will probably be limited by non-linearities.

Yep. The datasheet lists these max errors. The onboard ADC is quite good, particularly if you set up VDDA/VREF+ appropriately and manage signal cross talk, but it's not going to match a discrete ADC in terms of performance.

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

One question still unanswered.

Single ended then is 0V to 3.6V. Using Pin+ as input, for Pin- can I just ground it, or does it need to be at 3.6V/2?

You can ground it. But if you're grounding it, why not just use single ended mode instead? You'll lose out on half the range.

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

The question is regarding single ended. Your answer implies that I don't need to worry about Pin- for single ended?

Correct. It's not used at all in single ended mode. You can use that pin for something else.

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