DS 1620 Code example?


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Location
    MI
    Posts
    33

    Default DS 1620 Code example?

    Hello
    After doing a quick search here and on Google, I was able to find 1 minor
    example code for PBP. In a project using another company's complier
    my code has run out of memory. This forces my project into a situation
    where a newer 18 pin PIC like the 16F88 is required. And that is the main
    problem. As this pic is not supported by them.

    Will someone help point me into the right direction as where to find code
    for the DS 1620 for PBP.

    Thanks gang
    Gordon

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi Gordon,

    Thanks to Bruce.
    Here you can find an example in which you can see the code for DS1620.

    http://www.rentron.com/PicBasic/SERLED.htm



    -----------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    May 2006
    Location
    MI
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    AHH-HA
    Yes thats what I had in mind.
    Thank you Sazyer.

  4. #4
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    ' PicBasic Pro program to read DS1620 3-wire temperature sensor
    ' and display temperature on LCD

    ' Define LOADER_USED to allow use of the boot loader.
    ' This will not affect normal program operation.
    Define LOADER_USED 1

    Include "MODEDEFS.BAS"

    ' Define LCD pins
    Define LCD_DREG PORTD
    Define LCD_DBIT 4
    Define LCD_RSREG PORTE
    Define LCD_RSBIT 0
    Define LCD_EREG PORTE
    Define LCD_EBIT 1

    ' Alias pins
    RST var PORTC.0 ' Reset pin
    DQ var PORTC.1 ' Data pin
    CLK var PORTC.3 ' Clock pin

    ' Allocate variables
    temp var word ' Storage for temperature


    Low RST ' Reset the device

    ADCON1 = 7 ' Set PORTA and PORTE to digital

    Low PORTE.2 ' LCD R/W line low (W)
    Pause 100 ' Wait for LCD to start

    Lcdout $fe, 1, "Temp in degrees C" ' Display sign-on message


    ' Mainloop to read the temperature and display on LCD
    mainloop:
    RST = 1 ' Enable device
    Shiftout DQ, CLK, LSBFIRST, [$ee] ' Start conversion
    RST = 0

    Pause 1000 ' Wait 1 second for conversion to complete

    RST = 1
    Shiftout DQ, CLK, LSBFIRST, [$aa] ' Send read command
    Shiftin DQ, CLK, LSBPRE, [temp\9] ' Read 9 bit temperature
    RST = 0

    ' Display the decimal temperature
    Lcdout $fe, 1, dec (temp >> 1), ".", dec (temp.0 * 5), " degrees C"

    Goto mainloop ' Do it forever

    End


    or read http://www.melabs.com/resources/samp...pbp/temp3x.bas

  5. #5
    Join Date
    May 2006
    Location
    MI
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Thanks precision
    This code looks very clean and striaght forward.
    This should be easy to apply to my project.

    Gordon

  6. #6
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Gordon,

    I see from your other post regarding ISP Pro that you purchased PICBasic. Did you get the PICBasic Compiler or did you get the PIC Basic Pro version. There are distinct differences between the 2 programs.

    Just trying to save you the time of using the above program with PIC Basic.

    BobK

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink Simple ... make it simple

    Why not try here:

    http://www.rentron.com/PicBasic/one-wire3.htm

    simply ...

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  8. #8
    Join Date
    May 2006
    Location
    MI
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Thanks for the link ace. I purchased the pro after reading Chuck Hellebuyck's
    book "Programming Pic Microcontrollers with PicBasic". Just seemed like PBP
    was the way to go when using LCDs and a few other features.

    Gordon

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 : 1

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