Post Go back to editing

ADIS16460 IMU's with Raspberry Pi

Category: Software
Product Number: ADIS16460 - EVAL-ADISIMU1

Hello everyone,

I am trying connecting my ADIS16460 (EVAL-ADISIMU1) to a Raspberrypi 4 (using the ). I had been following the instruction on this guide:

  1.  Load my SD Card with ADI Kuiper Linux image to Raspberry pi  (wiki.analog.com/.../release_notes)

 https://wiki.analog.com/resources/tools-software/linux-software/embedded_arm_images?redirect=1

and this video:

Using ADI IMU's with Raspberry Pi and MATLAB - YouTube    (2:05 min)

2. I configure my Raspberry pi with overlay in boot/config.txt  (dtoverlay=adis16460)

However when I verify  that the drivers loaded properly, I obtained an error:

analog@analog:~ $ iio_info
Library version: 0.24 (git tag: cc96e44)
Compiled with backends: local xml ip usb serial
IIO context created with local backend.
Backend version: 0.24 (git tag: cc96e44)
Backend description string: Linux analog 5.10.63-v7l+ #1 SMP Wed Aug 3 14:47:23 UTC 2022 armv7l
IIO context has 4 attributes:
    hw_carrier: Raspberry Pi 4 Model B Rev 1.5
    dtoverlay: adis16475
    local,kernel: 5.10.63-v7l+
    uri: local:
IIO context has 3 devices:
    hwmon0: cpu_thermal
        1 channels found:
            temp1:  (input)
            1 channel-specific attributes found:
                attr  0: input value: 49173
        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
    iio_sysfs_trigger:
        0 channels found:
        2 device-specific attributes found:
                attr  0: add_trigger ERROR: Permission denied (13)
                attr  1: remove_trigger ERROR: Permission denied (13)
        No trigger on this device

Thank you for your help.

Best regards,

Ingrid M.

Parents Reply Children
  • Let me know if you need any help with the overlay. A good place to look is the adis16475 and the adis16480 overlays.

    - Nuno Sá

  • Ok, tahnk you so much. Do you have the adis16460 overlay? (I don't understand very well

    that codes)

  • Sorry for the late reply... Unfortunately, we do not have any overlay for adis16460. However, it should be pretty similar to what we have for the examples I pointed you.

  • Hello,

    I had tried with two codes to see the answer for the IMU, but it continues without working.

    I will show you the response of the IMU connected to the raspberry pi when I use the next two codes! The MISO have a offset level, but I don't receive anything!

    1. case 1

    import sys
    import spidev
    import RPi.GPIO as GPIO
    import time
    import array
    from struct import *
    
    spi=spidev.SpiDev()
    spi.open(0, 0)
    spi.max_speed_hz=400000
    spi.mode=3
    bcmRst=12
    GPIO.setup(bcmRst,GPIO.OUT)
    GPIO.output(bcmRst,GPIO.HIGH)
    
    while True:
        res=spi.wrytebytes([0x56,0x00])
        data=spi.readbytes(2)
        print(data)
        
    finally:
        spi.close()
        GPIO.cleanup()

    • SCLK     CH1   (Yellow)
    • MISO     CH2    (Purple)
    • MOSI     CH3    (Blue)
    • CS         CH4    (Green)

    2. case 2

    import sys
    import spidev
    import RPi.GPIO as GPIO
    import time
    import array
    from struct import *
    
    spi=spidev.SpiDev()
    spi.open(0, 0)
    spi.max_speed_hz=400000
    spi.mode=3
    bcmRst=12
    GPIO.setup(bcmRst,GPIO.OUT)
    GPIO.output(bcmRst,GPIO.HIGH)
    
    while True:
        res=spi.wrytebytes([0x56,0x00])
        res=spi.wrytebytes([0x56,0x00])
        
        
    finally:
        spi.close()
        GPIO.cleanup()

    • SCLK     CH1   (Yellow)
    • MISO     CH2    (Purple)
    • MOSI     CH3    (Blue)
    • CS         CH4    (Green)

    I will be very grateful if you can help me or see something strange on the code! I always obtain the same answer.

    I will be very attentive. Best regards!

  • Hi,

    Using spidev is not the intended way to use devices and never did it myself. So, I'm not sure what's not working in here but I do know that these parts are typically very sensitive with spi timings and for example, the time delay between cs deassert and assert during a transfer. Another thing worth mentioning is the RST pin... Are you sure that's the correct one? And that the pin is active low?

    You might also try to lower the max spi speed to see if it helps.

    - Nuno Sá

  • Hey, I was also looking for how to use the ADIS16460 on the Raspberry Pi.

    I initially started writing a device tree overlay based on the adis16475 and 16480, but then I saw this post which solved my issue:  RE: 64-bit build of Kuiper Linux with IndustrialIO for Raspberry Pi 4B 

    So there is no need for a new overlay, the ADIS16475 overlay was developed to be also compatible with the ADIS16460 and 16465 by using the "drdy_gpio25" param which changes the data ready pin to the Raspberry Pi's GPIO25 pin to match the pinout of the ADIS16460/16465 and of the P7 port of the eval-adisimu1-rpiz adapter. So you only need to add these parameters to the /boot/config.txt file on the raspberry pi:

    dtoverlay=adis16475
    dtparam=device=adis16460
    dtparam=drdy_gpio25

    With this, you don't need to turn on the SPI on the Raspberry nor to use the spidev library, you should use the official pyadi-iio library instead, the ADIS16460 example should work out of the box: https://github.com/analogdevicesinc/pyadi-iio/blob/main/examples/adis16460.py