cancel
Showing results for 
Search instead for 
Did you mean: 

Inaccurate measurement of VREFINT

jvog.sen
Associate II

Hi everyone!

I see unexpected values when measuring VREFINT. The ADC measures around 1.18V, on some boards even 1.16V, which is outside the tolerance according to the datasheet:0693W00000QLsweQAD.png 

Reading the calibration value VREFIN_CAL from OTP memory returns a value of 0x5E29 (1,214V).

Considering my ambient temperature of ~25°C, I would not expect the measured value to differ too much from VREFINT_CAL.

I then used VREFIN_CAL to calculate VREF+ according to section 29.4.35 in RM0436:

0693W00000QLsozQAD.pngWith the ADC-measurement of VINTREF, this calculates to VREF+= 2.57V. The actual voltage (measured with a multimeter) is 2.502V.

All the other ADC channels are pretty accurate.

My DeviceTree setup for ADC2:

adc2:adc@100{
	st,adc-channels = <12 13 14>;
	st,min-sample-time-nsecs = <50000>;
	assigned-resolution-bits = <16>;
	status = "okay";
	channel@12 {
		reg = <12>;
		label = "vsense";
		status = "okay";
	};
	channel@13 {
		reg = <13>;
		label = "vrefint";
		status = "okay";
	};
	channel@14 {
		reg = <14>;
		label = "vddcore";
		status = "okay";
	};
};

1 ACCEPTED SOLUTION

Accepted Solutions

sorry there is typo in the wiki, "min-sample-time-nsecs" is ok.

We are checking internally, but meanwhile, could you try putting sample time defintion inside each channel ?

e.g.

    adc2:adc@100{
    	st,adc-channels = <12 13 14>;
    	assigned-resolution-bits = <16>;
    	status = "okay";
    	channel@12 {
    		reg = <12>;
    		label = "vsense";
    	        st,min-sample-time-nsecs = <50000>;
    		status = "okay";
    	};
    	channel@13 {
    		reg = <13>;
    		label = "vrefint";
    	        st,min-sample-time-nsecs = <50000>;
    		status = "okay";
    	};
    	channel@14 {
    		reg = <14>;
    		label = "vddcore";
    	        st,min-sample-time-nsecs = <50000>;
    		status = "okay";
    	};
    };

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
PatrickF
ST Employee

Hi @jvog.sen​ 

maybe a typo in your DT which end up to a too short sample time (as per datsheet should be above 4.3us for VREFINT)

min-sample-time-nsecs ==> min-sample-time-nsec (assuming you are on Ecosystem v3.1)

See also https://wiki.st.com/stm32mpu/wiki/ADC_device_tree_configuration#Channel_properties_-28for_ecosystem_release_-E2-89-A5_v3-1-0_-29

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

sorry there is typo in the wiki, "min-sample-time-nsecs" is ok.

We are checking internally, but meanwhile, could you try putting sample time defintion inside each channel ?

e.g.

    adc2:adc@100{
    	st,adc-channels = <12 13 14>;
    	assigned-resolution-bits = <16>;
    	status = "okay";
    	channel@12 {
    		reg = <12>;
    		label = "vsense";
    	        st,min-sample-time-nsecs = <50000>;
    		status = "okay";
    	};
    	channel@13 {
    		reg = <13>;
    		label = "vrefint";
    	        st,min-sample-time-nsecs = <50000>;
    		status = "okay";
    	};
    	channel@14 {
    		reg = <14>;
    		label = "vddcore";
    	        st,min-sample-time-nsecs = <50000>;
    		status = "okay";
    	};
    };

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi Patrick,

Thanks for the quick response. I will try this next week!

Regards

Jan

PatrickF
ST Employee

Hi @jvog.sen​ 

Please confirm you are using ecosystem v3.1 (Linux kernel 5.10) or v4.0 (Linux Kernel v5.14) ?

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
jvog.sen
Associate II

Hi Patrick,

I am currently using ecosystem v3.1.

Regards

Jan

Hi again,

to be honest - I did not expect much from this attempt. But it did the trick!

I added min-sample-time-nsecs to each channel and now I am getting way better results.

Thank you!

Regards

Hi,

Glad to see your issue is solved.

Regards,

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.