Example (POR settings, no one changed before):
ads111x_set_comp_high_thresh(&ads1115, -32768);ads111x_set_comp_low_thresh(&ads1115, 32767);ads111x_set_comp_queue(&ads1115, ADS111X_COMP_QUEUE_1)
Triggers start conversion, and after about 7.8-7.9ms interrupt line ALLERT/RDY pulled down by ADS1115 as excepted for default rate.
This seems happens in read-modify-write operation in function write_conf_bits:133. 15 bit of ADS1115 config register shows device status when reading, but when writing 1<<15 bit into it's performs start of conversion.
write_conf_bits reads this 15 bit as 1 due to idle, no conversion, and writes it back to config register which triggers start of a conversion.
If we mask 15 bit state when writting to config register, I2C_DEV_CHECK(dev, write_reg(dev, REG_CONFIG, ((old & ~0x8000) & ~(mask << offs)) | (val << offs))); interrupt line will be changed immediately after comparator queue changed to ADS111X_COMP_QUEUE_1.
For continuous conversion this is seems not a problem, writting 15 bit when conversion currently performing have no effect.
Which SDK are you using?
esp-idf
Which version of SDK are you using?
master
Which build target have you used?
[X] esp32
[ ] esp32s2
[ ] esp32s3
[ ] esp32c2
[ ] esp8266
[ ] other
Component causing the issue
ads111x
Anything in the logs that might be useful for us?
No response
Additional information or context
No response
Confirmation
[X] This report is not a question nor a request for drivers.
The issue
Example (POR settings, no one changed before):
ads111x_set_comp_high_thresh(&ads1115, -32768);
ads111x_set_comp_low_thresh(&ads1115, 32767);
ads111x_set_comp_queue(&ads1115, ADS111X_COMP_QUEUE_1)
Triggers start conversion, and after about 7.8-7.9ms interrupt line ALLERT/RDY pulled down by ADS1115 as excepted for default rate.
This seems happens in read-modify-write operation in function write_conf_bits:133. 15 bit of ADS1115 config register shows device status when reading, but when writing 1<<15 bit into it's performs start of conversion.
write_conf_bits reads this 15 bit as 1 due to idle, no conversion, and writes it back to config register which triggers start of a conversion.
If we mask 15 bit state when writting to config register,
I2C_DEV_CHECK(dev, write_reg(dev, REG_CONFIG, ((old & ~0x8000) & ~(mask << offs)) | (val << offs)));
interrupt line will be changed immediately after comparator queue changed to ADS111X_COMP_QUEUE_1.For continuous conversion this is seems not a problem, writting 15 bit when conversion currently performing have no effect.
Which SDK are you using?
esp-idf
Which version of SDK are you using?
master
Which build target have you used?
Component causing the issue
ads111x
Anything in the logs that might be useful for us?
No response
Additional information or context
No response
Confirmation