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

Config settings are overwritten when clearStrongPullup() happens #5

Open
lukashove opened this issue Feb 8, 2019 · 1 comment
Open

Comments

@lukashove
Copy link

clearStrongPullup() is supposed to keep the current config settings and just make sure that the SPU bit is cleared. However, the bitclear is not correct and erases bits that it should not.

This usually results in all config settings getting cleared, and since this function executes within the 1-wire reset function, it becomes impossible to communicate with chips that require overdrive speed.

Currently the function writes the new config as:

void OneWire::clearStrongPullup()
{
writeConfig(readConfig() & !DS2482_CONFIG_SPU);
}

Function should instead be as follows:

void OneWire::clearStrongPullup()
{
writeConfig(readConfig() &~(1 << 2));
}

@samkristoff
Copy link

I ran into this as well and @lukashove's description and proposed solution are correct.

If you're using Active Pullup this will also cause it to be disabled and reset to the internal passive pullup on most bus operations.

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

2 participants