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

  • Hi! Im facing a similar issue, I have tried with my RST pin on the 3v3 pin, but also on a "regular" RPi5 pin, i used GPIO23.

    Im using the ADIS16470/PCBZ, directly plugged into my Raspberry pi 5.

    I want to use the SPI so my config file is:

    dtoverlay=spi1-1cs,cs0_spidev=off
    dtoverlay=adis16470-spi1

    This results in me not being able to find the ls /dev/iio* directory anymore...(I tried using spidev but not anymore)

    Im very bad at this and im not sure if im doing this correctly.

    When I used the GPIO23, I could read with iio, and I always got "0". 

    Is it possible to get it to run this way? 

  • Hello Hetpotatis

    The easiest path to get this running will be to use Kuiper Linux, which is our own linux distribution preconfigured for many ADI devices.  However, we don't support the RPi5 yet (and I don't have a schedule for that).  If you can use rpi4 and Kuiper Linux, it may be easier to support.

    If you must use rpi5, then you will need to build the kernel yourself, being sure to use 'make menuconfig' to configure the kernel with support for the ADIS device.  Note that the driver you need is ADIS16475.c, which is compatible with ADIS16470.  You will also need a device tree binary file for the ADIS device.  An example device tree source file can be found here.  Note that the example targets spi0, so if you want to use spi1, you will need to change it accordingly.  It may need other adjustments as well for the rpi5.  The compiled dtb file needs to be placed in the /boot/overlays folder

    On the GPIO pin, please read the note in the example device tree source file.  You will see that gpio25 is required for ADIS16470; I don't think you can use gpio23.

    In the /boot/config.txt file, you will need the following text at the end of the file:

    dtoverlay=adis16475   // assumes the name of the file is adis16475.dtb in /boot/overlays
    dtparam=device=adis16470
    dtparam=drdy_gpio25

    The following documents should be useful to you:

    ADIS1647x/PCBZ BREAKOUT BOARD WIKI GUIDE [Analog Devices Wiki]

    linux/Documentation/iio/adis16475.rst at rpi-6.6.y · analogdevicesinc/linux

    Hope this helps

    Regards

    Andy