• AVR Freaks

Hot!Temperature_Indicator_Module_Demo_using_PIC18FK42

Author
oliverb
Super Member
  • Total Posts : 204
  • Reward points : 0
  • Joined: 2009/02/16 13:12:38
  • Location: 0
  • Status: offline
2019/05/11 02:17:47 (permalink)
0

Temperature_Indicator_Module_Demo_using_PIC18FK42

So I'm trying to run this demo, and I seem to be getting readings 10C above ambient. I can't think of anything that would actually raise the die temp that far so do I have an obvious misconfiguration?
 
I see the max dissipation for the PIC is 800mW, so 80mW could account for 10C. I don't have a current measurement link though.
 
I'm running the PIC from 5V.
 
2745 = 30.705▒C 30.702▒C
2748 = 30.301▒C 30.298▒C
2744 = 30.841▒C 30.837▒C
2744 = 30.841▒C 30.837▒C
2744 = 30.841▒C 30.837▒C
2745 = 30.705▒C 30.702▒C

I'm currently using a MPLAB Xpress pcb adapted to fit an EasyPIC board. That's just a quick fix to get a COM port (update: I've since found out I don't have to do that, move serial onto RB6,7 and I can communicate through xpress). I've used the demo code as-is, although the project is configured for a 26K42 and I actually have a 46K42, I also tried changing the device, no difference.
 
I haven't yet tried working through the exercise yet, I wanted to see the finished version running first.
post edited by oliverb - 2019/06/06 11:27:41
#1

7 Replies Related Threads

    coffee critic
    Super Member
    • Total Posts : 368
    • Reward points : 0
    • Status: offline
    Re: Temperature_Indicator_Module_Demo_using_PIC18FK42 2019/05/15 14:48:32 (permalink)
    4 (1)
    Look a AN2798 and reply back if you have questions.

    n_*$
    #2
    oliverb
    Super Member
    • Total Posts : 204
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: Temperature_Indicator_Module_Demo_using_PIC18FK42 2019/05/19 13:46:51 (permalink)
    0
    I think I'm starting to get it. I'll have to get some notepaper and work through the equations myself but if I understand it correctly the sensor needs two calibration points and the Device Information Area only provides one, so I need to run a calibration process at a known temperature to provide a second data point. I'm assuming the demo has a generic value that needs correcting for the specific PIC.
     
    It's a shame the sensor isn't PTAT otherwise the DIA value alone would be enough.
     
    When it talks about room temperature calibration I'm presuming it literally means running the PIC at a known temp and obtaining a value, not just pulling another data point out of DIA.
     
     
    #3
    coffee critic
    Super Member
    • Total Posts : 368
    • Reward points : 0
    • Status: offline
    Re: Temperature_Indicator_Module_Demo_using_PIC18FK42 2019/05/20 11:33:51 (permalink)
    0
    You should only need two point cal if you need to measure temperatures below room temp.  The variation in the temp is mostly the variation in the accuracy of the DIA calibration not slope variation.     

    n_*$
    #4
    oliverb
    Super Member
    • Total Posts : 204
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: Temperature_Indicator_Module_Demo_using_PIC18FK42 2019/06/05 03:45:21 (permalink)
    0
    Well I rewrote the demo a bit so it would output the temp in C to a bank of LEDs (in BCD), and both PICs I have appear to be within +/-2C or better, but both report 30C+ for a room that is about 20C.
    I've tried dumping the DIA values and doing the calculation myself, still 30C
     
    #5
    coffee critic
    Super Member
    • Total Posts : 368
    • Reward points : 0
    • Status: offline
    Re: Temperature_Indicator_Module_Demo_using_PIC18FK42 2019/06/07 13:53:50 (permalink)
    0
    One additional test step is to add code to discharge the S/H cap in the ADC before setting selecting the temp indicator channel and performing the conversion.  The easiest is to touch any analog channel that is grounded.
     
    Do you have a way to run the board at 90C to compare the ADC reading to the value in the DIA?  I'm trying to determine if the temp is offset or if the slope is different on these parts.  

    n_*$
    #6
    oliverb
    Super Member
    • Total Posts : 204
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: Temperature_Indicator_Module_Demo_using_PIC18FK42 2019/06/25 05:36:35 (permalink)
    0
    Sorry, missed your response. I did wonder about setting up a temperature test, but it seemed a bit tricky to implement. Its one thing to just heat it up, another to get it to a known temp. I could possibly use oil, but I'd quite like to still be able to use the dev board afterwards.
     
    I'm a little concerned that revision A1 PIC18F46K42 has a known A/D issue that causes a transient short to ground at input. I'd expect this to affect the reading, though I don't know what effect it would have on the DIA value.
     
    Giving up for the time being.
     
    Oliver
    #7
    coffee critic
    Super Member
    • Total Posts : 368
    • Reward points : 0
    • Status: offline
    Re: Temperature_Indicator_Module_Demo_using_PIC18FK42 2019/06/25 08:51:17 (permalink)
    0
    The way to test if the errata is causing an issue is to increase TAD to the max limit.  This will allow the S/H cap to recover any charge lost to the glitch.  If the ADC value is the same the glitch was a non issue. 
     
    You might try sticking the board into a zip bag and carefully immerse into boiling water.  you would get a test point close enough to 90C to tell if the error is offset or slope.  No oil this way. 

    n_*$
    #8
    Jump to:
    © 2019 APG vNext Commercial Version 4.5