Post Go back to editing

Unable to detect AD5593R on Raspberry Pi 3 Model B

I am trying to connect an AD5593R DAC to a Raspberry Pi running Kuiper Linux, but am unable to see the connected device via either iio_info or the IIO Oscilloscope.

The setup we're using is identical to the one in https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/eval-ad5593r-pmdz, with the Pi connected to a PMD-RPI-INTZ interposer board. It seems as if the board is being seen by the Pi, but unable to communicate with it, as the device shows up with i2cdetect -y -1. Similar issue to https://ez.analog.com/studentzone/f/q-a/580191/iio_info-does-not-detect-my-device, but using Mark's suggestions (changing GPIO pins 13 and 17 to pull-up), has not solved the issue.

analog@analog:~ $ iio_info
iio_info version: 0.25 (git tag:c36770cc)
Libiio version: 0.25 (git tag: c36770c) backends: local xml ip usb serial
IIO context created with local backend.
Backend version: 0.25 (git tag: c36770c)
Backend description string: Linux analog 5.15.92-v7+ #1 SMP Tue Apr 2 06:14:55 UTC 2024 armv7l
IIO context has 4 attributes:
	hw_carrier: Raspberry Pi 3 Model B Rev 1.2
	dtoverlay: vc4-kms-v3d,rpi-ad5593r,w1-gpio
	local,kernel: 5.15.92-v7+
	uri: local:
IIO context has 2 devices:
	hwmon0: cpu_thermal
		1 channels found:
			temp1:  (input)
			1 channel-specific attributes found:
				attr  0: input value: 56920
		No trigger on this device
	hwmon1: rpi_volt
		1 channels found:
			in0:  (input)
			1 channel-specific attributes found:
				attr  0: lcrit_alarm value: 0
		No trigger on this device

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

analog@analog:~ $ raspi-gpio get
BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=0 func=INPUT
GPIO 1: level=1 fsel=0 func=INPUT
GPIO 2: level=1 fsel=4 alt=0 func=SDA1
GPIO 3: level=1 fsel=4 alt=0 func=SCL1
GPIO 4: level=0 fsel=0 func=INPUT
GPIO 5: level=1 fsel=0 func=INPUT
GPIO 6: level=1 fsel=0 func=INPUT
GPIO 7: level=1 fsel=0 func=INPUT
GPIO 8: level=1 fsel=0 func=INPUT
GPIO 9: level=0 fsel=0 func=INPUT
GPIO 10: level=0 fsel=0 func=INPUT
GPIO 11: level=0 fsel=0 func=INPUT
GPIO 12: level=0 fsel=0 func=INPUT
GPIO 13: level=1 fsel=0 func=INPUT
GPIO 14: level=0 fsel=0 func=INPUT
GPIO 15: level=1 fsel=0 func=INPUT
GPIO 16: level=0 fsel=0 func=INPUT
GPIO 17: level=1 fsel=0 func=INPUT
GPIO 18: level=0 fsel=0 func=INPUT
GPIO 19: level=0 fsel=0 func=INPUT
GPIO 20: level=0 fsel=0 func=INPUT
GPIO 21: level=0 fsel=0 func=INPUT
GPIO 22: level=0 fsel=0 func=INPUT
GPIO 23: level=0 fsel=0 func=INPUT
GPIO 24: level=0 fsel=0 func=INPUT
GPIO 25: level=0 fsel=0 func=INPUT
GPIO 26: level=0 fsel=0 func=INPUT
GPIO 27: level=0 fsel=0 func=INPUT
BANK1 (GPIO 28 to 45):
GPIO 28: level=0 fsel=0 func=INPUT
GPIO 29: level=1 fsel=0 func=INPUT
GPIO 30: level=0 fsel=0 func=INPUT
GPIO 31: level=0 fsel=0 func=INPUT
GPIO 32: level=1 fsel=7 alt=3 func=TXD0
GPIO 33: level=1 fsel=7 alt=3 func=RXD0
GPIO 34: level=0 fsel=7 alt=3 func=SD1_CLK
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0
GPIO 37: level=1 fsel=7 alt=3 func=SD1_DAT1
GPIO 38: level=1 fsel=7 alt=3 func=SD1_DAT2
GPIO 39: level=1 fsel=7 alt=3 func=SD1_DAT3
GPIO 40: level=1 fsel=4 alt=0 func=PWM0
GPIO 41: level=1 fsel=4 alt=0 func=PWM1
GPIO 42: level=0 fsel=4 alt=0 func=GPCLK1
GPIO 43: level=0 fsel=4 alt=0 func=GPCLK2
GPIO 44: level=1 fsel=0 func=INPUT
GPIO 45: level=1 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=1 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3

  • Hi  ,

    Can you confirm that you have both:

    dtoverlay=rpi-ad5593r
    gpio=13,17=pu,ip

    in your config.txt?

    Also what exact Kuiper image are you using, from:L
    https://wiki.analog.com/resources/tools-software/linux-software/adi-kuiper_images/release_notes

    Is it either 2022_r2 or patch 1?

    If all of the above is correct, can your run this from a terminal:

    dmesg | grep ad5593

    and post the results?

    It does seem like the hardware is connected, if the reset is asserted I don't believe the part acknowledges.

    -Mark
  • Can confirm both of the lines are in the config.txt, I'll attach the full config.txt at the bottom here just in case there's anything else missing.

    The Kuiper image used was 2022_r2 Patch 1 (2024-04-04-ADI-Kuiper-full).

    Results of the command:

    analog@analog:/boot $ dmesg | grep ad5593
    [   10.483205] ad5593r: probe of 1-0010 failed with error -121

    Config.txt:

    # For more options and information see
    # http://rpf.io/configtxt
    # Some settings may impact device functionality. See link above for details
    
    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1
    
    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
    #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16
    
    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720
    
    # uncomment if hdmi display is not detected and composite is being output
    hdmi_force_hotplug=1
    
    # uncomment to force a specific HDMI mode (this will force VGA)
    #hdmi_group=1
    #hdmi_mode=1
    
    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
    #hdmi_drive=2
    
    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4
    
    # uncomment for composite PAL
    #sdtv_mode=2
    
    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800
    
    # Uncomment some or all of these to enable the optional hardware interfaces
    dtparam=i2c_arm=on
    #dtparam=i2s=on
    #dtparam=spi=on
    
    # Uncomment this to enable infrared communication.
    #dtoverlay=gpio-ir,gpio_pin=17
    #dtoverlay=gpio-ir-tx,gpio_pin=18
    
    # Additional overlays and parameters are documented /boot/overlays/README
    
    # Enable audio (loads snd_bcm2835)
    dtparam=audio=on
    
    # Automatically load overlays for detected cameras
    camera_auto_detect=1
    
    # Automatically load overlays for detected DSI displays
    display_auto_detect=1
    
    # Enable DRM VC4 V3D driver
    dtoverlay=vc4-kms-v3d
    max_framebuffers=2
    
    # Disable compensation for displays with overscan
    disable_overscan=1
    
    [cm4]
    # Enable host mode on the 2711 built-in XHCI USB controller.
    # This line should be removed if the legacy DWC2 controller is required
    # (e.g. for USB device mode) or if USB support is not required.
    otg_mode=1
    
    [all]
    
    [pi4]
    # Run as fast as firmware / board allows
    arm_boost=1
    
    [all]
    #define AD5593R_A0_STATE 1
    dtoverlay=rpi-ad5593r
    gpio=13,17=pu,ip
    dtoverlay=w1-gpio

  • Hi  ,

    Gotcha. The two differences between your setup and anything I've tried in the past:

    • I haven't tested out patch_1 myself yet
    • I haven't used a Raspberry Pi 3B in quite some time.

    Do you happen to have a Pi 4? I'll see if I can track down a 3B, and dig into whether there are any known issues with it.

    Also, 2022_r2 (no patch) is available at the bottom of:

    https://wiki.analog.com/resources/tools-software/linux-software/adi-kuiper_images/release_notes#support

    if you want to give that a try.

    (Expand the "Previous Kuiper Linux Releases (Click to expand)")

    -Mark

  • Hi  ,

    I just fired up a Raspberry Pi 3B, booted 2022r2 Patch 1, and connected up an AD5593r Pmod and it's working. (iio_info reports the device, channels, attributes properly, and i2c_detect shows UU at address 0x10.)

    A bit of digging turns up this issue with another I2C device:

    https://forums.raspberrypi.com/viewtopic.php?t=352763

    This leads me to believe there may be something subtle with the GPIOs you've set to input/pullup NOT being set to that state before the driver attempts to probe the AD5593r. It is possible that the timing of these operations are marginal, such that your issue does not show up on every setup.

    Can you try un-blobbing JP3 and JP11 on the interposer board? The easiest way is to use solder wick. Alternatively, you could use a 6-pin stacking header similar to https://www.sparkfun.com/products/11417 as an "extender" between the Pmod and interposer board, and cut out the pin associated with the reset line.

    (When I was testing the board, I bent the reset pin on the Pmod - but I would not recommend doing that if it can be avoided.)

    -Mark