Other Parts Discussed in Thread: MSP430F6636
Hi All,
I am trying to understand how to calibrate the REF and ADC on the MSP430F6636. I have read through the user's guide (MSP430x5xx/MSP430x6xx Family Rev. J) and several posts on this forum. I feel like I have a pretty good understanding of how to go about calibrating these modules, but there is one thing that I am unsure of that I will blame on my poor C knowledge. On page 52 of the user's manual it gives the following example:
In the following example, the integrated 1.5-V reference voltage is used during a conversion.
• Conversion result: 0x0100 = 256 decimal
• Reference voltage calibration factor (CAL_15VREF_FACTOR) : 0x7BBB
The following steps show how the ADC conversion result can be corrected:
• Multiply the conversion result by 2 (this step simplifies the final division): 0x0100 x 0x0002 = 0x0200
• Multiply the result by CAL_15VREF_FACTOR: 0x200 x 0x7FEE = 0x00F7_7600
• Divide the result by 216: 0x00F7_7600 / 0x0001_0000 = 0x0000_00F7 = 247 decimal
My question is how can the second to last line be performed on a 16 bit MCU? This results in a number larger than 2^16. I would think that that would cause and overflow and give an invalid number. Could anyone explain how to perform a mathematical operation like this where the result is larger than 2^16?
Thanks,