DS18B20 connected to PIC16F628A


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 connected to PIC16F628A

    I changed the wait to 188 - tested ok
    I was not aware that INPUT pin# was a way to release the pin and I kind of felt unsure as to why I set it low, I guess it was a psychological way of undoing the high.
    Anyways looking in the PBP bible 5.41 it says that using TRISB.5 = 1 is a more efficient way, not sure if it is just because it is faster to write when setting all pins to input at once.
    I figured not using anything might be even more efficient so I just removed the last line altogether and the reading is still good.

    So do you think leaving it out is ok or is there a chance it might create issues?

    Mike

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 connected to PIC16F628A

    Quote Originally Posted by lilimike View Post
    Anyways looking in the PBP bible 5.41 it says that using TRISB.5 = 1 is a more efficient way ...
    It does say that, doesn't it?
    Well, it's not entirely correct.

    It would be more efficient than the first example in the manual INPUT 0, because it has to figure out what pin 0 refers to.
    But there is no difference at all between INPUT PORTB.5 and TRISB.5 = 1. They both generate the exact same code.

    I figured not using anything might be even more efficient so I just removed the last line altogether and the reading is still good.
    So do you think leaving it out is ok or is there a chance it might create issues?
    That should be OK too.
    The following OW commands will control the TRIS bit and leave it in INPUT mode when it's finished.
    DT

  3. #3
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 connected to PIC16F628A

    Excellent!

    Thank you Darrel.

    Mike

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