STSPIN32F0A ADC misbehaving?
I have run into problems with ADC of STSPIN32F0A (STM32F031C6) apparantly misbehaving.
The ADC is running on it's own 14 MHz asynchronous clock while MCU runs at 48 MHz.
After trying to measure current on the STEVAL-SPIN3202 board in 6-step setup I come to the conclusion there is too much noise to deliver smooth control.
I set up a test of just reading the potmeter coupled in on ADC channel 4 on the board using different sample&hold times. What I discover is discrete errors.
With 1000 readings at 10ms intervall of potmeter adjusted to approximately give 1000 in raw value from ADC I received data containing only the values 975, 979, 983, 987, 991, 995, 999 using 13.5 cycles capture&hold.
Looking at these in binary I see:
975 = 00000011 11001111
979 = 00000011 11010011
983 = 00000011 11010111
987 = 00000011 11011011
991 = 00000011 11011111
995 = 00000011 11100011
999 = 00000011 11100111
Lower 2 bits seem stuck at 1 and the total noise is far too high.
Measuring externally I see approximately 832mV on the input.
Keep in mind there is a 4.7nF capacitor to help buffer the signal being drawn in by the 8pF internal ADC capacitance. This should be ok for a somewhat close reading.
I cannot find any errata for the STSPIN32F0A so I am unsure if this is known or discussed.
