Skip to main content
ASz
Associate
August 8, 2018
Question

STM32F070 ADC Reference voltage problem

  • August 8, 2018
  • 26 replies
  • 6149 views

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

    This topic has been closed for replies.

    26 replies

    ASz
    ASzAuthor
    Associate
    August 15, 2018

    I have to make an own project at school.

    I have chosen an mppt solar battery charger but for this operation, I have to measure voltage and current.

    I haven't seen any problems on my PCB (i designed it) so i tried to find issues at my code, but i havent found solution (i was trying to solve it for weeks) so i have decided to ask you for ideas.

    I am absolutely new at ST microcontrollers (I have learnt my "skills" from youtube tutorials)

    I have already tried a switch-case calibration (without while blocking) but im going to try it again.

    I have already tried a battery as supply.

    T J
    Senior III
    August 15, 2018

    Stick with the DC source until you find the issue.

    on the PCB, I use Star topology for the ground wire.

    all grounds come from one point.

    My Power traces are kept as a pair, going from 0.1u Cap to 0.1u Cap, then from the caps to the chips.

    These issues alone will cause voltage drops on the ground pin, which is what you are seeing.

    Other pins can also "pull" on your ADC results.

    remove any 5V source from all pins.

    simple non blocking code:

    char mSint;

    inside Systick: mSInt = true;

    Main:

    int ReCalADC = 10000;

    while(1){

    if( mSint) {

    mSint = false;

    ReCalADC --;

    if( ~ReCalADC){

    ReCalADC =10000; // recal every 10 seconds

    ProcessReCal();

    } else Read 1 ADC value; // every mSecond

    CheckSerialPortsDMAs();

    }

    }

    ASz
    ASzAuthor
    Associate
    August 17, 2018

    Thank you

    I'm going to redesign my PCB and I'm checking the ADC again.

    T J
    Senior III
    August 18, 2018

    which PCB editor are you using ?

    here you can see the wide power tracks, I'd like you to check several aspects here.

    Can you see the mouse cursor in my pic ?

    it is sitting on a capacitor pair, I used 1uF and 0.1uF here on the power supply

    then the small tracks go from the Caps to the processor.

    Can you see along the power tracks they are other Capacitor pairs ?

    T J
    Senior III
    August 18, 2018

    I guess you can't copy and paste images here...:(

    T J
    Senior III
    August 18, 2018

    ..