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

support for ads1015 #2223

Closed
paweljasinski opened this issue Jan 7, 2018 · 4 comments
Closed

support for ads1015 #2223

paweljasinski opened this issue Jan 7, 2018 · 4 comments

Comments

@paweljasinski
Copy link
Contributor

paweljasinski commented Jan 7, 2018

Missing feature

When using ads1015 chip, the existing ads1115 module can be used. However, not everything maps 1:1.

  • The single shot mode, module programs an esp timer with the values which are incorrect. The interval values are longer than necessary (e.g. 10ms is programmed where 1ms would be sufficient)

  • Interpretation of constant values used to program sampling frequency is different (e.g. ads1115.DR_8SPS is equivalent of ads1015.DR_128SPS)

Justification

ads1015 breakout boards are is available from adafruiit and ali

Workarounds

  • ads1115module can be used in continuous mode

  • use ads1115 module as-is with known limitations

@marcelstoer
Copy link
Member

#2188 is similar in that it adds support to a variant of a chip that we already have a module for. Not sure if it helps to look for inspiration there.

@paweljasinski
Copy link
Contributor Author

Thanks for the tip. I am new here, so for me it is not obvious how far is the memory consumption an issue.
We could make the type of the chip a parameter of the initialization. This will increase size of the module. Mostly parameter validation and different timer values.
Alternatively, a chip type could be a build time parameter - the module is compiled either 1015 or 1115.
Another, perhaps exotic requirements, is use of mixed setup. 1015 and 1115 in the same project. But before this, the module should support more than one chip - I don't believe the module in current state supports conveniently more than than one device.

Looking at the chip specs, I see no way to automate the initialization - from i2c side both chips appear identical.
Actually when I think more about it, I could configure "conversion ready mode" and measure how long did it take. Unfortunately, this is only if "conversion pin ready" is wired.

@paweljasinski
Copy link
Contributor Author

I manage to add support for multiple devices as well as different device type ads1015. I also believe it will work unchanged with ads1x13 and ads1x14. The changes can be seen under https://github.com/paweljasinski/nodemcu-firmware/tree/new-ads1115. I would appreciate feedback before updating documentation and doing a PR.

@devsaurus
Copy link
Member

PR merged. Thanks a lot for your contribution Pawel, very much appreciated!

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

3 participants