Post Go back to editing

AD5791 PMOD EVAL BOARD (CN0531) configuration for negative output voltages?

Category: Hardware
Product Number: CN0531 AD5791 PMOD EVAL BOARD
Software Version: Linux analog 5.10.63-v7+ #1 SMP Fri Mar 10 16:35:44 UTC 2023 w/ latest ADI updates via Kuiper script

I have a CN0531 (AD5791 PMOD EVAL BOARD) attached to a RPi 3B+ via a PMD-RPI-INTZ PMOD interface hat. 

Note that the CN0531 is in "as-received" condition -- no hardware modifications whatsoever have been made.  

On my setup, basic AD5791 operations work. 

For example, iio_info sees the AD5791, I can set positive output voltages up to 5V using the ADI-supplied overlay driver, and so forth.

However, I can not seem to set a negative output voltage.

Questions,

1) Does the CN0531 (AD5791 PMOD EVAL BOARD) support full range +5Vdc to -5Vdc "out of the box"?  Or is a hardware modification required?

2) The CN0531 schematic shows "DS1" -- an LED AND'd by a triad of power supplies.  On my CN0531, this LED is NOT illuminated.  Should it be?

3) What does the device file "out_voltage_offset" indicate?  It  has a value of -524288 and does not seem to be writeable.  Is this correct?

4) Observe:

root@analog:/sys/bus/iio/devices/iio:device0# echo "0" > out_voltage0_raw   <--- this results in ~ 0Vdc output (actually there is a 20 uV offset but I'm not worried about this right now)

root@analog:/sys/bus/iio/devices/iio:device0# echo "-1" > out_voltage0_raw   <--- this results in ~ 5Vdc output

root@analog:/sys/bus/iio/devices/iio:device0# echo "10000" > out_voltage0_raw  <-- this results in 47.7210 mVdc output

root@analog:/sys/bus/iio/devices/iio:device0# echo "-10000" > out_voltage0_raw  <-- this results in 4.95357 Vdc output


root@analog:/sys/bus/iio/devices/iio:device0# echo "309658" > out_voltage0_raw   <-- this results in 1.47695 Vdc output

root@analog:/sys/bus/iio/devices/iio:device0# echo "209658" > out_voltage0_raw   <--- this results in 1.00000 Vdc output

root@analog:/sys/bus/iio/devices/iio:device0# echo "-209658" > out_voltage0_raw   <--- this results in 4.00129 Vdc output

root@analog:/sys/bus/iio/devices/iio:device0# echo "-309658" > out_voltage0_raw  <-- this results in 3.52433 Vdc output
root@analog:/sys/bus/iio/devices/iio:device0# echo "309658" > out_voltage0_raw   <-- this results in 1.47695 Vdc output

root@analog:/sys/bus/iio/devices/iio:device0# echo "1048310" > out_voltage0_raw   <-- this results in 5.00000 Vdc output

root@analog:/sys/bus/iio/devices/iio:device0# echo "-1048310" > out_voltage0_raw   <-- this results in 1.2891 mVdc output

5) The +8Vdc and -8Vdc rails have been verified by DMM.  

6) Everything seems to work otherwise, just no negative voltages can be output -- and it's not clear whether this is a overlay/driver issue or a hardware issue.  

root@analog:/home/analog# 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-v7+ #1 SMP Fri Mar 10 16:35:44 UTC 2023 armv7l
IIO context has 9 attributes:
        hw_model: 0x0001 on Raspberry Pi 3 Model B Plus Rev 1.3
        hw_carrier: Raspberry Pi 3 Model B Plus Rev 1.3
        hw_mezzanine: 0x0001
        hw_name: PMD-RPI-INTZ
        hw_vendor: Analog Devices, Inc.
        hw_serial: 1f47ca8a-6e00-450b-b209-592d0e4d67cf
        dtoverlay: vc4-kms-v3d,rpi-ad5791
        local,kernel: 5.10.63-v7+
        uri: local:
IIO context has 4 devices:
        hwmon0: cpu_thermal
                1 channels found:
                        temp1:  (input)
                        1 channel-specific attributes found:
                                attr  0: input value: 45084
                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:device0: ad5791
                1 channels found:
                        voltage0:  (output)
                        6 channel-specific attributes found:
                                attr  0: offset value: -524288
                                attr  1: powerdown value: 0
                                attr  2: powerdown_mode value: 6kohm_to_gnd
                                attr  3: powerdown_mode_available value: 6kohm_to_gnd three_state
                                attr  4: raw value: 209658
                                attr  5: scale value: 0.004768376
                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

root@analog:/home/analog# cd /sys/bus/iio/devices/iio:device0
root@analog:/sys/bus/iio/devices/iio:device0# ls -sl
total 0
0 -r--r--r-- 1 root root 4096 Nov  5 14:15 dev
0 -r--r--r-- 1 root root 4096 Nov  5 14:15 name
0 lrwxrwxrwx 1 root root    0 Nov  5 14:15 of_node -> ../../../../../../../../firmware/devicetree/base/soc/spi@7e204000/ad5791@1
0 -rw-r--r-- 1 root root 4096 Nov  5 17:31 out_voltage0_raw
0 -rw-r--r-- 1 root root 4096 Nov  5 14:15 out_voltage_offset
0 -rw-r--r-- 1 root root 4096 Nov  5 17:31 out_voltage_powerdown
0 -rw-r--r-- 1 root root 4096 Nov  5 14:15 out_voltage_powerdown_mode
0 -r--r--r-- 1 root root 4096 Nov  5 14:15 out_voltage_powerdown_mode_available
0 -rw-r--r-- 1 root root 4096 Nov  5 14:15 out_voltage_scale
0 drwxr-xr-x 2 root root    0 Nov  5 14:15 power
0 lrwxrwxrwx 1 root root    0 Nov  5 14:15 subsystem -> ../../../../../../../../bus/iio
0 -rw-r--r-- 1 root root 4096 Nov  5 14:15 uevent
root@analog:/sys/bus/iio/devices/iio:device0# cat name
ad5791
root@analog:/sys/bus/iio/devices/iio:device0# cat out_voltage_scale
0.004768376
root@analog:/sys/bus/iio/devices/iio:device0# cat out_voltage_offset
-524288
root@analog:/sys/bus/iio/devices/iio:device0#



Corrected a voltage reading given a command line parameter.
[edited by: jds18 at 3:26 AM (GMT -5) on 6 Nov 2023]

Top Replies