I am not getting good die temperature measurements.
I have the voltage reference set to vda/2 and as a negative reference. This gives me a 12 bit voltage range from vda of ground. The values being 2048 to -2048.
Can the die temperature measurement be used in such a configuration?
If so, then is the following equation to correct for voltage references that are not 1024 is to multiply the a/d counts by vref/1.024v?
Also what is vref. Is it vda or vda/2.
Note: Vref is 1.2V for PSoC 4S
Using Vref of 1.024V for PSoC 4S devices can result in negative numbers returned for die temperature.
I am using the CY8KIT-043. The VREF I am referring to is the VREF for the ADC_SAR_Seq component. The correction from the data sheet is ADCCountsCorrected = (Refact /1.024) * ADCCounts .
Thanks for your help.
However a 12 bit a/d reading for single ended measurements is more important than reading the die temperature. Also, I need and A/D range of 0-Vdd. That is why I used Vdd/2 as the negative reference on the A/D. It appears that the 1.024 voltage reference cannot do this. I can give up the temperature Die measurement.
The die temperature sensor is very sensitive to reference voltage. So when you are providing VDDA/2 as reference, the all API's are using VDDA value as 5.0(or 3.3, default values). But the actual VDDA value you are giving can be different. You can measure the VDDA voltage using a multimeter and input that value in, Creator->.cydwr->system: VDDA . Also change the main.c code line 180.
ADCCountsCorrected = ((float)result[TEMP_CH])* ((float)ADC_VREF_VALUE_V/1.024);
This should improve the accuracy. But this is not the right method to follow. The better way is to provide a more accurate VDDA voltage. That should solve the problem.