LPC54018 temperature sensor

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

LPC54018 temperature sensor

966 Views
kiryat8
Contributor III

I am using the LPCXpresso54018 OM40003 SDK and have used a SDK demo to read analog inputs 1..8 and also the temperature sensor instead of analog input 0. I wanted to read all 9 inputs every 10ms all at the same time using the adcConvSeqConfigStruct.channelMask and calling ADC_GetConvSeqAGlobalConversionResult().

I call ADC_EnableTemperatureSensor(ADC0, true); in the setup.

But I now see in the LPC540xx pdf:

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.

Can I read the temperature along with the other analog inputs?

I am currently getting a reading of 640 when reading the 9 analog inputs.

If not then I will have to check the temperature once every so many readings.

Does anyone have an example for the LPC54018 chip to read the temperature?

I did not see one in the SDK.

Also what is the formula to convert the raw ADC temperature to centigrade?

Thanks

David

Labels (1)
3 Replies

764 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

 

You can find the Temperature Sensor Linear-Least-Square (LLS) fit parameter at the datasheet of the LPC540xx (page 146), in which you can see that having a value of 520.3 ~ 532.7mV at 30C, and the resolution for the ADC will be 3.3/4096 = 0.0008 so if the conversion is, in your case 640, then you'll have a temperature of 640* 0.8 = 512mV roughly  28 ~ 30C.

 

Hope this helps,

Regards, 
Aldo.

764 Views
kiryat8
Contributor III

Your calculations seem logical.

Thanks.

I still need to know if I have to use the single channel burst mode 9 readings instead of a continuous multiple channel reading. It seems a waste of resources to have to perform the burst mode . I can read the 8 normal ADC channeles with SeqA and the temperature with SeqB.

0 Kudos

764 Views
AldoG
NXP TechSupport
NXP TechSupport

Hi,

 

Sorry for the delay,

As for the SeqA and SeqB yes you can chose which one to use freely but this only affects if the sequence can be interrupted by other sequence or not as stated in the RM "The user can select whether a trigger on the B sequence can interrupt an already in-progress A sequence. The B sequence, however, can never be interrupted by an A trigger.", as for the burst mode the designated conversion sequence will be continuously and repetitively cycled through. Any new software or hardware trigger on this sequence will be ignored.

 

Hope this helps!

Regards,

Aldo.

0 Kudos