AD5930 and AD5932 evaluation board software commands

Hi,

This discussion explains how to use the new dll library available for both Windows 32 and 64 bits OS.

We aim to provide a detailed explanation of the dll functions and the commands associate with each evaluation board.

This discussion WONT provide any more specific example than the .vi and VB6 code attached.

We are not software developers so for any other software platform, don’t ask please.

If you have some question you can use any search engine available in the web.

Before start you must install, ADI_PDA_Drivers.exe

The dll can be found in the next path:

“Program Files\Analog Devices\USB Drivers\ADI_CYUSB_USB4.dll”

Before continue, the dll has been developed in C++ so, some clarifications

-          The sign “*” before the name of the function means pointer

-          UInt: unsigned integer, 4 bytes

-          Int: Integer, 4 bytes

-          UShort: unsigned short, 2bytes

-          Char: char, 1 byte

-          UChar: unsigned char, 1 byte

The three first functions are used to connect with the board and have to be called in the order they are presented in this document.

  • Search For Boards

 

Function prototype:

Uint  Search_For_Boards (uint VID, uint PID, uint *Num_boards, char *PartPath[]);

 

This function searches the PC for USB devices that match the requested VID and PID.
It returns an error (zero for non-error) along with the number of matching boards found and a path address in a buffer for each of them.

The PartPath returns the path for each board found in the PC that match PID and VID.

Ie. Num_boards = 2,

Path for the first board -> PartPath[0]

Path for the second board -> PartPath[1]

VID : 0x0456 for both boards.

PID table

Board


PID (Hex)

EVAL-AD5930EBZ

B205

EVAL-AD5932EBZ

B20B

  • Connect

Function prototype:

Int Connect(Uint VID, Uint PID, char PartPath, Uint *Handle);

The PID and the VID are the same than before.

This function connects with the board at address path after making sure that it’s still the correct board (checks PID & VID). A handle is returned, along with an error variable (zero for non-error). The handle is the unique identifier for the PC-Board connection.

PartPath is a single location from the previous array, typically PartPath(0).

  • Download Firmware

 

                Function prototype:

Int Download_Firmware(Uint Handle, char  pcFilePath[]);

 

This function programs the uC. The pcFilePath is the path where is located the hexadecimal file (included in the attached file) to program the uC. The char array should be null terminated (finish with 0)

  • Vendor Request

Function prototype:

Int  Vendor_Request(UInt  Handle, UChar Request, UShort Value, UShort Index, UChar Direction, UShort DataLength, UChar *Buffer[]);

This function sends commands between PC and board. The command table is included in the hexadecimal code that has been downloaded previously.

Each command requires different parameters for the execution. The list of commands available for both boards is explained below.

An error value is returned (zero = no error)


Request

Value

Index

Direction

Datalength

Buffer

write

0xDD

Data_to _write(16 bits)

0

0

0

0

set standby pin

0xDC

0

0

0

0

0

clear standby pin

0xDB

0

0

0

0

0

pulse control pin

0xDA

0

0

0

0

0

set control pin

0xD9

0

0

0

0

0

clear control pin

0xD8

0

0

0

0

0

pulse interrupt pin

0xD7

0

0

0

0

0

  • Disconnect

 

                Function prototype:

Int Disconnect (Uint Handle)

This function closes the connection PC – board.

If do you think I miss something, just let me know, please

Regards,

Miguel

attachments.zip
  • Dear Sir,

    I am not very good in Programming ,request you to provide the source code of the Software built in LabVIEWwhich comes with EvalAD5932.

    I m using the exe file but i could not pogramme it for a fix frequency scan. it requires ctrl pin to be high when loading output. link  to the documen. http://www.analog.com/static/imported-files/application_notes/AN-1044.pdf . I just want to fixthe frequency to 1 mhz.

    Thanks for your help.

    Best Regards,

    Rahul Vijay

  • dear sir,

    Thank you for your help.

    Regards,

    Rahul Vijay

  • DEAR SIR,

     

    Thank you for sharing code. I m using the same for my
    application.

     

    MY application requires a fixed frequency source of 1 Mhz and I m trying to fix the Frequency of EVAl AD5932 Board to 1 MHZ but I m not getting successful. Toggling Ctrl Pin starts the frequency scan and goes infinitely it does not stops at desired frequency. I did the following to get my desired frequency:-

    1. Powered board from 4.2 V Battery output.Connected to DVDD.
    2. As Per Manual. For Fixed Frequency you have to load the data by driving CONTROL pin High. I modified the labview code by applying A true Constant in to CONTROL Local variable inside main VI (so that CONTROL will be always high).
    3. I adjusted the values of start, increment and number of increment for getting 1 mhz then selected sine wave,continuous output, DAC enabled and rest others Disabled .Run the code and Clicked on  PROGRAM button and clicked on CONTROL button.I am able to see my desired sinewave of 1 Mhz in oscilloscope.
    4. I disconnected the USB, Change the CONTROL link (LK 4)from software to hardware and start the scan by toggling Ctrl link. The oscilloscope shows value increment from 290 hz  ,300 hz ,400 hz ,1 Mhz,3 mhz,6 Mhz and keeps going. It does not stop at 1 Mhz.
    5. For toggling CONTROL PIN .I m using a metal screw driver, just by touching it with metal it starts the frequency scan. No voltage is applied on CONTROL Link.         

    For my application I Need a Fixed frequency Source of 1 Mhz. How to get the same??Am I doing something wrong .Please Guide me.

     

    My apologies for bothering you, Kindly help.

    Best regards,

      Rahul Vijay

  • May you connect a scope probe in the CRTL pin and repeat the sequence, please.