CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account
You are here: Home / GizmoBlog / MMBasic Language / Input and Output / 1-Wire Interface

1-Wire Interface

The 1-Wire protocol was developed by Dallas Semiconductor to communicate with chips using a single signalling line.

There are four commands that you can use:

ONEWIRE RESET pin Reset the 1-Wire bus

ONEWIRE WRITE pin, flag, length, data [, data…] Send a number of bytes

ONEWIRE READ pin, flag, length, data [, data…] Get a number of bytes

OWSEARCH pin, srchflag, ser [,ser…]

Where:

pin – The Maximite I/O pin to use. It can be any pin capable of digital I/O.

flag – A combination of the following options:
1 – Send reset before command
2 – Send reset after command
4 – Only send/recv a bit instead of a byte of data
8 – Invoke a strong pullup after the command (the pin will be set high and open drain disabled)

length – Length of data to send or receive

data – Data to send or receive. The number of data items must agree with the length parameter.

srchflag – a combination of the following options:
1 – start a new search
2 – only return devices in alarm state
4 – search for devices in the requested family (first byte of ser)
8 – skip the current device family and return the next device
16 – verify that the device with the serial number in ser is available
If srchflag = 0 (or 2) then the search will return the next device found

ser – serial number (8 bytes) will be returned (srchflag 4 and 16 will also use the values in ser)

After the command is executed, the I/O pin will be set to the not configured state unless flag option 8 is used.

When a reset is requested the automatic variable MM.ONEWIRE will return true if a device was found. This will occur with the OW RESET command and the OW READ and OW WRITE commands if a reset was requested (flag = 1 or 2).

Information from Geoff Graham http://geoffg.net  This implementation was written for MMBasic by Gerard Sexton.

 

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008+ CircuitGizmos, L.L.C. All rights reserved

Image already added

Recently Viewed Products

Copyright © 2025 · Generate Pro Theme on Genesis Framework · WordPress · Log in