Please help with code for DS18B20


Closed Thread
Results 1 to 40 of 110

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    Yes, it's right what you say in post #71 !
    Put this in top of code :
    Code:
    @ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON
    define osc 4
    REMOVE Xtal and caps (no need quartz precision) ; or keep it - but then replace "Intosc_osc_noclkout" with "XT_Osc".
    Now you MUST have something on display !
    Last edited by fratello; - 25th September 2011 at 18:38.

  2. #2
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    i've tried it but nothing on the lcd again,

    i think it has to do with the osc commands and there is the problem.

    i put a 4mhz ceramic with two legs, i idid also tried the ceramic 4mhz with 3 legs. Nothing on the screen.

    i'm sad that cannot complete it.

    thanks a lot for your help! am i doing something wrong with the schematic? Do i need anything else?

    The code from the elektor works, but i dont have the ds1820. And it is on the screen xxx.xx

    But i dont understand why it does not work with your code.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    First you need to prove the pic is running. There are no caps shown in above schematic at the xtal, do you have caps on it? Have you made a led blink? Did you try internal osc?

    From the quick skim I did on this thread, it seems I have read several posts claiming the code works. Time to look at your hardware.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    ok i will try later this afternoon to blink an led.

    Do i need capacitors for the ceramic 4 mhz resonator? I have also used a ceramic with 2 legs resonator at 4 mhz.

    In any case i will try to blink an led.

    As i mentioned on my previous posts, i have tried also the code from elektor, and works. (i just dont have the right sensor DS1820 which is very old and i dont get the right results. but i have something in the screen at least.

    With the code from Mr. Fratello, i dont have anything on the screen. That mean that there is something wrong, either with the hardware or software.

    Thank a lot again for your help.

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    The software it's ok !!! Remove the X-tal (leave pins 15 & 16 free), re-compile the code with added from post #73, check the RV1, check the connection to LCD., check the voltage (5 volts).
    Name:  termo.jpg
Views: 4180
Size:  143.3 KB
    Last edited by fratello; - 26th September 2011 at 06:09.

  6. #6
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    ok thanks a lot fratello,

    please give me some time to do it in the afternoon.

    I have done something else with a completed different thermostat.

    please check for my from an other thermostat with an old ds1621, a friend of mine gave it me i can upload the code if you like. (really sorry for my Greeks at the video, i upload it for the AVCLUB.gr there is a sub forum for flashlights)

    The reason i put the video is to see the menu for the thermostat configuration. It is nice to see the configured temp and the real time temp at the same time.

    Please check the video at 2:12 for the configuration menu.
    Last edited by astanapane; - 26th September 2011 at 07:42.

  7. #7
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    there is something on the display now.

    thanks a lot. The problem now is that i dont have the right value for the temp.

    It appears a minus value for both INT and EXT sensor.

    also the values for the SET POINTs are only in minus values. I think the minus symbol appears on both 75 and -25. I will upload pictures later on.

    The values now i have are

    INT: -0.06
    EXT: -0.06

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

Members who have read this thread : 3

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