How to read ADC with Dual Regular + Differential mode?
Hello!
I have found a lot of examples about simple ADC reads, with:
-single channel single conversion
-single channel continuous conversion
-multi channel single conversion
-multi channel continuous conversion
And these with polling, interrupt and DMA.
I need to measure singple phase AC voltage and current.
Hardware built up:
-VDDA 3.3V
-VSSA AGND
-Vref 3V
-PA6-PA7 differential pair AC voltage
-PC4-PC5 differential pair AC current
I need Dual Regular mode plus Differential read.
Hardware side without load (0V AC) on both pair I have 1.5V. For example if there is 100V AC then PA6 bigger than 1.5V, PA7 smaller than 1.5V. This differential value I need to measure.
Right now without success.
In stm32cubeL4 examples have found this: Diff conversion result = mid-range + (channel_high-channel_low)/2
In 16bit case this means: (let's say 1.5V = ~33500)
without load: 32768-65536 + (33500 - 33500) / 2 = -32768 ???
with load: 32768-65536 + (33800 - 33200) / 2 = -32468 ???
I need only the difference: 33800 - 33200 = 600
I don't really know how to do it in right way. Not so much useful examples on web.
The questions:
-How to adjust cubeMX for ADC1 differential pair?
-How to adjust cubeMX for ADC1+ADC2 in dual mode + differential pair?
-How to start and get value with HAL from differential pair?
-How to start and get value with HAL from dual mode + differential pair?
It must be possible.
For start no matter is it polling, interrupt, or DMA
STM32 H743ZI
C
Thanks for every answers
Szilveszter
