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

Software I2C device doesn't recognize change to ConnectionSettings.SlaveAddress for reads/writes #168

Closed
rickmas opened this Issue Jan 30, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@rickmas

rickmas commented Jan 30, 2018

I have an I2C device with a configurable slave address. It starts with a default slave address of 127 and once I put the device into setup mode, via software, it allows it's slave address to be modified and then communicates on that new slave address from that point forward (until power is lost in which case defaults back to 127).

Using Software I2C, I am able to communicate to the device on address 127 . However, when the device has been given it's new slave address, say 1, and I change the existing Software I2C object's slave address, via ConnectionSettings.SlaveAddress, to 1 the device no longer responds on the new address.

When Reading or Writing with the new slave address I just get SlaveAddressNotAcknowledged. I've verified that the I2C device object has the new SlaveAddress.

If I create a new Software I2C object with address of 1, I am able to read and write to the device.

I was expecting that since SlaveAddress is updatable, the I2C Software object would use the new address on subsequent reads and writes. If this is not the expected behavior then I would have expected the SlaveAddress to be a read-only property.

I was hoping that I could get by with one Software I2C object and simply change the SlaveAddress since the documentation on Software I2C states "...software I2C requires more system resources..."

I am able to work around this issue by creating multiple Software I2C objects as needed however it would be nice to know if this is a bug so that when fixed I can refactor my code back to using just one Software I2C device object.

Thanks!

@Arke64 Arke64 added the wont fix label Jan 30, 2018

@Arke64

This comment has been minimized.

Show comment
Hide comment
@Arke64

Arke64 Jan 30, 2018

Member

Changes to the settings having no effect is by design, see the remarks under ConnectionSettings on https://docs.microsoft.com/en-us/uwp/api/windows.devices.i2c.i2cdevice#Properties_

"...software I2C requires more system resources..." refers to reading and writing via software I2C, not a per-instance overhead. Outside of the small memory cost of each instance, multiple instances have no overhead compared to one. So feel free to create multiple.

Member

Arke64 commented Jan 30, 2018

Changes to the settings having no effect is by design, see the remarks under ConnectionSettings on https://docs.microsoft.com/en-us/uwp/api/windows.devices.i2c.i2cdevice#Properties_

"...software I2C requires more system resources..." refers to reading and writing via software I2C, not a per-instance overhead. Outside of the small memory cost of each instance, multiple instances have no overhead compared to one. So feel free to create multiple.

@Arke64 Arke64 closed this Jan 30, 2018

@rickmas

This comment has been minimized.

Show comment
Hide comment
@rickmas

rickmas Jan 30, 2018

Great, thanks!

rickmas commented Jan 30, 2018

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment