Sudden increase in temperature reading with KL16 ADC

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

Sudden increase in temperature reading with KL16 ADC

1,107 Views
balkrishanaa
Contributor II

For KL16 ADC , 6 channels are read one after another in DMA interrupt(ADC channel to be read is configured in DMA interrupt). One of the channel reads system temperature. But I am seeing sudden rise of up to 5 degree C in temperature reading using ADC which is confirmed wrong, this happens when system is run for long time and it happens sporadically. Conversion time for each channel is 16.8us.

sample code:

ADC_init()

{

resolution = 12 bit;

longSampleMode = kADC16_LongSampleCycle24;

continuous conversion = disabled;

Hardware average count = 4;

differential conversion = false;

ADC hardware trigger = true;

//configure and start ADC converison using ADC16_SetChannelConfig();

Enable ADC mux;

Enable DMA = true;

}

DMA_handler()

{

//clear DMA channel status

//read ADC data using DMA_PrepareTransfer();

//save the data for channel

//call DMA_settransfer_config()

//configure and start ADC converison using ADC16_SetChannelConfig();

}

0 Kudos
Reply
3 Replies

1,024 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Balkrishna Amrutrao,

      Do you check the VREF, whether the reference voltage have the pulse after the long time or not? The reference voltage stability will influence the ADC result.

     From my own opinion,  I suggest you open the Hardware Average function, 

pastedImage_10.png

    Take an example, if you choose 32 samples averaged, then even if you have the sudden rise of up to 5 degree, then after divide by 32, it will be just 0.15625 degree, this error should can be acceptable. Actually, just use hardware average function to filter your sudden rise up degree.

   Wish it helps you!

If you still have question about it, please kindly let me know.

Have a great day,
Kerry

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,024 Views
balkrishanaa
Contributor II

Hi Kerry,

Thanks for your reply.

1. As I have mentioned in query, currently we are using hardware averaging of 4 which gives conversion time of 16.8us. Changing hardware averaging to 32 will make conversion time 128us and we need to monitor 6 different channels. So is this solution viable

2. We are monitoring VREF but since issue happens sporadically,could not confirm about this yet. Will update regarding this

0 Kudos
Reply

1,024 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Balkrishna Amrutrao,

   Thanks a lot for your updated information.

   Then you can try it on your side.

    BTW, you also can find another power supply, just test different power supply have the same problem or not.

   Any updated information from your side, please kindly let me know.

   Wish it helps you!

If you still have question about it, please kindly let me know.

Have a great day,
Kerry

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply