LPC11E6x Temperature Sensor Characteristics

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

LPC11E6x Temperature Sensor Characteristics

1,571 Views
jamesl-dm
Contributor I

The datasheet for the LPC11E6x says on pages 70 and 71 that the temperature sensor's analog response is approximately Vadc (mv) = -2.36 * T (Celsius) + 606. The only further qualification given to this formula is that the ADC must be set up in single channel burst mode, and the first 8 samples should be discarded.

However, I have found that the measured value varies significantly with ADC sampling frequency. Averaging over 350 samples, in single channel burst mode, with the first 50 samples discarded, in an ambient 23C:

  • At 500 kHz / 25 = 20 kSps, I measure 32.16 +- 0.28 C
  • At 16 MHz / 25 = 640 kSps, I measure 35.44 +- 0.26 C
  • At 24 MHz / 25 = 960 kSps, I measure 39.13 +- 0.28 C
  • At 48 MHz / 25 = 1.92 MSps, I measure 27.01 +- 0.248

This is presumably due to the variation of the ADC input impedance as the sampling frequency changes - although I can't explain why the trend goes up in temperature (down in voltage) until 24 MHz, then changes to down in temperature at 48 MHz. All readings are higher than expected, particularly at lower sampling rates.

I have two questions:

  1. Which peripheral clock and sampling frequency is the datasheet's curve for? (Figure 37, Table 24)
  2. Is the sensor still linear and repeatable if a different sampling frequency is used?
Labels (2)
0 Kudos
Reply
7 Replies

1,282 Views
jamesl-dm
Contributor I

Hi Jeremy,

>It's suited for a full range of sampling frequency.

If this is the case, why does the output change by a full 12 degrees when the peripheral clock is changed from 24 to 48 MHz? That's definitely not within the +-5 degree accuracy specification. Surely the given curve and coefficients are only applicable to a single sampling rate?

I've complied with all of the settling time requirements, and the output of the sensor is consistent. It just changes drastically when the sampling rate changes.

James

0 Kudos
Reply

1,282 Views
jeremyzhou
NXP Employee
NXP Employee

Hi jamesl-dm,

I'd like to share the testing resut.

Chip: LPC11E68, IDE: MCUXpresso, Environment: air-conditioning room.

The code will continue sample 415 times, and output the last 15 conversation results via serial port.

1. Sample rate: 500 KHz

ADC sequencer demo
Sample value = 0x28a (Data sample 650)
Sample value = 0x28a (Data sample 650)
Sample value = 0x28b (Data sample 651)
Sample value = 0x28a (Data sample 650)
Sample value = 0x28c (Data sample 652)
Sample value = 0x28c (Data sample 652)
Sample value = 0x289 (Data sample 649)
Sample value = 0x28a (Data sample 650)
Sample value = 0x28c (Data sample 652)
Sample value = 0x28a (Data sample 650)
Sample value = 0x28a (Data sample 650)
Sample value = 0x28c (Data sample 652)
Sample value = 0x28c (Data sample 652)
Sample value = 0x28a (Data sample 650)
Sample value = 0x28b (Data sample 651)
2. Sample rate: 16 MHz
ADC sequencer demo
Sample value = 0x285 (Data sample 645)
Sample value = 0x282 (Data sample 642)
Sample value = 0x281 (Data sample 641)
Sample value = 0x280 (Data sample 640)
Sample value = 0x281 (Data sample 641)
Sample value = 0x281 (Data sample 641)
Sample value = 0x282 (Data sample 642)
Sample value = 0x280 (Data sample 640)
Sample value = 0x282 (Data sample 642)
Sample value = 0x280 (Data sample 640)
Sample value = 0x281 (Data sample 641)
Sample value = 0x280 (Data sample 640)
Sample value = 0x280 (Data sample 640)
Sample value = 0x280 (Data sample 640)
Sample value = 0x280 (Data sample 640)
3. Sample rate: 24 MHz
ADC sequencer demo
Sample value = 0x286 (Data sample 646)
Sample value = 0x27a (Data sample 634)
Sample value = 0x278 (Data sample 632)
Sample value = 0x27a (Data sample 634)
Sample value = 0x279 (Data sample 633)
Sample value = 0x279 (Data sample 633)
Sample value = 0x27a (Data sample 634)
Sample value = 0x279 (Data sample 633)
Sample value = 0x27a (Data sample 634)
Sample value = 0x27a (Data sample 634)
Sample value = 0x27b (Data sample 635)
Sample value = 0x279 (Data sample 633)
Sample value = 0x279 (Data sample 633)
Sample value = 0x27a (Data sample 634)
Sample value = 0x279 (Data sample 633)
3. Sample rate: 48 MHz
ADC sequencer demo
Sample value = 0x28e (Data sample 654)
Sample value = 0x28e (Data sample 654)
Sample value = 0x290 (Data sample 656)
Sample value = 0x28f (Data sample 655)
Sample value = 0x290 (Data sample 656)
Sample value = 0x28f (Data sample 655)
Sample value = 0x28e (Data sample 654)
Sample value = 0x28e (Data sample 654)
Sample value = 0x28f (Data sample 655)
Sample value = 0x28f (Data sample 655)
Sample value = 0x28f (Data sample 655)
Sample value = 0x28e (Data sample 654)
Sample value = 0x28f (Data sample 655)
Sample value = 0x28d (Data sample 653)
Sample value = 0x28f (Data sample 655)
According to these results, we can get the temperature via the formula: Vadc (mv) = -2.36 * T (Celsius) + 606.
Sample ratemVTemperature (C)
500 kHz524.534.5
16 MHz515.638.3
24 MHz510.840.3
48 MHz526.933.5
Obviously, it doesn't exceed the +-5 degree accuracy specification, and I've attached the adc.c and please referring to it for details.
Have a great day,

TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,282 Views
jamesl-dm
Contributor I

Hi Jeremy,

Thanks for looking into this. I tried running the code sample you provided on my board, and got output consistent with my first attempts:

iDivider = 0, clk = 48.0 MHz
Sample value = 0xc00229a0 (Data sample 666 = 29.36)
Sample value = 0xc00229c0 (Data sample 668 = 28.68)
Sample value = 0xc00229a0 (Data sample 666 = 29.36)
Sample value = 0xc00229c0 (Data sample 668 = 28.68)
Sample value = 0xc00229c0 (Data sample 668 = 28.68)
Sample value = 0xc00229d0 (Data sample 669 = 28.34)
Sample value = 0xc00229b0 (Data sample 667 = 29.02)
Sample value = 0xc00229c0 (Data sample 668 = 28.68)
Sample value = 0xc00229c0 (Data sample 668 = 28.68)
iDivider = 1, clk = 24.0 MHz
Sample value = 0xc0022830 (Data sample 643 = 37.22)
Sample value = 0xc00227a0 (Data sample 634 = 40.29)
Sample value = 0xc0022780 (Data sample 632 = 40.97)
Sample value = 0xc00227a0 (Data sample 634 = 40.29)
Sample value = 0xc00227a0 (Data sample 634 = 40.29)
Sample value = 0xc00227b0 (Data sample 635 = 39.95)
Sample value = 0xc00227a0 (Data sample 634 = 40.29)
Sample value = 0xc00227b0 (Data sample 635 = 39.95)
Sample value = 0xc0022790 (Data sample 633 = 40.63)
iDivider = 2, clk = 16.0 MHz
Sample value = 0xc00228e0 (Data sample 654 = 33.46)
Sample value = 0xc0022840 (Data sample 644 = 36.88)
Sample value = 0xc0022830 (Data sample 643 = 37.22)
Sample value = 0xc0022840 (Data sample 644 = 36.88)
Sample value = 0xc0022840 (Data sample 644 = 36.88)
Sample value = 0xc0022840 (Data sample 644 = 36.88)
Sample value = 0xc0022850 (Data sample 645 = 36.53)
Sample value = 0xc0022840 (Data sample 644 = 36.88)
Sample value = 0xc0022850 (Data sample 645 = 36.53)
iDivider = 3, clk = 12.0 MHz
Sample value = 0xc00228d0 (Data sample 653 = 33.80)
Sample value = 0xc00228a0 (Data sample 650 = 34.83)
Sample value = 0xc00228b0 (Data sample 651 = 34.49)
Sample value = 0xc0022890 (Data sample 649 = 35.17)
Sample value = 0xc00228b0 (Data sample 651 = 34.49)
Sample value = 0xc00228a0 (Data sample 650 = 34.83)
Sample value = 0xc00228a0 (Data sample 650 = 34.83)
Sample value = 0xc00228a0 (Data sample 650 = 34.83)
Sample value = 0xc0022890 (Data sample 649 = 35.17)
iDivider = 4, clk = 9.6 MHz
Sample value = 0xc00228a0 (Data sample 650 = 34.83)
Sample value = 0xc00228d0 (Data sample 653 = 33.80)
Sample value = 0xc00228c0 (Data sample 652 = 34.14)
Sample value = 0xc00228c0 (Data sample 652 = 34.14)
Sample value = 0xc00228d0 (Data sample 653 = 33.80)
Sample value = 0xc00228e0 (Data sample 654 = 33.46)
Sample value = 0xc00228b0 (Data sample 651 = 34.49)
Sample value = 0xc00228c0 (Data sample 652 = 34.14)
Sample value = 0xc00228d0 (Data sample 653 = 33.80)
iDivider = 5, clk = 8.0 MHz
Sample value = 0xc00228d0 (Data sample 653 = 33.80)
Sample value = 0xc00228e0 (Data sample 654 = 33.46)
Sample value = 0xc00228d0 (Data sample 653 = 33.80)
Sample value = 0xc00228e0 (Data sample 654 = 33.46)
Sample value = 0xc00228d0 (Data sample 653 = 33.80)
Sample value = 0xc00228e0 (Data sample 654 = 33.46)
Sample value = 0xc00228e0 (Data sample 654 = 33.46)
Sample value = 0xc00228e0 (Data sample 654 = 33.46)
Sample value = 0xc00228e0 (Data sample 654 = 33.46)

So where you got a variation of (40.3 - 33.5) = 6.8 degrees when switching from 48 to 24 MHz (which may or may not be within spec?), I'm getting closer to (40.3 - 29.0) = 11.3 degrees on my sample, which is definitely out of spec.

I've tried on 5 samples - here is a summary (48, 24, 16, 12, 9.6, and 8 MHz):

Sample 1: 28.68, 40.63, 36.53, 35.17, 33.80, 33.46 -> Maximium deviation = 40.63 - 28.68 = 11.95
Sample 2: 34.49, 40.29, 37.56, 36.19, 36.53, 35.85 -> Maximium deviation = 40.29 - 34.49 = 5.80
Sample 3: 34.49, 39.61, 36.88, 35.85, 35.51, 35.17 -> Maximium deviation = 39.61 - 34.49 = 5.12
Sample 4: 35.85, 45.75, 42.00, 39.95, 39.27, 39.27 -> Maximium deviation = 45.75 - 35.85 = 9.9
Sample 5: 32.78, 40.63, 36.53, 34.49, 34.49, 35.17 -> Maximium deviation = 40.63 - 32.78 = 7.85

I guess it's possible that the first sample was damaged in some way...

I still don't expect to see this level of variation between sampling rates. The accuracy spec of +- 5 degrees has to function across process variations, so it seems strange for there to be variations up to the very limits of the spec when you change sampling rate. It doesn't leave any margin for process variation.

For instance, with sample 4, the only way it can stay within spec is if the actual temperature was 40.85 degrees, allowing one reading to give 40.85 - 5, and the other to give 40.85 + 5. I can't measure the actual die temperature for comparison, but 40 degrees (15 above ambient) seems suspiciously high.

At any rate, we have decided to calibrate our devices at production, and use a low sampling rate, as these seem to be the most consistent. If you've nothing further to add, I'm happy to leave the investigation at that.

Thanks,
James

0 Kudos
Reply

1,282 Views
jeremyzhou
NXP Employee
NXP Employee

Hi jamesl-dm
Thanks for your reply.
I was wondering if you can upload a compile-able demo, then I can replicate this phenomenon.

Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,282 Views
jamesl-dm
Contributor I

Hi Jeremy,

Test code is attached. You will need a printf function to see the output.

James

0 Kudos
Reply

1,282 Views
jeremyzhou
NXP Employee
NXP Employee

Hi jamesl-dm,

Thanks for your reply.

I'm working on it now.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,282 Views
jeremyzhou
NXP Employee
NXP Employee

Hi jamesl-dm ,

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.
1) Which peripheral clock and the sampling frequency is the datasheet's curve for? (Figure 37, Table 24)
    It's suited for a full range of sampling frequency.
2) Is the sensor still linear and repeatable if a different sampling frequency is used?
    Yes, it's.
For an accurate measurement of the temperature sensor by the ADC, the ADC must be
configured in single-channel burst mode. The last value of a nine-conversion (or more)
burst provides an accurate result.
After the Temperature Sensor is powered, it requires some time to stabilize and output a
voltage that correctly represents the device temperature. A much shorter settling time
applies after switching the A/D converter to use the sensor output. Software can deal with
both of these factors by repeatedly converting and reading the Temperature Sensor output
via the A/D converter until a consistent result is obtained.

Have a great day,

TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply