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.
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
Path for the second board -> PartPath
VID : 0x0456 for both boards.
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).
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)
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)
Data_to _write(16 bits)
set standby pin
clear standby pin
pulse control pin
set control pin
clear control pin
pulse interrupt pin
Int Disconnect (Uint Handle)
This function closes the connection PC – board.
If do you think I miss something, just let me know, please
Sorry for the delayed reply.
I tried you suggestion but it is not working. I did the following:-
1. I connected the Board with Battey supply.
2. I took another supply and connected it to the ctrl pin, 2.2 volt was applied constanly to the ctrl pin.
3. In labview I pressed Programm. It shows the correct frequency immediately.
4. Everything was disconnected and Restarted .further on toggling the control pin .it again starts the freqency from 250 khz,and goes upto 7 mhz. it keeps on changing value it does not stop.
5. Till it is connected to the Computer it works fine as soon as you disconnect and run independently it does not work.
Note:- i have been giving 2.3 volt ,Boards was set to be toggled from hardware not software.
Request you to advice what to do next.
Im assuming that the part is all time powered, right?
Are the digital pins floating? pulled?
May you provide plots including CRTL pin and VOUT, please.
Thanks for your reply.The details is explained below.
1. The Eval Board is powered from a 4.2 volt Battery. The Toggling of control pin / Constant Volatge applied to the Ctrl pin is from another Battery source 2.2 Volts. The device is connected with laptop for programming and selcting desired frequency ( 1 mhz, sinewave).The Ground of Both batteries are connected to the Ground of Eval board.
2. After powering up, the usb port is connected to The Laptop, The CTRL pin is kept high by constantly applying 2.2 volts.In software all reqd parameter adjusted; On pressing Programm it Displays the Exact frequency as required ( 1.1 Mhz, sinewave).
3. The usb cable from laptop disconnected ,All batteries disconnected. system power down.
4. system started,Eval Boad power up using Battery. No waveform display in oscilliscope. Ctrl Pin toggled by applying 2.2 volts from another battery. Scan of waveform starts ( sinewave), 1khz, 50 khz,250 khz, 1 mhz, 5 mhz,etc.
Signal value keeps on Varying ,until Laptop is again connected and Programm button pressed on the software screen.
kindly advise what to do?
Thanks for your support.
Just to clarify, CRTL must be low during programming....
Once the part is programmed generate a pulse LOW -> HIGH -> LOW
CRTL should be pulled low.
once the part is programmed, you must generate a pulse in the CTRL pin and the sweep will start.
BTW... did you implement a de-bounce circuitry in the CTRL pin?