orgua / OneWireHub

OneWire slave device emulator
GNU General Public License v3.0
348 stars 89 forks source link

DS2431 support #7

Closed j-langlois closed 8 years ago

j-langlois commented 8 years ago

dear friend, thanks for the great work! definitely the best codebase I've seen to simulate 1-wire slaves. I've been playing around with the library for the last few days, and have successfully implemented all the operations for the DS2431 1kb EEPROM, tested on mega 328p using DS9490 and the bus pirate. However, I have found out that for a particular master, the slave will have timing issues, throwing WRITE_TIMESLOT_TIMEOUT errors. I've been playing around adjusting the delays from the manufacturer's datasheet without any success. Any hint would be greatly appreciated. I intend on cleaning my code and submitting a pull request later on.
Thanks Joel

orgua commented 8 years ago

it would help if you could give some more information:

j-langlois commented 8 years ago

thanks for the prompt response I'm at 16Mhz on arduino 1.5 and yes the outputs are off. I might have isolated the issue yesterday. The problem seems to be related to the reset detection surrounding some arbitrary number of read operations the master can execute following the READ MEMORY 0xF0 command. By that, I mean that it could do 0xF0 on some address, read X bytes, reset the bus, 0xF0 on some other address, read Y bytes. My working trials did not include sequential arbitrary read operations separated by reset commands. I will be out for a few days but I will come back to you on this with some code. Cheers

orgua commented 8 years ago

now i am wondering how you could compile this lib. it uses c++-features that are not supported by default in arduino <1.6.x. you have to enable them manually in a config-file. please try updating it. by using 1.6.10 instead of 1.6.8 i got around 10% smaller codesize. this could mean that timing constrains are a bit more relaxed now.

the behaviour you have seen should be fixed in my last commits thou :-( ("hub is more robust to odd master-behaviour (lazy timings and subsequent resets)"). I've seen them too with the ds9490.

j-langlois commented 8 years ago

Thanks for the tip! Indeed I used 1.6.10 and got it to work flawlessly!

orgua commented 8 years ago

nice to hear! hope to see your pullrequest soon :-) An included example would be much appreciated! I would offer my help if you need help with the cleanup. can i close this issue?

j-langlois commented 8 years ago

Sure you can close it! PR will be in in an hour or so Cheers

orgua commented 8 years ago

i leave this open to remind me of testing it. you mentioned another OW-master. have you tested other sensors of this libs? what kind of system is it?

j-langlois commented 8 years ago

The master I was referring to is a PIC18. It is part of an industrial machine using the DS2431 as storage, so many R/W operations involved. Hence I do not have the opportunity to test more slaves with this master, unfortunately.