Temperature Logging using internal ADC/TempSensor

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

Temperature Logging using internal ADC/TempSensor

Jump to solution
1,373 Views
saipriyasubrama
Contributor II

I am using a S9KEAZ16 controller and would like to use one of the ADC channels as a temp sensor to monitor the CPU temp. The ADC is hardware triggered using a FlexTimer module. I am able to read the measured temperature values on FreeMaster although, I am not able to log it in a data logger.

I am using the EEPROM driver from the blog Driver for Microchip 24xx Serial EEPROM | MCU on Eclipse  and I would like to log the temp sensor reading as and when I receive them. Is it advisable to write the temp sensor values inside the ADC ISR itself? I am worried about the ADC ISR consuming more time to execute and as a result of which a few triggers missed or vice versa incorrect data written on the EEPROM because of lag.

Also is there a way to write float values on my EEPROM?

I tried writing the temp sensor value inside the ADC ISR and the loop gets hung up in the writeblock routine.

do
{
}while(!GI2C1_deviceData.dataTransmittedFlg);

Is there a way to debug this issue??

0 Kudos
Reply
1 Solution
1,063 Views
egoodii
Senior Contributor III

For use of the internal temp sense, you should examine my considerations in:

On-chip temperature Calculations 

If you've enabled a full-printf library version, then sprintf is a way to get the system to format an internal float value into a string for you

View solution in original post

0 Kudos
Reply
2 Replies
1,064 Views
egoodii
Senior Contributor III

For use of the internal temp sense, you should examine my considerations in:

On-chip temperature Calculations 

If you've enabled a full-printf library version, then sprintf is a way to get the system to format an internal float value into a string for you

0 Kudos
Reply
1,063 Views
saipriyasubrama
Contributor II

Thank you. Earl. I figured it out and used Term! component to display my temperature.

0 Kudos
Reply