STM32L476 DAC usable range and ADC offset
Using the Nucleo-L476RG development board for code development for a design prototype. What is the expected linear range of the DAC?
For the linear range, I am measuring the lower bound of the DAC about 55mV and upper bound about 3.271V.
Below and above this range the DAC rails. Vref (pin AVDD) is measured at 3.3191V.
This testing implies that the usable DAC range is approximately 70 counts to 4030 counts with resolution of 0.81mV/cnt (i.e. 3.319/4096 ... or 0.806mV/cnt if 3.3/4096), no?
If I execute the 'ADC_SingleConversion_TriggerSW_IT' program, the following DAC values are used (per comments in code)
/* Set DAC output on 5 voltage levels, successively to: */
/* - minimum of full range (0 <=> ground 0V) */
/* - 1/4 of full range (4095 <=> Vdda=3.3V): 1023 <=> 0.825V */
/* - 1/2 of full range (4095 <=> Vdda=3.3V): 2048 <=> 1.65V */
/* - 3/4 of full range (4095 <=> Vdda=3.3V): 3071 <=> 2.475V */
/* - maximum of full range (4095 <=> Vdda=3.3V) */
What I obtain:
DAC CNT|uhADCxConvertedData|uhADCxConvertedData_Voltage_mVolt|Measured DAC (LeCroy)
0 | 0 | 0V | 55.4mV
1023 | 983 | 793mV | 850mV
2048 | 2011 | 1.619V | 1.680V
3071 | 3035 | 2.444V | 2.500V
4095 | 3994 | 3.218V | 3.271V
The calculated DAC voltage (from ADC) is approx 56mV in error compared to measured DAC voltage.
Is this an offset within the ADC and can this be calibrated out internally via HAL/MIX/LL calls or do I have to write an ADC calibration routine?
Issue: I am doing motor control and need to use an external Vref as a basis. The offsets in the DAC and ADC need to be calibrated out and the linear range of each conversion (DAC and ADC) is required
#stm32l476-dac #stm32l476-adc