2023-12-26 02:06 PM
I'm using a STM32L432KC Nucleo board, and reading a voltage with the 12-bit ADC. On this board the ADC Vref is connected to the board 3.3V, which in this case actually measures 3.315 V. With a 12-bit resolution, I would expect that 4095 ADC counts = 3.315 V and therefore (4095 / 3315) = 1.235 counts per millivolt. In fact, I measure the following ADC outputs for the given input voltage in mV:
mV, ADC
0, 0
53,0
54,1
64,10
72,20
80,30
100, 54
500, 549
1000, 1165
3000, 3635
3375, 4094
( Any larger voltage also measures 4094, it does not look like 4095 is an available output code.) It looks to me like the ADC has nearly the expected linear slope in counts/mV except that about 53 mV is subtracted from the input voltage first, before the ADC conversion. Is this the expected result? Is there any way to measure smaller voltages than 54 mV on the ADC with this board, without using a separate external analog offset circuit?
2023-12-26 02:32 PM - edited 2023-12-26 07:31 PM
Hello @JBeal.1
I suggest you to enable the oversampler, that may increase the accuracy. Also, you need to performe a calibration before starting conversations. For this, you may use this example.
PS: according to the ES0319, The result of an ADC conversion done more than 1 ms later than the previous ADC conversion or ADC calibration might be incorrect. So, you have to Perform two consecutive ADC conversions in single, scan or continuous mode. Reject the result of the first conversion and only keep the result of the second.
Best Regards.
STTwo-32
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.
2023-12-26 03:18 PM
Probably this is a test setup error. Did you calibrate the ADC before using? Low impedance signal source, with high sampling time?
2023-12-26 03:29 PM
The errata sheet ES0319 link is incorrect. Go to the st.com home page and do a search on the errata sheet number.
The errata sheet relates only to the K pin version.
2023-12-27 12:23 AM
Hello @raptorhal2
Apologies. I edited my post to put the correct errata reference. This later is applicable for the device embedded in the nucleo board. So it is applicable in this case.
Best Regards.
STTwo-32
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.