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

    Read first page of THIS topic !!!

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    Every device on 1-Wire network has in its internal EEPROM a unique serial number that has to be known to the host.

    Otherwise the host can not find the device and communicate.

    On Maxim site there is an application note about a way to automatically find the devices on the local 1-wire network. SO every time your controller powers up, it makes an device scan and stores the found ID's or serial numbers.


    The second method is to find the serial numbers by your self and store them in the internl EEPROM of the controller.


    AN187, is the Note that describes the method

    Ioannis

  3. #3
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    Fratello and Ioannis,

    thanks for your help.

    Now i understand. It is very similar to RFID serial number. You can retrieve the serial from the device.

    I will make a small program to retrieve the serial from the device and place it to the code.

    i will come back with my results.

    Best Regards,

  4. #4
    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

    Quote Originally Posted by astanapane View Post
    I will make a small program to retrieve the serial from the device and place it to the code.
    It's in post #22. Enjoy !

  5. #5
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    Hi Fratello,

    here we are step by step.

    i did retrieve the serial number from the DS18B20. I placed it to the code and worked.

    I put two sensors and now i have INT and EXT temp. I can say that they are really close the temp from two sensors.

    Now i would like to ask you if the code is for the temp only or the thermostat.

    I have place two LED on the porta.2 and porta.3, but i dont see any light.

    Do i need to configure anything else?

  6. #6
    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

    Good job ! Keep it so !
    You need to add these lines :
    If V < TargetTemp - Hyst then ' Below Target temperature - Hysteresis
    PORTA.2=1 ' Activate Warm Output
    PORTA.3=0 ' Deactivate Cold Output
    EndIf

    If V > TargetTemp + Hyst then ' Above Target temperature + Hysteresis
    PORTA.2=0 ' Deactivate Warm output
    PORTA.3=1 ' Activate Cold Output
    EndIf
    just in front of
    GoSub SelectSign ' +/blank/- Sign
    GoSub DisplayTemp ' Temperature to LCD


    Goto MainLoop ' Do it forever

  7. #7
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    Hi Fratello,

    your help is much appreciated.

    I will follow your instructions this afternoon. The code is working really well and the temperatures are very close to other circuits i have.

    Thanks a lot!!!

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