2018-06-09 05:28 AM
Hey Guys,
I am using the ADC1 to sample A0 as a voltage input and A17 and A18 as temperature and VrefInt for Temperature and exact Vdda calculaion. So far my implementation works fine. I also calibrate the ADC everytime before I start the ADC. Datahandling is done via DMA in circular mode, so continous.
I also want to use the analog WatchDog to check wether my voltage on A0 is inside a specified range (0,8V - 3V). Sadly when I programm the lower and upper threshold value for the watchdog and try to test it with my laboratory power supply, The watchdog triggers from 2,7V not 3. When I compare the converted values I see some overshots in reading. As I am avagering my calculated values this is not bothering me, but for the accuracy of the WatchDog this is a problem.Has anybody seen this kind of behaviour before? Am I doing something wrong, or forgot something? Or is this inherent since the integrated ADC is simply not very accurate?
For the thresholds I used the following formula: HT = 3V * 4095/3,3V and LT = 0,8V * 4095/3,3V
So I would be happy for any help
best regards
Benjamin
#analog-watchdog #adc #adc-accuracy2018-06-10 04:14 PM
After a calibrate cycle it should be better.
2018-06-11 12:25 AM
How about your input circuitry, you have proper impedances ?
The datasheet specifies VDDA must be >= than VDD, is this satisfied ?
Is your VDDA stable ?
2018-06-11 01:18 AM
Hello TJ,
I allready wrote, that I calibrate before every start of the ADC, so I doubt that this could better the situation.
best regards
Benjamin
2018-06-11 01:52 AM
you are using 12bit data I guess,
otherwise you would have to translate through Table 47 Analog watchdog comparison
6 - 12Bit decoder RM 0091 p249
did you see app note AN4195 ?
2018-06-11 03:55 PM
Hey TJ,
yes I use 12Bit. No I did not know that AppNote. I will check on it, thx.
best regards
Benjamin
2018-06-11 04:04 PM
Hello AvaTar,
I use a laboratory power supply..so I have only a neglegible output impedance, but you are right, his could be perhaps a problem with my long sampoling time, I will check on that tomorrow.
I am using a Nucleo board, so I think, hope that Vdda is stable, but I will also check on that tomorrow.
Vdda >= Vdd?? This is wrong. and makes no sense to me. Even the datasheets don't cover this statement.
best regards
Benjamin
2018-06-12 01:03 AM
Vdda >= Vdd?? This is wrong. and makes no sense to me. Even the datasheets don't cover this statement.
en.DM00088500.PDF, section 3.5.1, page 13:
The VDDA voltage level must be always greater or equal to the VDD voltage level and must be provided first.
The same in section 3.5.2.
Section 6.2, page 42:
VDD–VDDA, Allowed voltage difference for VDD > VDDA : max. 0.4 V
Section 6.3.1, page 44:
VDDA, Analog operating voltage, Must have a potential equal to or higher than VDD , 2.4 ... 3.6 V
But without actually checking it, I believe VDDA is directly connected to VDD on the Nucleo board, so this condition is fulfilled.
But have you measured VDD/VDDA ?
And have you checked the ADC with reference input voltages, especially in the 2,5 ... 3,0 V range ?
2018-06-12 02:02 AM
Hey AvaTar,
sorry for my arrogance! Obviously I did not check the complete datasheet for every entry on Vdda. I will today measure the voltages. Yes I tried a lot of different voltages. As I am avaeraging for the calculated values, the results are pretty good, but I don't check on every sampled raw value in my array. The AWD is also trigerring randomly after x samples, so this is no deterministic behaviour.
best regards
Benjamin
2018-06-12 03:06 AM
sorry for my arrogance!
Rather negligence ...
Yes I tried a lot of different voltages.
Have you tried voltage is said range, especially around 2,7V ?
Lab power supplies are not always that accurate. Have you cross-checked with a calibrated voltmeter ?
BTW, check the Nucleo schematics.
The ST discovery boards use to have shottky diodes in the supply path to avoid damage with multiple power inputs. This reduces VDD (and VDDA) to about 3.0V, and makes it drift, depending on supply current.
The Nucleo boards might have the same feature. At least check the actual VDD/VDDA value.