Closed lynx985 closed 4 months ago
Thanks for the issue, I will look into it coming week.
quick check shows you're right, good catch.
_9.3.8 Conversion Ready Pin (ADS1114 and ADS1115 Only) The ALERT/RDY pin can also be configured as a conversion ready pin. Set the most-significant bit of the Hi_thresh register to 1 and the most-significant bit of Lothresh register to 0 to enable the pin as a conversion ready pin.
Created a develop branch to fix this. Need to review the code of the library and examples if the register is used incorrectly.
I might messed up something else because the ready pin goes high after a conversion insted of low the datasheet says if comp_pol is 0 it goes low, but it goes high and low if set to 1
I had to reread the datasheet (again) to understand (I hope) the details.
(from datasheet 9.3.8) _When configured as a conversion ready pin, ALERT/RDY continues to require a pullup resistor. The ADS111x provide an approximately 8-μs conversion ready pulse on the ALERT/RDY pin at the end of each conversion in continuous-conversion mode, as shown in Figure 29. In single-shot mode, the ALERT/RDY pin asserts low at the end of a conversion if the COMPPOL bit is set to 0.
According to the image the conversion is ready when the 8 us pulse goes LOW. So the interrupt must watch for a FALLING edge (5V => 0V) to be sure. As it might take some time before fetching data from the ADS, you might gain the 8us by using the RISING edge.
In the single shot mode the ALERT/RDY pin goes LOW if the COMP_POL bit is set to 0, this is also the default value / behavior. According to this description in the table 8 (above) the ALERT/RDY pin should go HIGH if the COMP_POL bit is set to 1.
So this is how I understand the working: (no HW nearby to test)
@lynx985 fixed the readme.md + checked the examples in develop branch No functional code change Will create a PR from develop branch and merge it later this week.
@lynx985 The readme.md file is updated, thanks again for your sharp eyes!
If the COMP_POL problem still exists, please open a separate issue for it. I need a hardware setup to verify the problem so I want to handle it as a separate issue.
thx for your work
hi
i tried to implement the rdy pin on an ads1115 but it only worked half the time and depended on input voltages on the adc. this made me suspicious that it might not work as a ready pin but as a comparator
so i read the datasheet, where it says: "Set the most-significant bit of the Hi_thresh register to 1 ... " I believe this is a 16 bit value because it is a 16 bid ADC, so i think this would be 0x8000 ?
in the readme it says: "If the thresholdHigh is set to 0x0100 and the thresholdLow to 0x0000 the ALERT/RDY pin is triggered when a conversion is ready."
0x0100 did not really work but 0x8000 seems to work so far
I might messed up something else because the ready pin goes high after a conversion insted of low the datasheet says if comp_pol is 0 it goes low, but it goes high and low if set to 1
kind regards
code for setting up the ads1115
(added code tags for readability)