DS1820 - Help I'm rusty !


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Dec 2007
    Posts
    60


    Did you find this post helpful? Yes | No

    Default LCDout

    I have not used OW, but I can comment on the LCD Problem.
    LCDOUT $FE,1 Clears the LCD Panel. So you are clearing the whole screen, every time it goes through the loop.

    Depending on the speed of the loop, this can give issues like flashing display, flickering, or scanning that I have seen.

    The way I do it, is a LCDOUT $fe,1 before the loop to clear the LCD... Then, to display the data...

    Code:
    lcdout $FE,$80," Temp F = ",Sign,DEC TempF,"   "
        ELSE
           TempF = TempF + 3200
           LCDOUT $FE,$80, " Temp F = ",Sign,DEC TempF,"   "
    Be sure to add some spaces onto the end of the displayed temp (" ") so that when it goes from 10 to 9 degrees... you don't end up with 90. It is messier to code this way, but will result in a 100% flicker-free LCD...

    Only use $FE,1 to clear the entire screen when you have to.

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by davewanna View Post
    Be sure to add some spaces onto the end of the displayed temp (" ") so that when it goes from 10 to 9 degrees... you don't end up with 90. It is messier to code this way, but will result in a 100% flicker-free LCD...

    Only use $FE,1 to clear the entire screen when you have to.
    Hey, don't knock it, I'm not a perfectionist, if it gets the desired result then that is all that matters.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Alain, thanks for the code, I'll have a play later and see what I get

  4. #4
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Alain, I had to make some changes to suit the 16F887 (it didn't like the config bits and turning off comparitors for some reason), but I get the following displayed on screen

    -23tC 0.06 -28T

    Followed by a scale on second line with a rocket under the - of -28 (if that makes sence)

    However I still can't get any change by placing my warmed hands on the DS chip.

    Is there any way to test the DS device as it doesn't seem to be doing anythig

  5. #5
    Join Date
    Dec 2007
    Posts
    60


    Did you find this post helpful? Yes | No

    Default sorry!!

    Malc-c..

    Not nocking it at all! I had the LCD in my main project working like this for ages. The way I do it now is harder to code, and to change.. Often after a code change I end up with stray characters stuck on the screen after it changes page. Have to put in " "s all over the place to make sure everything is erased. But I got sick of the missus saying "Why is the display flickering like that?" on my home-made climate control in the car.

    I should rephrase to...
    I only use $FE,1 to clear the entire screen when I have to.

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


    Did you find this post helpful? Yes | No

    Default

    Hi, Malc

    If your sensor gives ONE TIME the correct temp ...

    it is obvious ... you forgot to close the never-ending measuring Loop ... ( Mr de la Pallice )


    ....


    Did you modify the program ??? ( else than just config bits, Osc speed ... etc )


    -23tC 0.06 -28T

    This should tell your DS 1820 is in a freezer ...

    is it the truth ???

    I will do a test ( must solder a dedicated cable ) to see if I can have a delicious ice-cream ...


    the first line indicates : Bottom value of scale, actual temp, Top value of scale
    second line is scale and index showing where you are between Bottm value and Top value ...

    The "rocket" means the heating Output is ON ...

    Alain

    I give you the test results for negative temp ... keep on the line !
    Attached Images Attached Images  
    Last edited by Acetronics2; - 11th June 2008 at 12:52.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  7. #7
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Unhappy

    No, Alain, I'ts not that cold in here

    I've done some searching on the net and tried the examples found at http://astrosurf.com/soubie/fichiers/RS_Test_DS1820.pbp and included the routines http://astrosurf.com/soubie/fichiers...0_Routines.pbp

    The first thing I did was to leave the pin the DS is connected to as default and after loading the HEX the display did indeed state that the sendor was not detected. I then edited the code to point to pin RA5 as that is what I've set the jumper to on the EasyPIC5 board. I also remmed out all the lines not needed as per his comments, and remmed out the stored value and the gosubs for degrees Kelivin etc, so the display would simply show "Temp is" on line 1 and what the temp reads on line 2

    On re-compiling / loading the HEX the display does indeed display a reading, -274.0 C

    I've never worked with 1-wire devices, but assume that it gets interigated, sends a value which is stored in the PIC, which is then worked on with the maths to convert it to a temp reading? - I tried an experiment, I turned off the power and removed the DS sensor, and turned on the board, hoping that the display would tem ne no sensor detected. However it still read -274 C. Could it be that the 10K resistor between DQ and the 5v line is causing the PIC to read incorectly ???

    Oh and just to confirm I have the DS device installed the right way round

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


    Did you find this post helpful? Yes | No

    Talking

    Hi, Malc

    LoL ...

    as it was a Home thermostat, ... I was not in a hurry to deal with neg temps and had left them aside ...

    Corrected now !

    ( was some fun to correctly display - 0.25 °C ... for info ! )

    Alain

    PS the DS is in my Deep freezer : - 20 °C .... pretty good !

    re PS : Porta.0 and PORTA.1 have to be Hi Weak pulled up ...
    Attached Files Attached Files
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. Please help with 1-wire DS1820
    By hatuan291 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th March 2010, 13:51
  2. DS1820 with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd May 2009, 05:07
  3. DS1820 display with 7-seg 4 digits
    By chai98a in forum Code Examples
    Replies: 12
    Last Post: - 10th April 2008, 13:12
  4. PIC lcd ds1820
    By wchpikus in forum mel PIC BASIC
    Replies: 2
    Last Post: - 24th May 2007, 14:46
  5. DS1820 again
    By paxmowa in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th January 2006, 14:49

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