Skip to content

About

1-Wire bus implementation over GPIO on FT232H

Resources

Stars

11 stars

Watchers

2 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

Repository files navigation

1-Wire bus over GPIO on FT232H

Implementation of 1-wire using the Adafruit FT232H Breakout board.

GPIO seems to function significanlty better on the second MPSSE (ACBUS) on my board. If you have problems using the D4-D7 pins, then try using C0-C7

See Also: Adafruit GPIO fork with 1-Wire Support

Created using hints and examples from Adafruits GPIO library, and Neenars PyDigitemp:

Specification Docs

FTDI - MPSSE

1-Wire

Thermometers

iButton

1-Wire

1-Wire is managed entirley by the master. All communications begin with a reset signal, followed by a command and a sequence of reads/writes. The master transmits a binary 1 by holding the line low for a brief period, and a binary 0 by holding the line low for a much longer period. A read is elicited by briefly pulling the line low, and then looking for a response. The slave lets the line return high to signal a 1, and pulls it low to signal a 0.

1-Wire includes a search function to locate slave devices and recovery their ROM codes. If there is only one device on the bus then the master may send a skip-rom or read-rom command, otherwise all commands except for skip,read,search need to address a device first. All devices except for the one being addressed will go to sleep until the next reset signal.

1-Wire can run at two speeds, standard mode, and overdrive. Timings are included for running in overdrive, and have been tested with a DS1977 iButton module.

Wiring (Example using DS18B20)

You will need to provide a pull-up resistor on the GPIO line which you want to use for 1-Wire. This will provide power in parasite mode power mode. I use a 4k7 pull up to the 5v line on the FT232h. See Image below:

FT232H Wiring FT232H Diagram

Examples

See test files in examples folder for usage.

The w1ftdi class contains lots of debugging information, so you can get a full breakdown of the 1-wire and MPSSE commands used. Set the debug to level 5 to get the most verbose output.

  • examples/test1.py

    • Performs a search of the 1-wire bus and reports the devices found.
  • examples/test2.py

    • Performs a search of the 1-wire bus and then reads the temperature from any DS18B20 devices present.
  • examples/fever-checker.py

    • Uses a modified Adafruit_GPIO library to talk to a DS18B20 over 1-wire, and control some LEDs with standard GPIO, and update an I2C Seven Segment display with the temperature reading. See the wiring diagram:

Fever-Check Diagram

About

1-Wire bus implementation over GPIO on FT232H

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages