Using WDT as a Temp Sensor?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Looks like an interesting project. The PBP code should not be difficult to write - remember to disable PBP's automatic watchdog timer clearing function (and then to clear the WDT as needed elsewhere in your code).

    Calibrating the setup without a controlled temperature environment seems like it will be rough.
    Some of the charts in the app note show a pretty bad deviation at around +30°C, not a good sign as far as reliability goes.

    Also - Microchip says:

    The linearity of the WDT is not guaranteed, but has been observed.
    Not very encouraging. How about the TCxx series of temp sensors from Microchip instead?

    Arch
    Last edited by Archilochus; - 17th June 2006 at 17:28.
    "Data sheets? I ain't got no data sheets. I don't need no data sheets. I don't have to read any stinking data sheets!"

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    not worse than a using a NTC !!!
    Last edited by Acetronics2; - 17th June 2006 at 20:21.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Was just thinking about this idea some more - couldn't this be used to calibrate PBP's 'SLEEP' and 'NAP' commands?

    Arch
    "Data sheets? I ain't got no data sheets. I don't need no data sheets. I don't have to read any stinking data sheets!"

  4. #4
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    How do I disable PBP autoclear of the WDT?

  5. #5
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Looks like DEFINE NO_CLRWDT is the command

  6. #6
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Also see Melanie's post on getting the WDT to timeout even without the Define set.
    Code:
    @ goto $
    http://www.picbasic.co.uk/forum/show...ight=no_clrwdt

    I have not read the AN (yet) and am therfore not sure if this is helpful. It sounds like you could do some stuff in your program and then sit in a tight loop and count time outs ...

    Paul Borgmeier
    Salt Lake City, Utah.
    USA

  7. #7
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    I'm still trying to figure out how to get this to work. I think undersand the concept of the Microchip AN, but I am having a little difficulty implementing it.

    This is my understanding, basically you have two timers WDT and TMR0. TMR is based on a temperature compensated crystal (in my case a temperature compensated INTOSC) and WDT is based on a non temperature compensated RC.

    A prescaler in the code is setup so that timer TMR0 rolls over multiple times before the WDT rolls over. By counting the number of times TMR0 rolls over in a WDT period an inference on the temperature can be made.

    The confusion I am having is how to setup the WDT correctly. How do I setup the WDT up so that it rolls over without reseting the pic, and how do I tell that the WDT rollover has occured. Since it may matter I am using a 12F675 for this project. I assume I set the pic fuse to not use the WDT to reset the pic, but I am not sure how to use it in my code.

    I think I am missing one minor piece and I will be able to get this to work.

    Thanks for any help

  8. #8
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by modifyit
    The confusion I am having is how to setup the WDT correctly. How do I setup the WDT up so that it rolls over without reseting the pic, and how do I tell that the WDT rollover has occured. Since it may matter I am using a 12F675 for this project. I assume I set the pic fuse to not use the WDT to reset the pic, but I am not sure how to use it in my code.

    I think I am missing one minor piece and I will be able to get this to work.

    Thanks for any help
    I'm not experienced in assembly, but it looks like the idea in the app note is that you WANT the WDT to cause a PIC reset. Once the PIC is reset by a WDT timeout, you then check to see if the WDT timeout caused the PIC to reset, or if some other condition caused a reset. There are several flags that will tell you whether a PIC has just powered up, or has reset due to various other conditions - one of them being a WDT timeout. See "STATUS" and "PCON" registers in the device data sheet.

    You'll need to set the WDT ON in the config fuse.

    Arch
    Last edited by Archilochus; - 20th June 2006 at 01:54.
    "Data sheets? I ain't got no data sheets. I don't need no data sheets. I don't have to read any stinking data sheets!"

Similar Threads

  1. Need a cheap touch sensor idea.. here it is
    By mister_e in forum Code Examples
    Replies: 20
    Last Post: - 16th April 2016, 22:42
  2. Graphic LCD with PICbasic pro
    By amindzo in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th November 2012, 11:45
  3. RH/Temp Sensor Example Code
    By Bruce in forum Code Examples
    Replies: 7
    Last Post: - 15th June 2006, 15:55
  4. Temp sensor problem
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 14th June 2006, 14:49
  5. 1 wire Temp sensor
    By PortlandJohn in forum General
    Replies: 2
    Last Post: - 25th November 2005, 16:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts