Temperature with the LM34C


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Dave,

    Are you getting anything from DEBUG, or is it just not showing any change in temp?

    If DEBUG is showing a fixed value even when the temp changes, the sensor may be wired
    wrong.

    If you're using a boot-loader;

    1. It most likely has the USART enabled, so you may need to disable the USART to use the
    USART TX pin with DEBUG.

    2. If your serial connection is through a MAX232 inverter, then you need to use mode 0
    with DEBUG for non-inverted serial.

    3. Most boot-loaders don't allow you to change config settings, so embedding them in your
    code isn't necessary. And the loader might have some config settings different than what
    you expect.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi Bruce, no, I'm getting no DEBUG from the board.

    I'm connected to the serial port through a 1k resistor which is why I have debug mode at 1.

    How do I disable USART? TXSTA=0?

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    RCSTA = 0 should do it. You just need to clear RCSTA.7 (SPEN) to disable the USART.

    With a direct connection, make sure you have a common ground connection between your
    board & the PC serial port.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4


    Did you find this post helpful? Yes | No

    Default

    No change when USART disabled.

    I'm pretty sure that it's a connection. I tried the code straight up except for debug mode at 1 and received 7 lines of temperature in Hyper Terminal, then it stopped.

    Going back to double check everything.

    ~ Dave

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Darrel most likely hit the nail on the head. Sounds like some odd hardware problem, or a
    bad connection.

    Troubleshoot things one-at-a-time, and just setup a simple loop shooting serial data to
    your PC serial port until you get the serial com thing working.

    If it goes-like-splat, then you know there's a bad connection - or maybe even a problem
    with your PC serial port.

    Note: It might even be a problem with the PIC itself if the A/D is foo-bar. The ADCIN library
    function is a blocking type with;

    adcinloop
    btfsc ADCON0, GO_DONE ; Wait for conversion to complete
    goto adcinloop

    If ADCON0, GO_DONE never gets cleared, it's a sit & spin function call...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    Darrel most likely hit the nail on the head. Sounds like some odd hardware problem, or a
    bad connection.

    Troubleshoot things one-at-a-time, and just setup a simple loop shooting serial data to
    your PC serial port until you get the serial com thing working.

    If it goes-like-splat, then you know there's a bad connection - or maybe even a problem
    with your PC serial port.
    I have no idea how to begin setting up a loop like this.

    Quote Originally Posted by Bruce View Post
    Note: It might even be a problem with the PIC itself if the A/D is foo-bar. The ADCIN library
    function is a blocking type with;

    adcinloop
    btfsc ADCON0, GO_DONE ; Wait for conversion to complete
    goto adcinloop

    If ADCON0, GO_DONE never gets cleared, it's a sit & spin function call...;o}
    I have no idea what the above means either.

    ~ Dave

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by StoneColdFuzzy View Post
    I have no idea how to begin setting up a loop like this.Dave
    Just make a short loop sending out some text strings over and over, while you wiggle wires and such.


    Quote Originally Posted by StoneColdFuzzy View Post
    I have no idea what the above means either.

    ~ Dave
    Cause he misspeller foo bar, wich is an ackronym which I misspelled, FUBAR is the proper spelling you guess what the first 2 letters spell, the BAR means Beyond All Repair. It's like it's cousin SNAFU, Situation Normal All . . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Replies: 10
    Last Post: - 17th February 2012, 07:19
  2. DS18S20 reading negative temperature
    By srob in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 28th December 2007, 21:21
  3. Conversion problem
    By eva in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th March 2007, 18:21
  4. Help for decimal conversion
    By eva in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 18:20
  5. Interrupt and Serial communication to PC.
    By obaskirt in forum mel PIC BASIC
    Replies: 2
    Last Post: - 17th June 2005, 20:01

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