App note: Using UART to implement a 1-Wire bus master

Posted on Sunday, October 28th, 2012 in app notes by DP

Here’s an app note from Maxim describing how to implement a 1-Wire bus master using the UART peripheral of your preferred microcontroller.

This application note explains how to use a microprocessor’s UART to implement a 1-Wire® bus master. It includes an explanation of the required electrical interface, UART configuration, and timing relationship between UART and 1-Wire signals. The flexibility offered in setting up UART byte timing allows straightforward implementation of 1-Wire time slots as well as the reset and presence detect pulses. With the inclusion of deep transmit and receive FIFOs, several byte values can be transferred on the 1-Wire bus with just a few clock cycles per bit required from the main processor.

This entry was posted on Sunday, October 28th, 2012 at 1:00 pm and is filed under app notes. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

9 Responses to “App note: Using UART to implement a 1-Wire bus master”

  1. Uwe Bonnes says:

    With modern microcontroller architectures the proposed circuit may not me nescessary. E.b. The STM STM32 family can internally connect RX with TX, and TX can be switch to open-drain instead of push-pull, and so a one-wire device can be connected direct to TX. Only the pull-up resistor is need.

    • Zizzle says:

      Good tip on not needing the circuit.

      One advantage of this little circuit however, is that you could add a couple of resistors on the RX line (voltage divider) and then have a 3.3v micro run a 5v 1-wire device.

      • Uwe Bonnes says:

        Well, e.g. STM32 GPIO is 5-Volt tolerant in input mode and that mean you _can_ pull up to 5 Volt without the need of additional drivers.

      • Brendan Simon says:

        Wouldn’t only one resistor be required. e.g. 4.7k between RX and GND, as the pullup 4.7K would form the other half of the voltage divider?

        Another option would be a zener between Vpullup and the 4.7K pullup to drop the voltage to 3.3V, 3V, or whatever is required.

  2. Don’t loose time implementing one-wire at bit-bang level and use one of these:

    for the embedded world:
    DS2465 – I2C controlled 1-wire master – NDA only required for SHA routines
    DS2482-100 – I2C controlled Single-Channel 1-Wire Master
    DS2482-800 – I2C controlled 8-Channel (!!) 1-Wire Master

    and also for the non-embedded world:
    DS9490, DS9490B, DS9490R – USB to 1-Wire/iButton Adapter
    DS9097U, DS9097U-009, DS9097U-E25, DS9097U-S09 Universal 1-Wire COM Port Adapter
    DS2490 – USB to 1-Wire Bridge Chip

  3. well ok, technically this app note is not about bitbanging, but bytebanging; however I think that an uart has far more useful usages than driving a one wire bus!

    just my 2 cents!

  4. Uwe Bonnes says:

    Okay, so you say hand-wiring e.g. DS2465 to a discovery board would save you time then to use the uart? As always: it depends….

  5. Well yes it depends :)

    It depends on the size of your soldering iron :)
    It depends on the availability and use of the uart for something else (debug? – not all chips have 2 uarts)
    It also depends on the ability to create accurate microsecond delays and to implement the 1-wire bus :)

    So yes, it depends indeed ;)


  6. Sjaak says:

    I always thought 1wire was dead…

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • Max: Seems like an unexpectedly violent way to remove the chip indeed. A hot air station should of course do the job just fine, but in...
  • jose: Part removal described here is pure butchery, the cheapest hot air station will do a fast and clean job removing the QFP, heat air to...
  • Cody: Yes please
  • Marko: armature -> amateur
  • Crawford: Dibs,