Skip to main content
Graduate
December 26, 2023
Question

STM32L432 Nucleo board: ADC has -53 mV input offset ?

  • December 26, 2023
  • 2 replies
  • 1379 views

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?

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    December 26, 2023

    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 

    Graduate
    December 26, 2023

    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.

    Technical Moderator
    December 27, 2023

    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 

    Super User
    December 26, 2023

    Probably this is a test setup error. Did you calibrate the ADC before using? Low impedance signal source, with high sampling time?