简体   繁体   中英

Adc Conversion quantization

double vDeltaRef, vPlusRef = 10, vMinusRef = 0, q, n, nExp = 3;
     vDeltaRef = vPlusRef - vMinusRef;
     n = Math.pow(2, nExp);
     q = vDeltaRef / n;
     System.out.println(q);

the result from the formula is 1.25v this value:

在此处输入图像描述

How can I translate the obtained result

Since you know vPlusRef , vMinusRef and nExp , you can always calculate q (which is 1.25 in this case).

Then, to convert from digital to analog simply multiply the digital value with q . For example the 3-bit value 011 , which is 3 in decimal, will be converted to 3.75 which is the lower bound of the required range 3.75 to 5.00 .

Finally, to convert from analog to digital do:

int digitalValue = (int) Math.floor(analogValue / q);

For example an analog value of 8.19 would return 6 , which is the 3-bit value 110 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM