About the adc_monitor sample program provided by the Presense SDK

Asked 2 years ago, Updated 2 years ago, 90 views

I use a combination of the main board of the resense and the expansion board.
What is the conversion formula for voltage values using HPADC?
Please provide a conversion expression for each input gain (-6,0,6,12,14).
HP published characteristic graph: Please use this translation formula.

spresense

2022-09-30 20:12

1 Answers

An ADC value is obtained as a value of 16 bits (signed short) with a sign (assuming it is val).
A Vref voltage is 5.0 V, and the resistance voltage is divided at 27 K と and 10 K で, and 1.4 V is inputted.
How to use the https://developer.sony.com/develop/spresense/docs/hw_docs_ja.html#_ad converter
The relationship between decibel and gain is expressed as follows.
y[dB] = 20*log10(N)[fold]
-6dB->1/2x, 0dB->1x, 6dB->2x, 12dB->4x, 14dB->6x

I think the conversion formula to the voltage obtained for voltage Vpp is as follows:

V=(Vpp/10^(dB/20)*(val+32768)/65536+(1.4-Vpp/10^(dB/20)/2)*(27+10)/10

Ideally, the Vpp=0.7V, -6dB setting would be 0 to 5V (=Vref) from -32768 to 32767, but
There is a deviation due to resistance error, wiring resistance, accuracy of input voltage, etc.
The deviation seems to be the ADC originally intended for capacitive coupling, so I think that's possible.
To ad-convert signals that are smaller than https://developer.sony.com/develop/spresense/docs/hw_docs_ja.html#_

For your information, if you look at how they are doing in the Arduino environment,
It seems that the map() function is mapped linearly based on the upper and lower limits.
https://github.com/sonydevworld/spresense-arduino-compatible/blob/master/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/cores/spresense/wiring_analog.c#L607

There may be variations among individuals, so I think it's reasonable to calculate by mapping from actual measurements.


2022-09-30 20:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.