2022-07-22 02:35 AM
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:
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:
With 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";
};
};
Solved! Go to Solution.
2022-07-22 06:24 AM
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.
2022-07-22 05:59 AM
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)
Regards.
2022-07-22 06:24 AM
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.
2022-07-22 06:50 AM
Hi Patrick,
Thanks for the quick response. I will try this next week!
Regards
Jan
2022-07-25 05:28 AM
Hi @jvog.sen
Please confirm you are using ecosystem v3.1 (Linux kernel 5.10) or v4.0 (Linux Kernel v5.14) ?
Regards.
2022-07-27 12:54 AM
Hi Patrick,
I am currently using ecosystem v3.1.
Regards
Jan
2022-07-27 02:56 AM
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
2022-07-27 05:33 AM
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'