LPC55 temperature sensor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC55 temperature sensor

903 Views
ianbenton
Senior Contributor I

Could you please clarify the method of obtaining a temperature reading.

According to the manual, the procedure takes 256 readings of the same input (input 26) (average=128 loop=2), then the temperature is calculated from the difference between the average of the first 128 readings and the average of the last 128 readings.

If it samples the same channel 256 times, why will there be any difference between the first 128 readings and the last 128 readings?

 

0 Kudos
3 Replies

891 Views
ianbenton
Senior Contributor I

Firstly, some of the settings are different from the LPC5502 manual (UM11424). Which one is correct?

As CTYPE is set for a differential input, how can the last two readings be different? The results must be the difference in voltage between two inputs, not two readings of two different inputs. Should CTYPE be 0x03 for reading the two inputs separately?

0 Kudos

888 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that the temperature sensor measurement description between UM11424 and UM11126 is similar, the method in UM11126 acquires 4 samples, but only last two sample are used. The method in UM11424 acquires 2 samples, but all the  two sample are used, the formula is similar only coefficients value are different.

I suppose that the differential mode is used to sample temperature sensor voltage.

BR

XiangJun Rong

0 Kudos

895 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Ian,

Regarding the formula A*[alpha*(Vbe8-Vbe1)/(Vbe8 + alpha*(Vbe8-Vbe1))] - B, it is an empirical formula. Based on test, after you sample 4 result, then discard the first two samples, and use the last samples and use above formula can get the best temperature result.

Hope it can help you

BR

XiangJun Rong

section 39.7.6 Temperature sensor copied from UM11126.pdf

39.7.6 Temperature sensor
The ADC has a dedicated input channel for an on-chip temperature sensor. It is mapped
on channel 26.
To calculate the temperature, the ADC must be configured to run a specific sequence of
steps:
1. Channel 26 corresponds to the temperature sensor.
2. Configure a command register to sample the temperature sensor channel.
CMDLT[ADCH] = Temperature Sensor Channel.
3. The command must be programmed with the following parameters: CMDLT[CTYPE]
= 0x2, CMDHT[AVGS] = 0x7, CMDHT[LOOP] = 0x3, CMDHT[LWI] = 0x0,
CMDHT[STS] = 0x7, CMDHT[CMPEN] = 0x0.
4. Configure a trigger control register to associate it with the temperature sensor
command: TCTRLT[TCMD] = CMDT.
5. Trigger a conversion to run the command associated with TCTRLT.
After running the temperature sensor command, four results (TS[1:4]) are written to the
FIFO selected with TCTRLT[FIFO_SEL_A]. A specific combination of the lasts two values
(TS[3] and TS[4]) allows on chip temperature to be calculated through software.
To convert the temperature sensor conversion results to the on-chip temperature value:
1. Discard the TS1 and TS2 results, and read the last two conversion results (TS[3] and
TS[4])].
2. The first data from step 1 (TS[3]) is called vbe1. The second data (TS[4]) is called
vbe8.
3. An equation can be used to convert these results into the final temperature sensor
reading: A*[alpha*(Vbe8-Vbe1)/(Vbe8 + alpha*(Vbe8-Vbe1))] - B.
4. Depending on the device revision, following Alpha., A and B values are needed to
achieve +/- 4 C temperature accuracy. For device revision 0A: Alpha=9.5, A=770 and
B = 289.4. For device revision 1B: Alpha= 8.5, A=804 and B = 280.

 

0 Kudos