orgua / OneWireHub

OneWire slave device emulator
GNU General Public License v3.0
343 stars 86 forks source link

OneWireHub Issues - Trouble getting started #50

Open mrjoeshoe opened 6 years ago

mrjoeshoe commented 6 years ago

I have read the documentation and library code and I first have tot thank you for putting this project together! My ultimate goal is to get your DS2433 example working.

The master I am using is the DS9490R USB/1-wire interface from Maxim from their iButton starter kit. I am using Maxim's OneWireViewer to view information on connected slave devices, working without issue for authentic iButton tags and another public, but more limited Arduino sketch. The OneWireViewer does seem to always have one DS2401 virtual slave connected which I didn't think would cause a problem with this library which supports so many 1-wire devices on one bus.

The basics of my issue is when I run any example (even the simple DS2401 example) the master never sees my emulated slave. I have placed print statements throughout the library to determine it is able to see the bus but it never recognizes any data and never responds to ROM search and never send it's serial number. I have enabled serial and GPIO debugging and see the GPIO representing the presence reply has been executed successfully. As you can see below, the show_presence() timing seems to be good.

gpio_presence

I have tried the examples with and Arduino Uno, Arduino Pro Mini, and a Teensy 3.2 (@72Mhz and 96Mhz overclocked) without any luck.

The example code works on an emulated master (serial number is returned). With an emulated master I cannot get a the DS2433 example to respond to a 0xF0 0x00 0x00 coomand to read memory. So I figured it was a bus timing issue with the master and ran the calibrate_by_bus_timing example and received the following output using my Teensy 3.2:

OneWire-Hub calibration by observing the OW-Bus 7 instructions per loop DEBUG TIMINGS for the HUB (measured in loops): (be sure to update VALUE_IPL in src/OneWireHub_config.h first!) value : 83 nanoseconds per loop reset min : 5160 reset max : 11520 reset tout : 60000 presence min : 240 presence low : 1920 pres low max : 5760 msg hi timeout : 180000 slot max : 1620 read1low : 720 read std : 240 write zero : 360

I'm not entirely sure how to implement these values yet but figured posting them here might spark and idea. I have not modified the values in platform.h thus far. Any pointers are greatly appreciated!

valid4kread validreset_presence validromsearch