orgua / OneWireHub

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

Failed communication with master device - works with BUS PIRATE #139

Open jejmule opened 1 week ago

jejmule commented 1 week ago

It's not really a bug... let's me explain

I have a real device : CNAP, medical device. The device use CUFF as consumable, the duration of use is stored in a DS2432 chip. I am working to bypass the memory information to use over-time cuff for formation, tests, and student lesson. CUFF cost approx 1'000$ so we just want to use them for measurement during study.

I have recorded one wire communication with pulse view. I have written a code to emulate the DS2432 using OneWireHub on arduino UNO. When I test my slave with BUS PIRATE, I can mimic the communication I have recorded using real cuff. But it doesn't work when using the "real" master.

I have recorded the communication with pulse view :

Below is "original" communication between CNAP instrument and a CUFF CNAP_ORIGINAL

Below is the "real" master with my emulated device using OneWireHub lib CNAP_EMULATED_SLAVE My guess is that the slave have a high state between two reicv command and address sent from the master is not visible on the bus. Master tried this several and then display an error message

Below is the BUS PIRATE sending request to the emulated device using OneWireHub BUS_PIRATE_EMULATED_SLAVE Here there is a delay between the command and the target address when bus pirate is the master.

I have the feeling, that the issue is coming from timing. The master is sending the target address 80us after sending the command. When BUS PIRATE sent it 844us after the target adress.

Do you have any insight where I can look for to tweak the library behavior to match the master timing?

Thank you, Jérôme