Hello,
The formula for calculating VTRIM in "datasheet, TRM, sample program" is not consistent, and I would like to clarify the calculation formula.
・The following formula (4) is written in TRM p103
VTRIM = (1.4 V / 4096) ∗ (1857 – 0.5) = 0.6345 V (4)
・Sample program "adc12_internal_temp_sensor_mathacl" latest SDK 1.30.00.03
/*
* Convert TEMP_SENSE0 result to equivalent voltage:
* Vtrim = (3.3*(TEMP_SENSE0 -0.5))/(2^12)
*/
qVTrim = _IQ15div(_IQ15mpy((_IQ15(DL_SYSCTL_getTempCalibrationConstant()) -
_IQ15(0.5)), _IQ15(3.45)), ((uint32_t)(1) << 27));
Different from the TRM formula.
There is an answer on the forum that _IQ15 (3.45) should be changed to _IQ15 (3.3). 3.3 seems to be the value of VDDA.
(Link)
・datasheet_mspm0g3507_revB:Factory trim temperature
ADC and VREF configuration: RES=0 (12-bit mode), VRSEL=0h (VDDA=3.3V), ADC tSample=12.5µs
It is stated that VDDA = 3.3V.