The formulas incorrectly initialize the ADC_MEM0 result and cal[30,85] variables as unsigned integers instead of signed, therefore since cal30 is greater than the ADC_MEM0 the subtraction results in an overflow instead of a negative number. To fix the issue, use int32_t in place of uint32_t. ADC_VREFPOS_INTBUF_VREFNEG_VSS should also be used in place of ADC_VREFPOS_AVCC_VREFNEG_VSS, I will submit these bugs to the DriverLib software team so that they can be fixed in later revisions. Edit: The bug has already been discovered internally and will be fixed. Regards, Ryan
↧