Post Go back to editing

ADIS16485 IIO on Python

Category: Software
Product Number: ADIS16485
Software Version: 0.0.14

All -

With help on the Linux driver forum, I was able to get a device tree configuration working that helps get data from my ADIS16485 mounted on the EVAL-RPIZ board, on the Raspberry Pi 4B.  Good so far.

Was able to use the pyadi-iio module to actually get the six channels of IMU data from the subject IMU.  Was using the adis16495 support from the module, and data comes through.  Good.

Wanted to get the temp0 and timestamp channels, but the '495 module didn't have those, explicitly rejecting the requests for more channels beyond the IIO channel indices 0-5 and/or the named channels 'temp0' and 'timestamp'.  Running the 'iio_info' command shows the two extra channels to be available from the Linux IIO subsystem.  So, copied module adis16495.py -> adis16485.py and added the channels (simple change from the '495 file), placing it in the support folder.  Good, now the channels are allowed.  However, the data coming from those two channels doesn't match the data that the IIO Scope shows (well, at least the temperature channel), not looking anything as expected for those channels.

I note that the indices provided by iio_info are 0-5 (imu), 7 (timestamp), and 10 (temp0).  Do I need to be feeding more to the adis Python module so that it knows which indices it should be seeking?  Seems like it should be able to (or does) get all it needs from the Linux IIO layer to figure this out already.

Other thoughts or recommendations?

For ref, here's the output from 'iio_info':

analog@analog:~/Logger $ iio_info
Library version: 0.24 (git tag: accb7b5)
Compiled with backends: local xml ip usb serial
IIO context created with local backend.
Backend version: 0.24 (git tag: accb7b5)
Backend description string: Linux analog 5.10.63-v7l+ #1 SMP Wed Dec 21 12:09:15 UTC 2022 armv7l
IIO context has 4 attributes:
        hw_carrier: Raspberry Pi 4 Model B Rev 1.2
        dtoverlay: vc4-kms-v3d,adis16485
        local,kernel: 5.10.63-v7l+
        uri: local:
IIO context has 6 devices:
        hwmon0: cpu_thermal
                1 channels found:
                        temp1:  (input)
                        1 channel-specific attributes found:
                                attr  0: input value: 56965
                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
        hwmon2: hidpp_battery_0
                0 channels found:
                No trigger on this device
        iio:device0: adis16485 (buffer capable)
                8 channels found:
                        anglvel_x:  (input, index: 0, format: be:S32/32>>0)
                        5 channel-specific attributes found:
                                attr  0: calibbias value: 0
                                attr  1: calibscale value: 0
                                attr  2: filter_low_pass_3db_frequency value: 0
                                attr  3: raw value: -1111592
                                attr  4: scale value: 0.000000005
                        anglvel_y:  (input, index: 1, format: be:S32/32>>0)
                        5 channel-specific attributes found:
                                attr  0: calibbias value: 0
                                attr  1: calibscale value: 0
                                attr  2: filter_low_pass_3db_frequency value: 0
                                attr  3: raw value: -345410
                                attr  4: scale value: 0.000000005
                        anglvel_z:  (input, index: 2, format: be:S32/32>>0)
                        5 channel-specific attributes found:
                                attr  0: calibbias value: 0
                                attr  1: calibscale value: 0
                                attr  2: filter_low_pass_3db_frequency value: 0
                                attr  3: raw value: 1367883
                                attr  4: scale value: 0.000000005
                        accel_x:  (input, index: 3, format: be:S32/32>>0)
                        5 channel-specific attributes found:
                                attr  0: calibbias value: 0
                                attr  1: calibscale value: 0
                                attr  2: filter_low_pass_3db_frequency value: 0
                                attr  3: raw value: -18474238
                                attr  4: scale value: 0.000000037
                        accel_y:  (input, index: 4, format: be:S32/32>>0)
                        5 channel-specific attributes found:
                                attr  0: calibbias value: 0
                                attr  1: calibscale value: 0
                                attr  2: filter_low_pass_3db_frequency value: 0
                                attr  3: raw value: -13953978
                                attr  4: scale value: 0.000000037
                        accel_z:  (input, index: 5, format: be:S32/32>>0)
                        5 channel-specific attributes found:
                                attr  0: calibbias value: 0
                                attr  1: calibscale value: 0
                                attr  2: filter_low_pass_3db_frequency value: 0
                                attr  3: raw value: 260777763
                                attr  4: scale value: 0.000000037
                        timestamp:  (input, index: 7, format: le:S64/64>>0)
                        temp0:  (input, index: 10, format: be:S16/16>>0)
                        3 channel-specific attributes found:
                                attr  0: offset value: 4425
                                attr  1: raw value: 4162
                                attr  2: scale value: 5.650000
                2 device-specific attributes found:
                                attr  0: current_timestamp_clock value: realtime

                                attr  1: sampling_frequency value: 2460.000000
                1 buffer-specific attributes found:
                                attr  0: data_available value: 26
                Current trigger: trigger0(adis16485-dev0)
        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
        trigger0: adis16485-dev0
                0 channels found:
                No trigger on this device

Thanks,

Andrew

Parents Reply Children
  • Sure, enabled 'temp0' only in my Python program.

    Data coming out does not look like the other imu channels.  Neither is it increasing like timestamp.  However, it also doesn't match the raw values when executing this command:

    cat /sys/bus/iio/devices/iio\:device0/in_temp0_raw

    For grins, I fired up the IIO scope at the same time, and the values displayed by the DMM seem valid and match the values coming from 'cat /sys...', when offset and scaled.

    It's almost like the underlying module isn't pulling those values from the right place.  As mentioned before, the IMU channels do seem to be coming in OK.

    Andrew