Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DS2431 emulation issue (possible timings) #94

Open
giteafan opened this issue Dec 15, 2020 · 0 comments
Open

DS2431 emulation issue (possible timings) #94

giteafan opened this issue Dec 15, 2020 · 0 comments

Comments

@giteafan
Copy link

giteafan commented Dec 15, 2020

I’m having problem with emulating ds2431 eeprom

tried two arduino boards (Mega, Uno)

#include <OneWireHub.h>
#include <DS2431.h>

auto hub = OneWireHub(8);
auto ds2431 = DS2431(DS2431::family_code, 0x0C, 0x38, 0x4F, 0x1E, 0x00, 0x00);

void setup() {
    hub.attach(ds2431);
    constexpr uint8_t mydata[] = {0x43, 0x00, 0x6B, 0x4D, 0x36, 0x5D, 0xE1, 0x06, 0xCD, 0x80, 0x41, 0x8C, 0xF9, 0x21, 0x62, 0x15, 0xBE, 0x10, 0x49, 0x5D, 0x0B, 0x62, 0xB1, 0xD3, 0x63, 0x6C, 0x7A, 0x3C, 0x35, 0xEB, 0x0E, 0x74, 0x49, 0x11, 0xA2, 0xC8, 0x98, 0x31, 0x3F, 0x3F, 0x6E, 0x5E, 0x53, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xC6, 0xD7, 0xD1, 0xE9, 0xCE, 0x36, 0x89, 0x7A, 0x15, 0x8F, 0x5E, 0x47, 0x02, 0xd9, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
   
    ds2431.writeMemory(reinterpret_cast<const uint8_t *>(my data),sizeof(mydata),0x00);


    ds2431.setPageProtection(0x85);

    uint8_t flag = 0x55;
    ds2431.writeMemory(reinterpret_cast<const uint8_t *>(&flag), 1, 0x8F);
}

void loop(){
    hub.poll();
}

master device can’t read data properly (master is a closed device)
getting error in OneWireHub::sendBit - RESET_IN_PROGRESS
as far as I understand, the problem is in the timings
I’ve tried to vary VALUE_IPL from 8 to 15 with no luck

two captures from logic analyzer are attached (one is real DS2431 chip, one is emulated version using OneWireHub)

any help would be greatly appreciated
captures.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant