Shop OBEX P1 Docs P2 Docs Learn Events
One-wire Interface — Parallax Forums

One-wire Interface

I designed a system that uses the Propeller and the One-wire network but noticed that the maximum propeller input voltage is Vdd (3.6 vdc). The One-wire must be held at 5.0 vdc to power the parasitic devices.

What is recommended to bridge the logic gap between the propeller and the One-wire devices?

Discovery

Comments

  • I use a Voltage-Level Translator breakout board from Sparkfun when I need to interface the 3.3v logic of the Propeller with 5v logic devices. Or you can purchase and use the individual SMD part in your own PCB design.
    This is a breakout board for the Texas Instruments TXB0104 module. The TXB0104 is a 4-bit bidirectional voltage-level translator with automatic direction sensing.

    This 4-bit noninverting translator uses two separate configurable power-supply rails. The A port is designed to track VCCA. VCCA accepts any supply voltage from 1.2V to 3.6V. The B port is designed to track VCCB. VCCB accepts any supply voltage from 1.65V to 5.5V. This allows for universal low-voltage bidirectional translation between any of the 1.2-V, 1.5-V, 1.8-V, 2.5-V, 3.3-V, and 5-V voltage nodes. VCCA should not exceed VCCB. We have broken out each pin on this module for you to easily access both the A and B ports.

    Sparkfun also provides a hookup guide on how to use their board/product.
  • kwinnkwinn Posts: 8,697
    A pullup resistor to +5V and a transistor to pull the line low along with a current limiting resistor to protect the P1 pin?
  • JonnyMacJonnyMac Posts: 9,102
    edited 2018-12-28 23:54
    Just add a pull-up (3.3K to 4.7K) to the IO pin uses for 1-Wire traffic.
  • Both of you have the right idea.
    Is this connection using the GPIO idea for the One-Wire network? Because the company behind it uses an excellent I2C method, using their DS2482, Sparkfun also sells break-out boards for the same sized part. Problem here is that the part is indeed a SMT type and soldering one of these is sometimes difficult.

    Incidentally Jon I'm still using your translated from PBASIC for the BS2 to the BS1 for running the classic Stamp to Calculator idea to confirm that I'm getting the power connections for the devices to work.
  • I have a 4.7k resistor connected to my SMA one-wire coax connector to pull the line to 5 vdc. You say to add another 4.7k resistor to the Propeller IO pin? When the Propeller output goes low...it can only pull the line to 2.5 vdc.

    What about using a 3.3 volt zener diode limiting the input voltage to the IO and connected to the one-wire through a 100 ohm resistor?

    Discovery

  • If pulling the DQ line takes it to 2.5 then you have a problem. 1W wiring is simple: Ground and data, and the data MUST be pulled up (usually to 5v). I have used a few 1W devices that take 5v directly so that is the third possible line. But you've mentioned parasitic power so DQ and ground are the only requirements.

    The 1W bus is designed to be open-collector/drain so you don't need an inline resistor; the 4.7K pull-up to 5v is sufficient to limit the current on the IO pin.
  • I understand that your configuration is the standard 4.7k resistor pull-up on the one-wire and directly connects to the DQ pin on the Propeller.

    I was concerned about the absolute maximum ratings stated in the Propeller specifications...Vdd max.

    If the input circuits are not damaged by the 5 volts...that is very good to know.

    Thank you.

    Sincerely,

    Discovery
  • Parallax Application Note AN010, Low-cost Bidirectional Mixed-voltage Interfacing deals with interfacing 5V devices to the prop. Go to https://www.parallax.com/downloads and enter AN010 as the Download Title.

    Available application notes: AN001 thru AN015, AN018, and AN019.

    Sandy
  • I was concerned about the absolute maximum ratings stated in the Propeller specifications...Vdd max.
    There are diodes on the pins that limit the voltage into the chip to 3.6 volts. Using anything greater that 3.9K limits the current through those diodes to a safe level.
  • Perfect JohnnyMac,

    I will now remove the zener diode and series resistor from my PCB artwork layout. I follow component maximum ratings in my designs to be sure that these components function in the proper operating region.

    I used BS2s with the 1-wire at a length of 120 feet with no problem. I am replacing the BS2s with the Propeller.

    Sincerely,

    Discovery
  • JonnyMacJonnyMac Posts: 9,102
    edited 2018-12-30 16:58
    For a wire that long you may want to reduce the pull-up to 3.3K. Normally, we like to keep 5V pull-ups at or above 3.9K as this limits the currents through the pin diodes to about 50% of their max current rating. 3.3K will go over this, but is still within specs. The engineers at Dallas Semiconductor made it clear that the longer the 1W line, the stiffer the pull-up required.

    There is no h in my name.
  • With 120ft of wire I would be concerned about catching any spikes which could damage the chip.
  • Sorry about the misspelling Jonny.

    In my new facility, I can cut the length back to about 80 feet so the 3.9k resistor should do the trick...I will find out.

    Sincerely,

    Discovery
  • tonyp12tonyp12 Posts: 1,951
    edited 2019-01-02 20:40
    Using a 3.9K pull-up to 5V comes with two problems:

    Rising edge will be a little slow, as you're probably will use DIR.

    The P1 protection-diode will try to clamp it and re-route the excess voltage to Props Vcc-rail, so 3.3V+0.3Fv = 3.6V clamping on the gpio.
    If it use uses up the excess the voltage, the one-wire will never reach 5V (and other device feeds of this resting voltage?)
    If P1 sleeps a lot and is not using the excess, it could build-up to 4.7V, potentially damage anything on Vcc that is rated 3.6V Max.

    Get a HCT buffer, or at least a n-mosfet for open collector drive with 1K pull-up to 5V (though will not be bi-directional)
  • tonyp12,

    The one-wire port uses OWIN and OWOUT commands. It must be bi-directional.

    Sincerely,

    Discovery
  • tonyp12tonyp12 Posts: 1,951
    edited 2019-01-03 17:46
    use a dual bi-directional buffer, it's also i2c compatible:
    https://www.mouser.com/Search/Refine.aspx?Keyword=P82B96&Ns=Pricing|0&FS=True
    826 x 409 - 52K
  • I see what you have in mind. It significantly alters my system design.

    My PCB layout is completed in accordance with JonnyMac's recommendation using the parasitic capacitors in the one-wire devices for power and the 3.9k pull-up resistor.

    All I need now is to develop the PropBasic code for running the propeller's one-wire and verify that it works on a long-line coax with my Propeller Activity Board as a test module then the PCB artwork will be sent out for commercial fabrication. Writing the PropBasic code for the one-wire devices is proving difficult.

    I will keep the I2C device concept should the need arise. Thank you.

    Discovery
  • They make these long line transmission buffer ic for a reason, using a mcu gpio straight to a 100ft wire is never seen in the commercial world.
    Like 4–20 mA for current loop communication is there for a reason.


  • Understood,
    If I run into problems reading and writing on the PropBasic one-wire during test...I will switch and test the I2C configuration you recommend.

    Discovery
Sign In or Register to comment.