Post Go back to editing

AD9361 Pin Control Mode for ENSM

Hello,

    I am wondering how to synchronize the output of 4 AD9361s such that data from both comes out simultaneously without some delay due to SPI writes.  In my layout I have connected the same enable, length matched to all of the AD9361 devices as well as the TXNRX to each of the devices all length matched (same trace name).  I guess my question is if I just use spi writes will the valid and enable signals lag the other devices? I have an axi stream combine that will not output until all of the valids are '1'.  Ie, will the util_wfifo partially fill up for some devices and not the others introducing an offset in time of the data?  Or, should I use the pin control mode to set all of them to RX state simultaneously?  If I use the pin control method, what do you suggest to accomplish this?  Write custom VHDL?  Or, is there some C API I can take advantage of?

Thanks,

Andrew

Parents
  • I'm not clear on what you need to be synchronized. Are you trying to control ENSM on multiple chips simultaneously? ENSM is only mentioned in the title.

    -Travis

  • yes.   I have 4 chips.  If I use SPI mode, will there be a slight delay in the output data since the FIFO could be piling up data before the next chip gets enabled.  

  • If you need very precise timing control of the ENSM use pin control. Transitions happen with the device clock, so as long as the clocks going to each part are synchronized they will move together.

    -Travis

  • Is there any software code I can reference to implement pin control?  Do I need any VHDL to accompany it?  Or, just use level mode?

  • Here is an example we use on the default eval boards and SOMs: https://github.com/analogdevicesinc/linux_image_ADI-scripts/blob/master/test_ensm_pinctrl.sh

    Once the part is in pin control mode it will start responding to whatever is connected there. We directly map the GPIOs (which are connected to those pins) back to the ARM for software control.

    -Travis

  • ing  Hi;

    I am trying to run the following script for dds sweep generation using QT application. When I push button in qt then my script run behind it.During running my script generation f could not found. help to set this: I am using ADRV9361Z7035 FMC carrier board for generating frequency sweep from 70 MHz to 6GHz  using script.

    #!/bin/sh
    
    for i in $(find -L /sys/bus/iio/devices -maxdepth 2 -name name)
    do
      dev_name=$(cat $i)
      # find the DAC on FMComms1
      if [ "$dev_name" = "cf-ad9122-core-lpc" ] || [ "$dev_name" = "axi-ad9144-hpc" ] ; then
         dac_path=$(echo $i | sed 's:/name$::')
         A1=out_altvoltage0_1A_frequency
         A2=out_altvoltage2_2A_frequency
         B1=out_altvoltage1_1B_frequency
         B2=out_altvoltage3_2B_frequency
         sampl=`cat $dac_path/out_altvoltage_sampling_frequency`
         break
      fi
    # if that didn't work, try FMComms2/3
      if [ "$dev_name" = "cf-ad9361-dds-core-lpc" ] ; then
         dac_path=$(echo $i | sed 's:/name$::')
         A1=out_altvoltage0_TX1_I_F1_frequency
         B1=out_altvoltage1_TX1_I_F2_frequency
         A2=out_altvoltage2_TX1_Q_F1_frequency
         B2=out_altvoltage3_TX1_Q_F2_frequency
         A3=out_altvoltage4_TX2_I_F1_frequency
         B3=out_altvoltage5_TX2_I_F2_frequency
         A4=out_altvoltage6_TX2_Q_F1_frequency
         B4=out_altvoltage7_TX2_Q_F2_frequency
         sampl=`cat $dac_path/out_altvoltage_sampling_frequency`
         break
      fi
    done
    f [ -z $dac_path ] ; then
      echo Could not find any DDS to set
      exit
    fi
    
    ny=`expr $sampl / 2`
    
    #save the current settings
    init=`cat $dac_path/out_altvoltage0_1A_frequency`
    
    # Set DDSn_A
    freq_A(){
      if [ ! -z $A1 ] ; then echo $1 > $dac_path/$A1; fi
      if [ ! -z $A2 ] ; then echo $1 > $dac_path/$A2; fi
      if [ ! -z $A3 ] ; then echo $1 > $dac_path/$A3; fi
      if [ ! -z $A4 ] ; then echo $1 > $dac_path/$A4; fi
    }
    
    # Set DDSn_B
    freq_B(){
      if [ ! -z $B1 ] ; then echo $1 > $dac_path/$B1; fi
      if [ ! -z $B2 ] ; then echo $1 > $dac_path/$B2; fi
      if [ ! -z $B3 ] ; then echo $1 > $dac_path/$B3; fi
      if [ ! -z $B4 ] ; then echo $1 > $dac_path/$B4; fi
    }
    
    for i in `seq 1000000 1000000 $ny`
    do
      freq_A $i
      freq_B `expr $ny - $i`
      echo $i
      sleep 1
    done
    
    freq_A $init
    freq_B $init
    
    

Reply
  • ing  Hi;

    I am trying to run the following script for dds sweep generation using QT application. When I push button in qt then my script run behind it.During running my script generation f could not found. help to set this: I am using ADRV9361Z7035 FMC carrier board for generating frequency sweep from 70 MHz to 6GHz  using script.

    #!/bin/sh
    
    for i in $(find -L /sys/bus/iio/devices -maxdepth 2 -name name)
    do
      dev_name=$(cat $i)
      # find the DAC on FMComms1
      if [ "$dev_name" = "cf-ad9122-core-lpc" ] || [ "$dev_name" = "axi-ad9144-hpc" ] ; then
         dac_path=$(echo $i | sed 's:/name$::')
         A1=out_altvoltage0_1A_frequency
         A2=out_altvoltage2_2A_frequency
         B1=out_altvoltage1_1B_frequency
         B2=out_altvoltage3_2B_frequency
         sampl=`cat $dac_path/out_altvoltage_sampling_frequency`
         break
      fi
    # if that didn't work, try FMComms2/3
      if [ "$dev_name" = "cf-ad9361-dds-core-lpc" ] ; then
         dac_path=$(echo $i | sed 's:/name$::')
         A1=out_altvoltage0_TX1_I_F1_frequency
         B1=out_altvoltage1_TX1_I_F2_frequency
         A2=out_altvoltage2_TX1_Q_F1_frequency
         B2=out_altvoltage3_TX1_Q_F2_frequency
         A3=out_altvoltage4_TX2_I_F1_frequency
         B3=out_altvoltage5_TX2_I_F2_frequency
         A4=out_altvoltage6_TX2_Q_F1_frequency
         B4=out_altvoltage7_TX2_Q_F2_frequency
         sampl=`cat $dac_path/out_altvoltage_sampling_frequency`
         break
      fi
    done
    f [ -z $dac_path ] ; then
      echo Could not find any DDS to set
      exit
    fi
    
    ny=`expr $sampl / 2`
    
    #save the current settings
    init=`cat $dac_path/out_altvoltage0_1A_frequency`
    
    # Set DDSn_A
    freq_A(){
      if [ ! -z $A1 ] ; then echo $1 > $dac_path/$A1; fi
      if [ ! -z $A2 ] ; then echo $1 > $dac_path/$A2; fi
      if [ ! -z $A3 ] ; then echo $1 > $dac_path/$A3; fi
      if [ ! -z $A4 ] ; then echo $1 > $dac_path/$A4; fi
    }
    
    # Set DDSn_B
    freq_B(){
      if [ ! -z $B1 ] ; then echo $1 > $dac_path/$B1; fi
      if [ ! -z $B2 ] ; then echo $1 > $dac_path/$B2; fi
      if [ ! -z $B3 ] ; then echo $1 > $dac_path/$B3; fi
      if [ ! -z $B4 ] ; then echo $1 > $dac_path/$B4; fi
    }
    
    for i in `seq 1000000 1000000 $ny`
    do
      freq_A $i
      freq_B `expr $ny - $i`
      echo $i
      sleep 1
    done
    
    freq_A $init
    freq_B $init
    
    

Children