This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F6459: Regarding Conversion formulas

Part Number: MSP430F6459


Hi,

Can you please help me in conversion formulas

Is there any direct formula to

Convert millivolts to  lbs?

Convert Hz to rpm?

Convert millivolts to °C?

if not, these are my requirements

Input:0-1880mv±5mv

Output:0-1540lbs ±10lbs

One more,

Input:0mv-29.3mv±75µv

Output:0-700°C ±4°C

if Possible can you provide explanation?

Thanks in advance

Satish

  • Hello Satish,

    Let's assume your input range is from 0mV to 1880mV. Now, the MSP430F6459 features a 12-bit ADC. The internal voltage reference for the ADC module can be set to 1.5V, 2.0V, or 2.5V. Since the maximum input is higher than 1.5V, you'd want to select the 2.0V reference voltage to prevent clipping (anything above 1.5V will still equal 0x0FFF).

    Next, you want to relate the 12-bit ADC value to units: 0 lbs to 1540 lbs. Thus, use the conversion formula for the digital output (N_ADC) in Section 28.2.1 in the User's Guide (shown below for your reference).

    digital output = N_ADC
    Vin = input voltage
    V_R- = negative reference voltage level (assumed to be 0V)
    V_R+ = positive reference voltage level (assumed to be 2.0V)
    4095 = 2^12-bits - 1 (total number of different levels represented by 12-bit value)

    For maximum input voltage of 1880mV and with the assumptions above, this means that maximum N_ADC equals 4095 x 0.94 = ~3849. Converting this to a 12-bit hexadecimal value equals 0x0F09 (0000 1111 0000 1001). This gives us our actual N_ADC range from 0x0000 (0 lbs) to 0x0F09 (1540 lbs). Dividing max weight of 1540 lbs by the max digital output of 3849 gives us 0.4 lbs per bit. Now, if you see a digital output of 2496 (0x09C0), this means you're measuring a weight of 2496 x 0.4 lbs equals 998.4 lbs.

    This approach can be applied to all of your other input configurations. I would encourage you to read through the ADC12_A section in the User's Guide.

    Regards,

    James

    MSP Customer Applications

  • Thank you James...

    I understood what you have explained.....

    But my requirement is like as below(few inputs and outputs)

    Input : 785mV   ---------------------> Output : 280 lbs

    Input : 1131mV ---------------------->Output:670lbs

    Input:1880mv ------------------------> Output:1540lbs(ADC formula is satisfying  for this)

    How can i achieve above requirement too ?

    Thanks in advance...

  • Since we don't know your sensors we cannot answer directly, check the sensor data sheet.

    But this appears to be pretty non-linear. I would suggest setting up a table with known values and interpolating.

**Attention** This is a public forum