2018-08-08 10:26 AM
Hi Everyone!
I have read a lot of topics, articles about the F070 ADC settings, calibration, etc., but I couldn't solve my issue. I'm using ADC with DMA right now, but the problem is the same with the interrupt and the polling method. In my code I'm using 3 channels (2 simple ADCs and the Vref). The result of the Vref channel is about 3.4V but I measure 3.31V with voltmeter (the other channels have this kind of problem too). Calibration is used by every 4th cycle and I have a 100nF capacitor between the Vcc and the GND and input filter as well.
I hope You can help.
Thanks in advance.
Andras
2018-08-11 01:22 PM
2018-08-12 03:05 PM
Its just a voltage measurement.
I would like to make an MPPT solar battery charger but first I must get accurate values, so I wrote the simplest code, using the HAL library.
I have already made a measurement with interrupt via the registers but it gave wrong values too.
This is my first own project so I'm a bit newbie but doing my best
2018-08-12 03:08 PM
I am not convinced that your cal is actually calibrating.
what is the resultant cal-factor ? I am getting 0x41...
2018-08-12 03:15 PM
I'm getting 0x39
2018-08-12 03:45 PM
do you notice that after a power on, the values are different to when the cal is completed ?
I can see after calibration, the jump in readings is significant.
2018-08-13 12:24 PM
I can't see any significant change after the calibration
I have tried the register level calibration code too, but the result is the same.
2018-08-13 12:43 PM
I have tried something else
I'm using a DC-DC converter as supply with changing the voltage
My results (around values):
STM voltmeter
3,38 3,32
3,5 3,43
3,65 3,58
The change seems to be linear
2018-08-14 04:27 AM
60mV is shocking
where is your ground connection to the meter ?
to check Vdd, you should be across the cap nearest to the Vdd/Vss pins.
both multimeter probes across that cap.
did you use any ferrites ?
its likely that switcher noise is being rectified inside the processor.
2018-08-14 02:19 PM
I'm measuring the volts on the cap of the Vss and the Vdd.
I could send you my whole circuit if it helps.
2018-08-14 02:41 PM
60mV error means there is a major issue, I have 1-2mV error.
did you make the PCB ? maybe you need more caps, or your code is not ok.
You want the slowest rate of conversion on the slowest ADC clock and use NON-BLOCKING code...
download an example, surely it is better than 60mV error..
We are not here to do your work, what is your work ?
are you designing a PCB for a product ?, or hobbyist just getting use to the technology ?
If you plan to work in this area, you need NON-BLOCKING code, more like an OS...
its easy to do... (without RTOS or malloc)
this forum purpose is to help with syntax and structure operations etc.
reading the ADC is supposed to be simple, but because your code is blocking, every issue delays everything else..