How do I set the calibration mode of ADC?

How do I set the calibration mode of ADC?

The following are the steps involved for calibrating the ADC PGA offset and gain errors:

  1. Calibrate ADC offset for each PGA gain setting by connecting the 1.11V ADC reference to the P mux and N mux of the ADC.
  2. For PGA gain of 1, 1.5 and 2 the gain calibration is done using the internal 1.82V reference.

What is ADC calibration?

Calibration is performed by feeding two known reference values into two ADC channels and calculating a calibration gain and offset to compensate the input readings from the other channels. The best possible accuracy achievable is limited by the channel-to-channel gain and offset errors of the ADC.

How is ADC gain calculated?

The gain and offset error will be calculated using the equation of a straight line y = mx + b, where m is the slope of the line and b is the offset. The gain error can be calculated as the slope of the actual ADC output divided by the slope of the ideal ADC output.

How to configure ADC pins in stm32f3?

ADC pins configuration  Enable the clock for the ADC GPIOs using the following function: RCC_AHBPeriphClockCmd (RCC_AHBPeriph_GPIOx, ENABLE);  Configure these ADC pins in analog mode using GPIO_Init ();

How often is a channel converted in STM32?

This means that the channel is converted every 7 clock cycles. Each ADC converts the channel every 14 ADC clock cycles. With a 14 MHz ADC clock, it is thus possible to reach 2 Msamples per second: 14 MHz/7 = 2 MHz (sampling frequency).

How often does STM32 ADC handler need to be invoked?

Some device families may also require the following code in your SystemClock_Config () function: Now you can start your program and see that it is no longer spending all its time in the interrupt handler, as the handler is now only invoked once for every 8192 ADC values.

How is the sampling rate of STM32 ADC calculated?

The ADC Sampling Rate (Frequency) is calculated using this formula: For The Previous example where Tconv = 1µs, The samplingRate = 1000000 = 1Ms/sec The STM32 ADC has a resolution of 12-Bit which results in a total conversion time of SamplingTime+12.5 clock cycles.