-
Notifications
You must be signed in to change notification settings - Fork 47
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
Migrating ADS1015 from Wire #31
Comments
I suspect some timing issues while reading from the slave during/after ADC. According to the datasheet it is also possible to read from the config register. Thus, could try to write to the config register value x and read it back? And repeat this with a value y? If you get different values back, i.e. x and y then the basic i2c communication is fine and we have to look deeper at the ADC part. |
Thanks, have tried reading back the config register now. With bgzo_i2c, however, value received back after writing does not match the one I've attempted to write.
I am actually receiving back value X, which has been written previously with Wire example. So I assume, brzo_i2c can read data. But it's having issues writing 2-byte config register. |
I had a closer look at the datasheet. Figure 17 shows the expected i2c communication: In other words: i. START However, what you are sending is:
In your code Note that the wire library behaves differently, see the wiki. That's why the wire library code works. So, what you need to do is:
|
Thanks a lot, the following actually works:
|
You are welcome. I've updated the wiki on how to migrate from Wire Library to brzo, I hope it is better explained now. |
Hi,
I'm trying to re-implement TI ADS1015 ADC interface using brzo_i2c library, since Adafruit's implementation using Wire.h is not fast enough to read data at the rate ADS1015 cat produce.
On the same hardware (esp-12F, 4.7k pull-up resistors, ADS1015 test board),
the following code in Wire.h works:
And the following code in brzo_i2c does not:
Wire-based code correctly returns different ADC values, depending on what the signal is.
brzo-i2c based code executes correctly (rc is always 0), but data coming from the device is always the same.
Hardware is OK, clock frequency of 100kHz is low enough (Wire-based example runs good at up to 600kHz).
Changing repeated_start from true to false has no effect.
Is there anything else that can be done to make this setup work?
Thanks.
The text was updated successfully, but these errors were encountered: