Use 2.4V reference to measure the temperature for EFM8LB1
08/214/2017 | 06:22 AM
Question
The EFM8LB1_TempSensor_WithCompensation example for EFM8LB1 use the internal 1.65V reference to measure the temperature, could I change the 1.65V internal reference to 2.4V internal pin reference (or other) as ADC reference voltage?
If the answer is yes, what factors I should take into consideration when I change the internal reference voltage for the ADC.
Answer
Basically the answer is yes because the temperature sensor would convert the die temperature to a voltage, any voltage reference for the ADC could be used to measure the voltage converted by the temperature sensor.
In the example (refer to file EFM8LB1_TempSensor_WithCompensation.c) we use below formula to convert ADC code to die temperature: temp_scaled = ((ADC_AVG - tempsensor_0c)*SCALE) / constant;
Where:
constant equals 28.
tempsensor_0c was a one-point calibration value read from flash.
The key point here is that tempsensor_0c (read from flash) and constant 28 was gotten when ADC was configured to use 1.65V voltage reference and 14-bit mode.
In fact the constant 28 was gotten with below idea: For 14 bit ADC, resolution is 2^14= 16384 temperature slope = 2.8mV/degC (Table 4.11 of datasheet) 1.65V full range = 1650mV Then 2^14*2.82/1650=28.001745 This mean when ADC was configured to use 1.65V voltage reference and 14-bit mode, 1 degC temperature change will cause 28 (decimal) ADC code change.
The tempsensor_0c that read from flash was also gotten when ADC was configured to use 1.65V voltage reference and 14-bit mode. This means that under controlled die temperature (0 degC), use 1.65V internal reference and 14-bit mode, we get a ADC output code as tempsensor_0c.
So if you want to change the ADC reference voltage or bit mode, you should either:
1. scale the ADC code (get with new reference voltage and bit mode) to a code that you would get with 1.65V and 14-mode.
2. scale tempsensor_0c and constant 28 in the formula above to suit for the new voltage reference and bit mode.
Both should work fine.
Let me assume you are taking the option 2 and use 2.4V reference voltage (still 14-bit mode), then you could get:
Use 2.4V reference to measure the temperature for EFM8LB1