Hi NXP,
I am using NXP55s69 Evm. I built adc_dt example and flashed the code.
My adc counts output is not stable.
I have a suspect
zephyr,reference = "ADC_REF_EXTERNAL0";
in overlay file
output ADC Counts if use External Ref in overlay.
00> - adc@A0000, channel 2: 1304 = 1050 mV
00> ADC reading[5]:
00> - adc@A0000, channel 2: 1300 = 1047 mV
00> ADC reading[6]:
00> - adc@A0000, channel 2: 1300 = 1047 mV
00> ADC reading[7]:
00> - adc@A0000, channel 2: 1306 = 1052 mV
00> ADC reading[8]:
00> - adc@A0000, channel 2: 1297 = 1044 mV
00> ADC reading[9]:
00> - adc@A0000, channel 2: 1308 = 1053 mV
00> ADC reading[10]:
00> - adc@A0000, channel 2: 1294 = 1042 mV
00> ADC reading[11]:
00> - adc@A0000, channel 2: 1294 = 1042 mV
00> ADC reading[12]:
00> - adc@A0000, channel 2: 1304 = 1050 mV
00> ADC reading[13]:
00> - adc@A0000, channel 2: 1298 = 1045 mV
00> ADC reading[14]:
00> - adc@A0000, channel 2: 1304 = 1050 mV
00> ADC reading[15]:
00> - adc@A0000, channel 2: 1316 = 1060 mV
00> ADC reading[16]:
00> - adc@A0000, channel 2: 1303 = 1049 mV
00> ADC reading[17]:
00> - adc@A0000, channel 2: 1315 = 1059 mV
00> ADC reading[18]:
00> - adc@A0000, channel 2: 1300 = 1047 mV
00> ADC reading[19]:
00> - adc@A0000, channel 2: 1303 = 1049 mV
if i configure it as External, should i need to give external input to reference voltage???
If i use internal, adc is not working
00> *** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
00> *** Using Zephyr OS v3.6.99-100befc70c74 ***
00> Could not setup channel #0 (-22)
if i configure it as
zephyr,reference = "ADC_REF_VDD_1";
my output is
00> *** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
00> *** Using Zephyr OS v3.6.99-100befc70c74 ***
00> Could not setup channel #0 (-22)
what should i do now?
it is all working irrespective of calibration flag
struct adc_sequence sequence = {
.buffer = &buf,
/* buffer size in bytes, not number of samples */
.buffer_size = sizeof(buf),
.calibrate = "false"
}; if i set it as true also my output is same
The below is my overlay file
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
/ {
zephyr,user {
io-channels = <&adc0 2>;
};
};
&adc0 {
#address-cells = <1>;
#size-cells = <0>;
status="okay";
calibration-average = <128>;
channel@2 {
reg = <2>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_EXTERNAL0";
zephyr,vref-mv = <3300>;
zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_TICKS, 7)>;
zephyr,resolution = <16>;
zephyr,input-positive = <MCUX_LPADC_CH4B>;
};
};
how to configure to get adc counts without fluctuations