adafruit / adafruit/Adafruit_CircuitPython_AD569x
adafruit_ad569x.Adafruit_AD569x fails on BeagleBone
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
I'm using BeagleBone green with your 5811 board. When I run your code.py on [https://learn.adafruit.com/adafruit-ad5693r-16-bit-dac-breakout-board/circuitpython-and-python](https://learn.adafruit.com/adafruit-ad5693r-16-bit-dac-breakout-board/circuitpython-and-python)
I get attached error
[err.txt](https://github.com/user-attachments/files/24356200/err.txt)
I am able to manually access chip
i2ctransfer -y 2 r2@0x4c
0x12 0x33
Think the issue is beaglebone write of zero bytes aren't supported and probe read is wrong size for AD5693R.
i2ctransfer -y 2 w0@0x4c
Error: Sending messages failed: Operation not supported
The AD5693R doesn't support reads of one byte
i2ctransfer -y 2 r1@0x4c
Error: Sending messages failed: Connection timed out
adafruit_ad569x.py
does this
self.i2c_device = I2CDevice(i2c, address)
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/blob/main/adafruit_bus_device/i2c_device.py
Does
self.i2c.writeto(self.device_address, b"")
except OSError:
# some OS's dont like writing an empty bytesting...
# Retry by reading a byte
try:
result = bytearray(1)
self.i2c.readfrom_into(self.device_address, result)
Which is what we see in the error. The write fails with operation not supported and the read fails with timed out since single byte read not supported by AD5693R.
If you do I2CDevice(i2c, address, False) then it works but adafruit_ad569x library doesn't support passing probe False to I2CDevice. I modified it to add probe to __init__. Set it to False and verified it then worked for me.
I'm running Debian Bullseye Minimal Image 2023-09-02
Kernel 5.10.168-ti
Note due to this issue [https://github.com/adafruit/adafruit-beaglebone-io-python/issues/356](https://github.com/adafruit/adafruit-beaglebone-io-python/issues/356)
I needed to install the github version of adafruit-beaglebone-io-python.git
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with adafruit_ad569x.py and the linked adafruit_bus_device/i2c_device.py, then run the linked code.py example on the reported BeagleBone setup while reviewing err.txt. Confirm that the library can configure I2CDevice probing for this device and that the example works without the unsupported zero-byte write or one-byte read.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100