Can we have multiple 1-wire devices on single pin?


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,079


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    I want to use PIC16F1503 and have to chain thermometers due to pin count. I guess, running above, complex code might not be possible on this wimpy chip?

    The task is as follows:
    There are 3 fans with PWM input and tachometer output, MAX7219 display and array of buttons. Circuit will monitor fan rpm and adjust it according to individual thermometer reading.

    I have 12 IO pins on that chip, I'm thinking about allocating them in the following way:
    3 pins - hardware PWM outputs.
    3 pins - tachometer inputs.
    3 pins - driving MAX7219
    1 pin (MCLR), used as ADCIN, to attach several buttons.
    1 pin - relay driver, for emergency shutdown.

    So I have only 1 pin, for attaching 3 DS18B20....

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    So... Do it....
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    Quote Originally Posted by CuriousOne View Post
    I want to use PIC16F1503 and have to chain thermometers due to pin count. I guess, running above, complex code might not be possible on this wimpy chip?
    You can read address, without searching, if it is only one device present at bus. Just write command $33, and collect next 64bit. Do this 3 time, one for each sensor.
    Connect all DS to bus.
    Write $CC,$44 to start temperature conversion on all DS simultaneously.
    Then use match ROM($55) followed by address, to read data from one DS.
    Look at page 11 in this datasheet https://datasheets.maximintegrated.c...ds/DS18B20.pdf

  4. #4
    Join Date
    Feb 2013
    Posts
    1,079


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    I have an idea, fan tachometer output will be tied to VDD via 4.7k resistor, as DS18B20 should be. Fan outputs pulses not so fast, so what if I attach DS18B20 to same pin as fan tachometer output? and say, after falling edge of tachometer pulse, perform all DS18B20 stuff, while fan pulls pin high again?

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    I believe it takes ~750 Ms. to complete 1 conversion. With that being said, How are you going to discern if the next pulse is the tach output or the DS output?
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Feb 2013
    Posts
    1,079


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    Yes, so I came to different solution. I also have PWM output pin, which goes into fan PWM in. So I'll hook DS18B20 to it - When I need to use thermometer, I will stop HPWM output on that pin, read the thermometer and then resume HPWM operation. I guess, fan will have enough inertia to have no significant impact on it's rpm.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    You do realize 750ms is three quarters of a second? Fan speed will be very wobbly.
    George

  8. #8
    Join Date
    Feb 2013
    Posts
    1,079


    Did you find this post helpful? Yes | No

    Default Re: Can we have multiple 1-wire devices on single pin?

    Fan won't stop in absence of PWM signal. most fans, without PWM signal applied, will default to 30-50% RPM.

Similar Threads

  1. Random outcome on multiple devices
    By Aussie Barry in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 22nd October 2013, 22:36
  2. Multiple I2c Devices
    By alphaengr in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2012, 04:37
  3. Multiple serial devices to one pic
    By rshaver in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th October 2011, 15:34
  4. Need Single wire serial LCD converter example
    By polymer52 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 16th December 2009, 02:30
  5. Multiple RETURNS within a single subroutine
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st June 2009, 16:43

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