Help with DS18B20 program


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I just copied the code that Cocacolakid posted, modified a bit, compile the program with version 2.46 of PbP, program run ok. When compile with version 2.50 of PBP, program just stuck/stop at "hello". Both case, I use PM assembler. The chip i am using is pic16f876 @20MHz.

    I don't know if v2.50pbp has problem or with the 1-wire commands (onwin and owout).

    i attached the file below for checking.

    If anyone has time, please confirm/verify/correct me if i did anything wrong.

    Thanks,
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by KVLV View Post
    Hi,
    I just copied the code that Cocacolakid posted, modified a bit, compile the program with version 2.46 of PbP, program run ok. When compile with version 2.50 of PBP, program just stuck/stop at "hello". Both case, I use PM assembler. The chip i am using is pic16f876 @20MHz.

    I don't know if v2.50pbp has problem or with the 1-wire commands (onwin and owout).

    i attached the file below for checking.

    If anyone has time, please confirm/verify/correct me if i did anything wrong.

    Thanks,
    Hi KVLV,
    when you port from one PIC to Another, be aware the configs are likely different, your copied code compiles in MPASM perfectly with the configs commented out as you have them, included they will not compile as the 16f88 chip has different configs I E config1, config2, the 16f876.inc file has the default configs built in which must be commented out with a ; if you wish not to use them, if you do this then you may include your own config like:
    @ __CONFIG _CP_OFF & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _LVP_OFF & _BODEN_ON & _PWRTE_ON & _WDT_ON & _HS_OSC

    and it will compile in VER 2.50
    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.

  3. #3
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Joe,
    maybe I rephrase it.
    The program I have attached compile ok with v2.46 and v2.50, no error. I use pic16f876.
    when compile using version 2.46 of pbp, the program is running ok when downloaded to the chip using bootloader. it displays/transmit the temperature reading to the lcd/terminal ok.

    the problem only when compile using v2.50 of pbp, the program (hex file) downloaded/program to the chip using bootloader, the program cannot run/stop/freeze.

    i commented out the configurations because it is not needed when using bootloader (i think it is ok to do so).

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by KVLV View Post
    Joe,

    i commented out the configurations because it is not needed when using bootloader (i think it is ok to do so).
    Without the config statements your program uses the default config statement located in the .inc file of the same name/number as your chip, in this case 16f876 , and the default is for XT_OSC not HS_OSC, and could account for your program's failure to launch as it is set to run at 20 MHZ, the PIC OSC requires more power to operate at 20 than at 4 and the HS_OSC provides that power.
    JS
    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.

  5. #5
    Join Date
    Oct 2007
    Location
    Vancouver, BC, Canada
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    thanks Joe, lets me try again. and post if any result.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    I can't understand why the program would work when compiled with 2.46 but not with 2.50. I don't believe the config fuses are the problem as I believe they are not used with a bootloader and are simply not implemented at loading time. Unfortunately though I am running 2.45 myself so I won't be of much more help on this issue.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  3. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 14:51
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

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