12F508 and Dallas 1820 not working


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: 12F508 and Dallas 1820 not working

    Thanks.

    I do not know what OSCON has to do with this, because test program (led blink) works, so the program is running without any OSCON-setting. The orinal calibration value is there. The only problem is DS1820 sensor handling. The same read loop (Temp_1) works very well with 16F873 and 16F876A running 4 MHz. The only difference is that I use here GPIO.1 as DQ-pin instead of PortC.0 with those 16F series chips. Maybe I have to try to ask rentron.com, what is wrong with my code with 12F508.

  2. #2
    Join Date
    Nov 2008
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: 12F508 and Dallas 1820 not working

    I do not know what OSCON has to do with this, because test program (led blink) works, so the program is running without any OSCON-setting. The orinal calibration value is there. The only problem is DS1820 sensor handling. The same read loop (Temp_1) works very well with 16F873 and 16F876A running 4 MHz. The only difference is that I use here GPIO.1 as DQ-pin instead of PortC.0 with those 16F series chips. Maybe I have to try to ask rentron.com, what is wrong with my code with 12F508.
    I may have been wrong. It looks as though this pic does not have a osccon register. I tried your code on a 12F683 and it did not work either.
    Regards
    CharlieM
    Using PBP3
    MCSPX

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


    Did you find this post helpful? Yes | No

    Default Re: 12F508 and Dallas 1820 not working

    Hi,

    The first thing is to be sure of your sensor ID ...

    The second ... to be sure the bytes are transmitted in the right sequence ( not swapped )

    from this point of view ... why not try to write and read to it skipping this ID. That could point closer to the reason your code doesn't work ...


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

  4. #4
    Join Date
    Feb 2012
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: 12F508 and Dallas 1820 not working

    Thank you again.

    The sensor ID is correct. I have tested the same sensor and the same piece of code with 16F876A using PortC.0, and I can read the sensor without any trouble. Hardware is ok, checked it carefully. Again my opinion is, that something is wrong with my code with GPIO.1. I am not an engineer, and I am not sure how these pins work in 12F508. When using 16F876A or 16F873 no special configuration is needeed. Just define:

    DQ var PortC.0

    and everything works.

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


    Did you find this post helpful? Yes | No

    Default Re: 12F508 and Dallas 1820 not working

    Instead :
    TRISIO =%00000010 '???? maybe wrong?
    try :
    TRISGPIO + %00000010
    since I think don't exist TRISIO (see page 32 of datasheet : just TRISGPIO, TRISC, GPIO ....where GPIO is refferenced as PortB)

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