adafruit / Adafruit_CircuitPython_PCA9685

Adafruit CircuitPython driver for PCA9685 16-channel, 12-bit PWM LED & servo driver chip.
MIT License
125 stars 64 forks source link

Jetson AGX I2C problem #37

Closed razvanphp closed 3 years ago

razvanphp commented 3 years ago

Hello,

We connected the PWM 16 ch board to pin 3 & 5 from Nvidia Jetson Xavier AGX Dev Board and we get Remote I/O error

jetson@agx:~$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from board import SCL, SDA
WARNING: Carrier board is not from a Jetson Developer Kit.
WARNNIG: Jetson.GPIO library has not been verified with this carrier board,
WARNING: and in fact is unlikely to work correctly.
>>> import busio
>>> from adafruit_pca9685 import PCA9685
>>> from adafruit_motor import servo
>>> i2c = busio.I2C(SCL, SDA)
>>> pca = PCA9685(i2c, address = 0x40)
>>> pca.frequency = 50
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jetson/.local/lib/python3.6/site-packages/adafruit_pca9685.py", line 144, in frequency
    self.mode1_reg = old_mode  # Mode 1
  File "/home/jetson/.local/lib/python3.6/site-packages/adafruit_register/i2c_struct.py", line 78, in __set__
    i2c.write(buf)
  File "/home/jetson/.local/lib/python3.6/site-packages/adafruit_bus_device/i2c_device.py", line 84, in write
    self.i2c.writeto(self.device_address, buf, start=start, end=end)
  File "/home/jetson/.local/lib/python3.6/site-packages/busio.py", line 115, in writeto
    return self._i2c.writeto(address, memoryview(buffer)[start:end], stop=stop)
  File "/home/jetson/.local/lib/python3.6/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 49, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/home/jetson/.local/lib/python3.6/site-packages/Adafruit_PureIO/smbus.py", line 308, in write_bytes
    self._device.write(buf)
OSError: [Errno 121] Remote I/O error
>>>

We understand it might be a hardware issue, but the device is detected on i2c-tools:

jetson@agx:~$ sudo i2cdetect -y -r 8
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

I also asked in NVIDIA/jetson-gpio#50 in regards to board SCL & SDA pins, but so far we are stuck with the investigation.

The code works on other jetson nano/nx.

Any idea into how to debug this further?

Thank you! R

ladyada commented 3 years ago

sorry no idea, your best bet is to get a logic analyzer and post to the nvidia jetson forums for tech support!