ASCII readings: how to onvert the values - Logomatic 2

Hello,

I got readings of around 50 for a voltage of around 170mV. How can I convert these values, is there any formula, its not Hex to Decimal.

Cheers,

Steffen

Steffen,

Is that 50 decimal or 0x50 hex?

Either way, you can determine what your ‘step size’ is per lsb of the ADC by converting to decimal (50=50 or 0x50=80) and dividing your known voltage by this:

170mV/50lsb = 3.4 mv/lsb

or

170mV/80lsb = 2.125 mv/lsb

If you want to do this from the datasheet without guessing you need to look at the schematic, and the data sheet of your processor/ADC and determine

  1. the reference levels supplied to the ADC (probably 3.3v)

  2. the number of bits in your ADC (10-12 in the case of dspics, no idea for arms)

Then, take your reference range of 3.3v-0v=3.3v, and divide it by the number of levels your ADC has (2^n bits -1, → 2^10 -1=1023)

3.3/1023 = 3.23 mV/ code → This matches pretty well with case 1 above.

good luck Steffen.

thanks Cannibal,

its decimal.

Got it, yes, say 171:3.3V = 53:1024.

So that is solved, now it should be fine, the other 2 things are in this forum already, hope I get it to work (1 reading per 60s and time stamp)

Cheers,

Steffen