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.

MSP430G2553: Qmath conversion

Part Number: MSP430G2553

Hello,

I would like to ask help to convert temperature calibration data to _q5 (11 bit integer part).

I have a long term project needs fast and simple calculation of temperature data. It would be advantageous to have calculate it with the calibration formula. 11 bit integer part fits well to my application where other sensors does not measure higher temperature than 600°C and lower than -40°C; during the calculations 0.03°C precision is far enough.

I highly apriciate your help in advance!

Regards,

Laszlo

  • I assume you mean the calibration as described at 24.2.2.1. If so, then you just need to adjust the values so that the end result is q5. You will need to read  up on fixed point to do that. Wikipedia is a good starting point.

    If you convert the value (85 - 30) into q5 (shift left 5 bits) then the result of that division will also be q5. The rules for handling the binary point are a bit more complicated for division than multiplication and while I have done multiplication, I have never tried division.

    After multiplying by the first term of the equation (unshifted!) the result will still be q5. Now add the final term (30) converted to q5. (30 << 5)