Post Go back to editing

IIO Oscilloscope plot channel display issue with multiple AD4020 devices

Hi there,

I've an FMC board with 4xAD4020 on it, connected to a Zedboard. There seems to be display issue with how the channels of each individual device are shown in the tree. I'd expect one voltage0 channel under each ad4020 node, but they all seem to be grouped under the first ad4020.   This is version 0.99, but I've also seen this the iio scope that ships with the current SD card image.

Also, it looks like if I want to save the data for all 4 channels using the 'Save As' feature, I can only do for a single device at a time, I can't enable the voltage0 checkbox for each of the 4 device in the dialog - only one seems to stay active.  Is there a way to save the data for all 4 devices from the GUI?

Thanks now

Parents
  • Channels will be grouped based on the driver naming. So my guess is that in your device tree you do not have unique names for the individual drivers which have the associated buffered channels. This is why the grouping in IIO-Scope is getting confused.

    Note that IIO-Scope cannot capture from multiple drivers simultaneously in the same capture window.

    -Travis

Reply
  • Channels will be grouped based on the driver naming. So my guess is that in your device tree you do not have unique names for the individual drivers which have the associated buffered channels. This is why the grouping in IIO-Scope is getting confused.

    Note that IIO-Scope cannot capture from multiple drivers simultaneously in the same capture window.

    -Travis

Children
  • Hi Travis,

    When you say IIO-scope can't capture from multiple drivers, does that mean that I need to do this from a python script instead?  It does look like I'm getting 4 separate and different channels of data displayed in IIO scope, so do you mean that the data might only be for one channel, just duplicated/offset/sliced in some way that maybe isn't obvious from an initial reivew?

    This is what I've got for the 4 ADCs in the devicetree.dts file inside an axi-spi_engine_x instance.  They each have a unique label there, is that what you mean?

    ad4020_0: adc@0 {
    compatible = "ad4020";
    <snip>

    };

    <snip>

    ad4020_2: adc@0 {
    compatible = "ad4020";
    <snip>
    };

    <snip>

    ad4020_3: adc@0 {
    compatible = "ad4020";
    <snip>
    };

    <snip>

    ad4020_4: adc@0 {
    compatible = "ad4020";

    <snip>
    };

    I've also put the relevant iio_info output here in case that helps:

    iio:device0: ad4020 (buffer capable)
    1 channels found:
    voltage0: (input, index: 0, format: le:s20/32>>0)
    3 channel-specific attributes found:
    attr 0: offset value: -1048576
    attr 1: raw value: 976412
    attr 2: scale value: 0.002384185
    1 device-specific attributes found:
    attr 0: sampling_frequency value: 1800000
    3 buffer-specific attributes found:
    attr 0: data_available value: 0
    attr 1: length_align_bytes value: 8
    attr 2: watermark value: 400
    1 debug attributes found:
    debug attr 0: direct_reg_access value: 0x63
    iio:device1: ad4020 (buffer capable)
    1 channels found:
    voltage0: (input, index: 0, format: le:s20/32>>0)
    3 channel-specific attributes found:
    attr 0: offset value: -1048576
    attr 1: raw value: 792238
    attr 2: scale value: 0.002384185
    1 device-specific attributes found:
    attr 0: sampling_frequency value: 1800000
    3 buffer-specific attributes found:
    attr 0: data_available value: 0
    attr 1: length_align_bytes value: 8
    attr 2: watermark value: 400
    1 debug attributes found:
    debug attr 0: direct_reg_access value: 0x63
    iio:device2: ad4020 (buffer capable)
    1 channels found:
    voltage0: (input, index: 0, format: le:s20/32>>0)
    3 channel-specific attributes found:
    attr 0: offset value: -1048576
    attr 1: raw value: 21551
    attr 2: scale value: 0.002384185
    1 device-specific attributes found:
    attr 0: sampling_frequency value: 1800000
    3 buffer-specific attributes found:
    attr 0: data_available value: 0
    attr 1: length_align_bytes value: 8
    attr 2: watermark value: 400
    1 debug attributes found:
    debug attr 0: direct_reg_access value: 0x63
    iio:device3: ad4020 (buffer capable)
    1 channels found:
    voltage0: (input, index: 0, format: le:s20/32>>0)
    3 channel-specific attributes found:
    attr 0: offset value: -1048576
    attr 1: raw value: 831778
    attr 2: scale value: 0.002384185
    1 device-specific attributes found:
    attr 0: sampling_frequency value: 1800000
    3 buffer-specific attributes found:
    attr 0: data_available value: 0
    attr 1: length_align_bytes value: 8
    attr 2: watermark value: 400
    1 debug attributes found:
    debug attr 0: direct_reg_access value: 0x63

    Thanks now,

    Michael.

  • Can you post the full device tree? Posting a pastebin or github gist link would be ideal.

    -Travis

  • Hi Travis,

    This should be a link to the relevant pastebin of the source devicetree I'm compiling.

    https://pastebin.com/raw/iDT8Z8sD

  • Hi Travis,

    I was able to capture multiple deivces simultaneously with IIO-Scope - see below screenshot

    One difficulty I had was to do a FFT which was only working for the first channel, but the other ones were giving an error in the terminal

  • How are the DMAs connected in HDL? Do you want all ADC to map to one DMA?

    -Travis

  • It is likely you are timing out depending on how the enables are setup in HDL. When controlling individual channels how are you mapping data into the DMA(s)?

    The way your device tree is written tells me that you should have 4 DMAs, each with 1 channel. Is this what you want?

    -Travis

  • Yes, we have 4 x DMAs each with 1 channel used in the current design.

  • In that case, IIO-Scope should enumerate 4 devices each with 1 channel. Not where all the channels appear under one device. My guess is that IIO-Scope is getting confused since all the drivers have the same name.

    Let me check with one of the IIO-Scope developers to see what happens in this case. I think we usually assume they are all different.

    -Travis

  • Looking at the code for IIO-Scope, it currently assumes devices have unique names. Otherwise, it will improperly relate channel names. A ticket was made to fix this. In the meantime, I would recommend updating the device tree to give unique names to the driver entries.

    -Travis

  • Hi Travis,

    I think I've changed all the node names to be unique, but I'm still seeing the same behavior in iio scope. Should it be fixed with the updated dts, or will this require an updated version of IIO scope?

    Updated dts here in case I'm missing something in terms of the device names. ://pastebin.com/raw/AWdQGN3u