DAC AD5362 Issue

Hi,

 I am using AD5362 in my design which is interfaced with sitara processor.I modified kernel and added device tree node. Device is getting enumerated in /sys/bus/iio/devices.

The Vout of the DAC is fixed at 0.114V and not changing at all and I am not able to write any value to it (read error: Invalid argument is the error i am getting) following are the logs-

root@am57xx-evm:/sys/bus/iio/devices/iio:device2# ls
dev                      out_voltage2_raw         out_voltage5_scale
name                     out_voltage2_scale       out_voltage6_calibbias
of_node                  out_voltage3_calibbias   out_voltage6_calibscale
out_voltage0_calibbias   out_voltage3_calibscale  out_voltage6_offset
out_voltage0_calibscale  out_voltage3_offset      out_voltage6_raw
out_voltage0_offset      out_voltage3_raw         out_voltage6_scale
out_voltage0_raw         out_voltage3_scale       out_voltage7_calibbias
out_voltage0_scale       out_voltage4_calibbias   out_voltage7_calibscale
out_voltage1_calibbias   out_voltage4_calibscale  out_voltage7_offset
out_voltage1_calibscale  out_voltage4_offset      out_voltage7_raw
out_voltage1_offset      out_voltage4_raw         out_voltage7_scale
out_voltage1_raw         out_voltage4_scale       out_voltage_powerdown
out_voltage1_scale       out_voltage5_calibbias   power
out_voltage2_calibbias   out_voltage5_calibscale  subsystem
out_voltage2_calibscale  out_voltage5_offset      uevent
out_voltage2_offset      out_voltage5_raw
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat name
ad5362
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage0_raw
1024
ale @am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage0_calibsca
25600
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage0_raw
1024
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage1_raw
1152
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage2_raw
1280
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage3_raw
1408
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage4_raw
1536
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage5_raw
1664
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage6_raw
1792
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage7_raw
1920
root@am57xx-evm:/sys/bus/iio/devices/iio:device2#
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage0_scale
cat: read error: Invalid argument
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage1_scale
cat: read error: Invalid argument
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage2_scale
cat: read error: Invalid argument
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage3_scale
cat: read error: Invalid argument
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage4_scale
cat: read error: Invalid argument
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# echo 1000 > out_voltage0_raw
root@am57xx-evm:/sys/bus/iio/devices/iio:device2# cat out_voltage0_raw
1024

Parents
  • 0
    •  Analog Employees 
    on Oct 19, 2020 5:50 AM

    In the driver, it looks like you need to provide 2 reference regulators:

            [ID_AD5362] = {
                    .channel_template = AD5360_CHANNEL(16),
                    .num_channels = 8,
                    .channels_per_group = 4,
                    .num_vrefs = 2,
            },

    num_vrefs is 2

    the error " Invalid argument" seems to be coming from a missing regulator most likely;

    you need to add these regulators in the device-tree;

    even if you just specify some fixed-regulator property that has a fixed value;

  • Hi aardelean,

    We added vref in dts and now invalid argument is not coming and i am able to read scale property.

    But, whenever i am trying update out_voltage0_raw or any other channels that value is not getting updated and hence i am not getting analog out of that channel.what changes i have to do in driver?

  • triy 500 khz for testing; if it works, scale it up and see where it doesn't

    I changed it to 500khz but still the same issue.

  • 0
    •  Analog Employees 
    on Oct 27, 2020 11:57 AM in reply to VKumar592

    Hi,

    Try enabling the SPI debugging feature in linux:

    - enable spi_debug from make menuconfig

    See if some error outputs from spidev are received when running dmesg after trying to write to one of the out_voltageX.

    If still nothing show up, can you post a waveform of an SPI write?

  • Hi,

    SPI debugging is already enabled. Following is the log of SPI devices

    oot@am57xx-evm:~# dmesg | grep spi
    [    2.531099] omap2_mcspi 480b8000.spi: registered master spi1
    [    2.531334] spi spi1.0: setup: speed 1000000, sample trailing edge, clk normal
    [    2.531347] spi spi1.0: setup mode 1, 8 bits/w, 1000000 Hz max --> 0
    [    2.531549] omap2_mcspi 480b8000.spi: registered child spi1.0
    [    2.531875] omap2_mcspi 480ba000.spi: registered master spi2
    [    2.532058] spi spi2.0: setup: speed 1000000, sample leading edge, clk normal
    [    2.532070] spi spi2.0: setup mode 0, 8 bits/w, 1000000 Hz max --> 0
    [    2.532272] omap2_mcspi 480ba000.spi: registered child spi2.0
    [    2.532390] spi spi2.1: setup: speed 1000000, sample leading edge, clk normal
    [    2.532401] spi spi2.1: setup mode 0, 8 bits/w, 1000000 Hz max --> 0
    [    2.532592] omap2_mcspi 480ba000.spi: registered child spi2.1
    [    3.424147] ads8688 spi2.0: Looking up vref-supply from device tree
    [    3.424153] ads8688 spi2.0: Looking up vref-supply property in node /ocp/spi@480ba000/ads8688_1@0 failed
    [    3.424186] ads8688 spi2.0: setup: speed 1000000, sample trailing edge, clk normal
    [    3.424532] ads8688 spi2.1: Looking up vref-supply from device tree
    [    3.424537] ads8688 spi2.1: Looking up vref-supply property in node /ocp/spi@480ba000/ads8688_2@1 failed
    [    3.424563] ads8688 spi2.1: setup: speed 1000000, sample trailing edge, clk normal
    [    3.424899] ad5360 spi1.0: Looking up vref0-supply from device tree
    [    3.424960] ad5360 spi1.0: Looking up vref1-supply from device tree
    root@am57xx-evm:~#

    No errors are seen, when we try to write to /sys/bus/iio/devices/iio\:device2/out_voltage0_raw

  • 0
    •  Analog Employees 
    on Oct 29, 2020 6:17 PM in reply to VKumar592

    Hi,

    Can you tell us to what is SYNC connected? I see that SYNC is required to act as a CS, staying low for the duration of the write. IF SYNC does not go high after the 25th clock, transfer is considered corrupted and register won't update.

    Thanks

  • Hi,

    The issue is resolved after giving 10V vdd and -10V vss.

    initially we were giving 6V VDD and -6V vss

    thank you.

Reply Children
No Data