Author Topic: Anyone Try 1-Wire Emulation Yet?  (Read 25251 times)

Josh47

  • Newbie
  • *
  • Posts: 19
Re: Anyone Try 1-Wire Emulation Yet?
« Reply #30 on: May 07, 2013, 02:46:13 pm »
Oh, I suppose I should post a picture of this so that it is a little more clear what I'm talking about (see attached). In this image you will see a first reset, the search command (F0) followed shortly by the Digispark responding with it's address (it is the only device on the line). Ignore the other channels as I am just using those as triggers here.


Then, you will see another reset, another search (F0) and the same Digispark response. However, this time right after the Digispark response you see that "second reset" I mentioned above. This is the "not working" shown here. All master "Resets" are responded by a "Presence" correctly by the Digispark even though you can't really see it at this zoom level which I selected simply to show more than one reset.


Josh47

  • Newbie
  • *
  • Posts: 19
Re: Anyone Try 1-Wire Emulation Yet?
« Reply #31 on: May 07, 2013, 03:41:35 pm »

Sorry, this is a lot of posts, but I just had to try one more thing. I switched to a linux box running OWFS, and tried. It showed that the command is coming too fast, so I tweaked the code from
Code: [Select]
delayMicroseconds(300 - delta);to
Code: [Select]
delayMicroseconds(250 - delta);In the "presence" function, and it worked perfectly without any need for extra delay/etc.
This confirms my whole headache is with the (what I shall now regard as "stupid") OneWire Viewer provided by our friends at Dallas Semi. Now I'm debating whether I spend any more time on Windows at all or just move on to my primary goal of emulating my goal device.

kamots

  • Newbie
  • *
  • Posts: 13
Re: Anyone Try 1-Wire Emulation Yet?
« Reply #32 on: May 07, 2013, 07:06:28 pm »
Well blah, I was really looking forward to troubleshooting this. I've used the Windows OneWireViewer many times before and haven't had issues.

I may still plug at it anyway, at least confirm your findings. :)

JohnDue

  • Newbie
  • *
  • Posts: 1
Re: Anyone Try 1-Wire Emulation Yet?
« Reply #33 on: June 16, 2013, 09:05:39 am »
OK, time for some "working" code. Attached is code that works for me as is, but it is hacked with a huge delay after the "search" completes to make it work. It does work with serial debugging on or off, so it did "fix" the timing, but I don't think this is the correct way to fix the problem and it fails to address it correctly because I can't scope it to see why this is working and what the real problem is. Anyway, if all you need is a simple 1-wire with a unique ID, this may work for you.


I'll probably hang it up for a little while now and let it sit in the back of my mind in hopes that something will hit me and fix it better. Also, I tried to change the emulation address to a different kind of device and it failed again fairly quick, so this code will not yet work for your full emulation needs.


If someone with a scope would like to step in and take this to the next level, I would really appreciate it.


Thanks,
Josh

Hello Guys,

impressiv what you did with the code from there http://robocraft.ru/blog/arduino/302.html
I lend me your code-lines, and juggle my self with it. I spend the most time in the Arduino Forum so there are my editings http://forum.arduino.cc/index.php?topic=65706.msg1279671#msg1279671

I have seen the code makes heavy duty on an Arduino. I have changed the waitForRequest function for Interrupt use and some changes for other functions for different command calls, so if you like have a look.