Hi, Friend,
Regarding your question, if you use the api function defined in arm_math.h, you have to know the data type in the api function. When you use 16 bits mode and differential mode of ADC to sample external analog signal, the sample can be positive or negative,we say that the sample is in q16 mode, this is the q16 mode representation. In differential mode, the maximum positive is 0x7FFF(32767 in decimal) , which represent 3.3V, the minimum negative value is 0x8000, which represents -3.3V. In differential, the ADC range is enlarged twice, in other words, the adc range is from -3.3V to +3.3V, the total range is 6.6V. In differential mode, the ADC resolution is 6.6V/65535. In the case, you can call the function with q16 data type.
If you use 16 bits mode and single-ended mode of ADC, because the ADC can not sample/represent negative, you will get the value from 0 to 65535, the 65535(0xFFFF) represent 3.3V. In other words, the ADC range is 3.3V instead of 6.6V as that of differential mode. in single-ended mode, the ADC resolution is 3.3V/65535.
I think it can explain why you get half in differential mode than than in single-ended mode.
Hope it can help you.
BR
Xiangjun Rong
