2012-01-03 12:36 AM
ADC Tests with stm32value eval board.
PC4 as AD Input, conversion all 20msec, 20turn Pot with 22k u1 RC Filter to PC4. Software looks for max and min adc values. I let it run for 30000 conversions: I get errors up to 16count at Zero, up to +16 / -40cnt at about half scale, -52count at full scale. Sometimes the values are stable for some hundred conversions, then extremes hit. I did the same tests with an old Keil STM32 board about 3 years ago with same results (but different software). The conversion is initialised with the slowes ADC conversion to minimize input impedance effects. Has anybody found a solution (except filtering/averaging) / has anybody found similair behaviour. Regards Werner2012-01-03 06:02 AM
the most likelu cause is the return of your filter capacitor/the return of your input
Erik2012-01-03 06:03 AM
2012-01-03 08:38 AM
My new Keil MCBSTM32F400 board has a 10k poti directely connected to port PF9, with a 100nF capacitor in between. Just this of course is very rudimentary, ok for a demo board, but in any ''real world'' application I would recommend to buffer the poti with a fast and precise OP.
2012-01-04 12:45 AM
Thank you for your inputs. >> see STM application note AN2668 page 9!
''Improving STM32F101xx and STM32F103xx ADC resolution by oversampling'' STM has done a similar thing: 1.65V gave 2050count, min was 2034 max 2076 my conclusion is: never rely on a single AD result in your application if you need more than 8bit of precision. (PID control / if else decision etc) Werner2012-01-04 12:56 AM
Thank you Erik. I made more investigations:
0805 100nF condenser between GND plane / PC4 Resistor Divider w. 2x 330Ohm Average value: 2048 max 2077 min 2011 330R Pull up to 3V3: Average 4094 min 4058 330R Pull down to GND: max 26 so the results are much better than using >22k Source impedanceThen using PC5 without 100nF: Average value: 2048 max 2070 min 2030 330R Pull up to 3V3: Average 4094 min 4084 330R Pull down to GND: max 30 (still quite high) My conclusion is this: there must be spurious charge shots out of the ADinputs. Quite rare, but if they hit the right timing, an attached condenser stores it, and corrupts the result. 1) With averaging / digital filtering you can eliminate these spurious results. Extreme values are very rare. 2) Do not use condensers on STM AD inputs. I have more than 20years experience with embedded measuring systems / analogue front ends. These effects are not there in 8051 derivates that I know, ATMEGA, PICs, also not on Stellaris Cortex M3 devices. Werner2012-01-04 07:05 AM
2012-01-04 07:32 AM
I tried to verify how AGND is routed on the eval board, unfortunately I would have to unsolder the uController. I doubt that on 3 different types of eval boards the reason is always poor grounding. I rather suspect a poor silicon mask design on the F100 family. Maybe the ones with an external reference pin show better results.. I will get some information through an STM application engineer, for now, I have to concentrate on other issues.
2012-01-04 08:16 AM
I doubt that on 3 different types of eval boards the reason is always poor grounding.
if you believe that eval boards arev ''top quality design'' you may as well believe the earth is flat Erik
2012-01-11 10:56 PM
Others seem to have come across this issue:
>
ADC glitches
(2nd page), they could actually see glitches with the scope. I had done more tests by changing the return path of the condenser directly to AVSS, instead 26counts, I achieved 20counts. Still way too much. Because it is a rare coincidence, in most applications it will go unnoticed.. Werner