-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
drivers/analog/ads1115: Add support for TI ADS1115 #16011
Conversation
[Experimental Bot, please feedback here] Fill In The Commit Message: This PR contains a Commit with an Empty Commit Message. Please fill in the Commit Message with the PR Summary. The provided information is a good start but needs some improvements to fully meet the NuttX PR requirements. Here's a breakdown: Strengths:
Weaknesses:
How to improve the PR description:
By addressing these weaknesses, your PR will be much stronger and easier for the NuttX maintainers to review and merge. Remember, clarity and completeness are crucial for a successful contribution to an open-source project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, please remember to set the PR to "Ready For Review". Thanks :-)
Also: Please squash the commits. Thanks :-) |
Yeah sorry, been a busy week, wanted to squash first before marking it ready. Thank you so much! :) |
This patch adds initial support for the Texas Instruments ADS1115 ADC. Please read the documentation for more details. Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
…exas Instrument ADS1115 driver This commit adds the documentation for the Texas Instruments ADS1115 Driver. Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
Summary
This PR is from inspace.
This PR adds an experimental driver for the Texas Instruments 4 channel 16 bit ADS1115 ADC. The driver uses I2c and a software trigger, and implements the ADC driver interface from NuttX.
The PR also includes proper documentation for the ADS1115.
Impact
The ADS1115 can be used with NuttX!
Testing
Testing was done using the I2C0 bus on a Pico.
Testing included running the
adc
example app, with software triggering enabled, a group sample size of 8 andADC_FIFOSIZE
set to 9 to store all 8 channels of measurement in the FIFO after a software trigger.The ADS1115 was tested with a 3.3V source connected to A0. and another with a GND source connected to A1 and all other pins left floating. The PGA was set to the highest value, 6.144V, as other values are not large enough to capture the full voltage.
In this test, the values were within what was expected from the test setup.
Channel 0 measures the differential between A0 and A1, which is 3.3V and ground. After converting to volts (value * 6.144)/2^15, the result is 3.271125V, which is within the expected range.
Channel 1 measures the differential between A0 and A3, which is expected to be the difference between 3.3V and a floating pin, resulting in a measured value of 2.67675V, which once again is expected.
Channel 2 measures the difference between A1 and A3, which is gnd and a floating pin. The ADS1115 outputs a 16bit value in two's complement, but the
adc
example app does not support this, which is why the result is off. Converting to a voltage, this value is -0.54V, which is expected between gnd and a floating pin.Channel 3 measures the difference between the two floating pins, which is why the value is 0.
Channel 4 through 7 are the single ended inputs, where it compares A0 to A3 to GND. Converting each value results in a voltage of 3.2709375V, -0.000375V, 0.540375V and 0.5386875V respectfully, which are all within the expected ranges.
Continuous and single shot modes were tested, and also work as expected.
The comparator / ALRT/RDY pin were also tested briefly by connecting an LED to the output and seeing it flash on and off. This test succeeded and showed the chip sending the signal, but I lack the equipment to test further beyond this.