USB_IO_for_VB6.dll User Guide

Similar documents
USB Interrupt Transfer Example PSoC 3 / PSoC 5

EZ-Red Power I/O module for PC See for other manuals

ET355 Microprocessors Thursday 6:00 pm 10:20 pm

CAN Interface Application Note

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #3: Of Integers and Endians (pt. 2)

MCP 1200 Evaluation Board Guidance

SISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:

Aeroflex Colorado Springs Application Note

What is new going from A2 to A3:

Venstar Thermostat Adapter

CTT MODBUS-RTU COMMUNICATION PROTOCOL TEMPERATURE MONITOR DEVICE

Level 3 Computing Year 2 Lecturer: Phil Smith

GIGAVAC Contactors I 2 C Communication

Numbers!!...is that right? CSCI 255

l l l l l l l Base 2; each digit is 0 or 1 l Each bit in place i has value 2 i l Binary representation is used in computers

DSM API MANUAL Ver 2.2

vcan API USER GUIDE v1.0 Date : 18th December 2016

E2ISP DLL Using the DLL in your applications

SISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:

Micro Module Shutter. Micro Module Shutter

EMBEDDED HARDWARE DESIGN. Tutorial Interfacing LCD with Microcontroller /I

SAINT2. System Analysis Interface Tool 2. Emulation User Guide. Version 2.5. May 27, Copyright Delphi Automotive Systems Corporation 2009, 2010

Chapter 6 Sub Procedures

Read section 8 of this document for detailed instructions on how to use this interface spec with LibUSB For OSX

SwitchLinc 2-Wire Dimmer (RF Only) (2474DWH - Dev 0x01 / Sub 0x24)

1. Introduction to Assembly Language

Programming Notes and Examples

TSA6G1,TSA5G35,TSA4G1 USB mini Spectrum Analyzer Application Programming Interface (API)

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

ADS54J66 EVM Quick Startup Guide

INSTEON Hidden Door Sensor

CONTROL OF MED INPUT/OUTPUT MODULES FROM OTHER LANGUAGES

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO

Lecture 4 DLLs and Custom Hardware Programming

University of Florida EEL 3701 Drs. Eric M. Schwartz & Karl Gugel. Quartus ROM Creation Instructions (in Quartus Prime Lite 17.1)

Team Solutions, Inc. TE5100 PCI/PXI 100 MHz Signal Generator. Programming Manual

Beginning C Programming for Engineers

Systems Programming. Lecture 2 Review of Computer Architecture I

MPPC module. Function Specifications (mppcum1a) Version 1.0. K29-B60901e

int result; int waitstat; int stat = PmcaAsyncGetGain(&result); // stat receives request id

SISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).

Panther Programmer USER MANUAL. Version 1.01 November, 2017

MIDI Reference CLP- 525

PRODUCT RELIABILITY HOST COMMUNICATIONS PACKET STRUCTURE SPECIFICATION. % of Initial Brightness (New Module) NOTE. <type><data_length><data><crc> type

A short introduction to SystemVerilog. For those who know VHDL We aim for synthesis

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

Texas Instruments TUSB8040 EEPROM Programming Utility. User s Guide

RS232-ADC16/24 Manual

Version Action Author Date

OEM API Specification

Embedded Systems - FS 2018

Tutorial 1: C-Language

M1 Computers and Data

CMPE223/CMSE222 Digital Logic Design. Positional representation

ADI-SPI. Technical Specification. Serial Control Interface Standard (Rev 1.0)

KK_FX80E.DLL / libkk_fx80e.so. K+K Library for Windows and Linux PCs. Manual

TTCrx Receiver User Manual

Number representations

Chapter 2 Number System

FP-GPIO96. FeaturePak I/O Module with 96 Digital I/O Points. Rev A.01 November 2013

LAB A Translating Data to Binary

CDN Series Displays with Profibus-DP ELEN UNI-TXT (ND) protocol PARAMETRIZATION OF PROFIBUS-DP COMMUNICATION INTERFACE

1 Firmware Description

But first, encode deck of cards. Integer Representation. Two possible representations. Two better representations WELLESLEY CS 240 9/8/15

SATA-IP Host Demo Instruction on SP605 Rev Jan-10

CE4DMID01 COMMUNICATION PROTOCOL CONTENTS 1.0 INTRODUCTION

Developer Notes INSTEON Thermostat v012. Developer Notes. INSTEON Thermostat. Revision History

$U6RIW,QWHUQDWLRQDO. Modbus Driver for Windows 95/98/NT/2000/XP 8VHUV0DQXDO 0RGEXV,QWHUIDFH. 9HUVLRQ Page 1

System Monitoring Library Windows driver software for Classembly Devices

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

Embedded Systems - FS 2018

Modbus Protocol For FTS/FTM 3x&8x

CS 261 Fall Binary Information (convert to hex) Mike Lam, Professor

Technical Specification. Third Party Control Protocol. AV Revolution

EPCQ-A Serial Configuration Device Datasheet

Digidim RS232 AV Interface

Simple IP-based utca Control System

Analyser TCL Library

EWTJ-680 API Specification

Developer Notes for KeypadLinc Line

EE2007 Microprocessor systems.

All unused entries will be coded as 0x00. All unused bits in defined bytes will be coded as 0 except where noted.

Survey. Motivation 29.5 / 40 class is required

The 8237 DMA Controller: -

Digital Logic Lecture 2 Number Systems

How to use JS Automation I/O driver

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Introduction to 8086 Assembly

Memory, Data, & Addressing II CSE 351 Spring

Mini-Circuits Programming Manual For the. USB RF Switch Matrices

ACR1281U-C1 USB Dual Interface Reader Application Programming Interface V1.08 Subject to change without prior notice

Meilhaus Electronic Manual ME E. Digital I/O Board for ISA Bus

CAN / RS485. Product Description. Technical Reference Note. Interface Adapter. Special Features

DTM-3200 OEM TS-over-IP Converter

Logosol Joystick Node LS-731

Do not start the test until instructed to do so!

TSB Software Reference Manual

1.1. Unit 1. Integer Representation

World Inside a Computer is Binary

Transcription:

USB_IO_for_VB6.dll User Guide This guide explains the usage of USB_IO_for_VB6.dll for creating custom gui s for DDC EVM board. Note: This guide does not cover all the functions of the DLL but provides necessary information to configure the DDC EVM board and capture data from DDC device. Overview: The mode of communication between DDC EVM board and Computer is through USB. The DLL USB_IO_for_VB6.dll used for communicating with the DDC EVM board creates necessary USB handle and closes it after use. The DLL functions covered in this guide are, 1. XferINTDataIn - Receive data from USB to Computer. 2. XferINTDataOut - Send data from Computer to USB. 3. WriteFPGARegsC - Perform FPGA write operation and read back of FPGA Registers. 4. FastAllDataCap - Capture data from DDC device. Function Declarations: Note: The method for calling DLL function may vary with programming language/environment. The calling method for Visual Basic and LabVIEW are provided under each function explanation. 1. int stdcall XferINTDataIn( int *USBdev, int *INTData, long *DataLength ); 2. int stdcall XferINTDataOut( int *USBdev, int *Data01, int *Data02, int *Data03, int *Data04 ); 3. long stdcall WriteFPGARegsC(int *USBdev, long DUTSelect, long * RegsIn, long * RegsOut, long * RegEnable); 4. long stdcall FastAllDataCap(double * AVGArr, double * RMSArr, double * P2PArr, double * MAXArr, double * MINArr, long ArrSize, long Channels, long ndvalidreads, double * DataArray, long * AllDataAorBfirst); Function Explanations: 1. int stdcall XferINTDataIn (int *USBdev, int *INTData, long *DataLength); Public Declare Function XferINTDataIn Lib "USB_IO_for_VB6.dll" ( ByRef USBdev As Short, ByRef Array_Data As Short, ByRef DataLen As Integer ) As Short

Calling in LabVIEW: int16_t XferINTDataIn( int16_t *USBdev, int16_t *Array_Data, int32_t *DataLen ); Creates an instance of USB Device class. If the bulk in endpoint is reached, data is transferred and 0 is returned. Returns -10 if USB endpoint cannot be reached. Returns -2 if cannot open USB device. Returns 1 if more data is coming. USBdev - Specify which DDC EVM board to receive data from, if multiple DDC EVM boards are connected to computer. Array_Data - The variable to store the array of data received from DDC EVM board. DataLen - Specify the length of Array_Data. 2. int stdcall XferINTDataOut( int *USBdev, int *RegH, int *RegL, int *DataH, int *DataL ); Public Declare Function XferINTDataOut Lib "USB_IO_for_VB6.dll" ( ByRef USBdev As Short, ByRef RegH As Short, ByRef RegL As Short, ByRef DataH As Short, ByRef DataL As Short ) As Short Calling in LabVIEW: int16_t XferINTDataOut( int16_t *USBdev, int16_t *RegH, int16_t *RegL, int16_t *DataH, int16_t *DataL ); Creates an instance of USB Device class. If the bulk out endpoint is reached, data is transferred and 0 is returned. Returns -1 if no USB devices are open. USBdev - Specify which DDV EVM board to receive data from, if multiple DDV EVM boards are connected to computer. RegH - The decimal equivalent of high nibble of 8 bits FPGA Register Address. RegL - The decimal equivalent of low nibble of 8 bits FPGA Register Address. DataH - The decimal equivalent of high nibble of 8 bits FPGA Register Value. DataL - The decimal equivalent of low nibble of 8 bits FPGA Register Value. 3. long stdcall WriteFPGARegsC(int *USBdev, long DUTSelect, long *RegsIn, long *RegsOut, long *RegEnable); Public Declare Function WriteFPGARegsC Lib "USB_IO_for_VB6.dll" (ByRef USBdev As Short, ByVal DUTSelect As Integer, ByRef Array_RegsIn As Integer, ByRef Array_RegsOut As Integer, ByRef Array_RegEnable As Integer) As Integer

Calling in LabVIEW: int32_t WriteFPGARegsC(int16_t *USBdev, int32_t *DUTSelect, int32_t *Array_RegsIn, int32_t *Array_RegsOut, int32_t *Array_RegEnable); Creates an instance of USB Device class. Writes, reads back FPGA register content, then resets CONV. Returns -1 if no USB devices are open. Returns 0 upon completion of function. Returns -9 or -10 if USB endpoint cannot be reached. USBdev - Specify which DDV EVM board to receive data from, if multiple DDV EVM boards are connected to computer. DUTSelect - (Currently unused). Array_RegsIn - Array of Register Values in decimal format. The Value for the Register Address X must be at the index X in the Array_RegsIn. These Register Values will be written to the FPGA Registers. Array_RegsOut - Array of Register Values in decimal format. The Value for the Register Address X will be at the index X in the Array_RegsOut. These Register Values are read from FPGA after performing write operation. Array_RegsEnable - Array of values with either 0 or 1 indicating which FPGA Register are to be written. The Register with Address X will be written only if the value of Array_RegsEnable at index X is 1. 4. long stdcall FastAllDataCap(double * AVGArr, double *RMSArr, double *P2PArr, double *MAXArr, double *MINArr, long ArrSize, long Channels, long Samples, double *AllData, long *AllDataAorBfirst); Public Declare Function FastAllDataCap Lib "USB_IO_for_VB6.dll" (ByRef AVGArr As Double, ByRef RMSArr As Double, ByRef P2PArr As Double, ByRef MAXArr As Double, ByRef MINArr As Double, ByVal ArrSize As Integer, ByVal Channels As Integer, ByVal Samples As Integer, ByRef AllData As Double, ByRef AllDataAorBfirst As Integer) As Integer Calling in LabVIEW: int32_t FastAllDataCap(double *AvgArr, double *RMSArr, double *P2PArr, double *MaxArr, double *MinArr, int32_t ArrSize, int32_t Channels, int32_t Samples, double *AllData, int32_t *AllDataAorBFirst); Creates an instance of USB Device class. Captures data from DDC device and provides the samples read, the average per channel, the RMS value per channel, the peak to peak difference per channel, maximum value and minimum value per channel. Returns 0 if the data is captured properly. If the return value is less than 0, the data capture was not proper.

AvgArr - The average of samples read per channel. RMSArr - The RMS value of samples read per channel. P2Parr - The peak to peak difference of the read samples per channel. MaxArr - The maximum sample value per channel. MinArr - The minimum sample value per channel. ArrSize - The array length of above mentioned arrays which must be equal to twice the number of channels to read. Channels - The number of channels to read from DDC Device. Samples - The number of samples to read from each channel. AllData - The entire samples read. AllDataAorBFirst - Specifies whether A side is read first or B side is read first. Function Usage: 1. Configuring FPGA Registers: The Registers of FPGA to be configured are mentioned below. Register Address (hex) Register Value 01 Load CONV Low MSB 02 Load CONV Low MIDB 03 Load CONV Low LSB 04 Load CONV High MSB 05 Load CONV High MIDB 06 Load CONV High LSB 07 DDC Sys Clock High and Low (each 4 bits) 08 DDC Sys Clock Select (0 - Low, 1 - Running) Format*16 + Channel Count Format: 0 16 bit, 1 20 bit 09 Ch. Count: 0 1 Ch., 1 2 Ch., 2 4 Ch., 3 8 Ch., 4 16 Ch., 5 32 Ch., 6 64 Ch., 7 128 Ch., 8 256 Ch., 9 512 Ch., 10 1024 Ch., 11 0 Ch. 0A DDC Data Clock High and Low (each 4 bits) 0B DDC Data Clock Select (0 - Low, 1 - Running) 0C DVALIDS (Samples) to Ignore 0D DVALIDS (Samples) to Read MSB 0E DVALIDS (Samples) to Read MIDB 0F DVALIDS (Samples) to Read LSB 13 DCLK Wait Count MSB 14 DCLK Wait Count MSB 20 CLK CFG High and Low (each 4 bits) The high and low bytes FPGA Firmware version can be read from Register Addresses 0x5E and 0x5F respectively.

Use WriteFPGARegsC() for configuring FPGA Registers. Initialize three arrays with 255 elements each, for RegsIn, RegsOut and RegsEnable. Assign values to be written in RegsIn at corresponding indices and 1 at the same indices in RegsEnable. Specify 0 for USBdev to configure first DDC EVM board. After the DLL function execution, the readback FPGA register values will be assigned in RegsOut array at corresponding indices. Use these values to verify write operation. Note: To perform FPGA registers read operation alone, make all the values in RegsEnable as 0 and execute the DLL function. 2. Configuring DDC Registers: First use XferINTDataOut() to send data to board and configure DDC register. Since the function at a time writes to only one register, the function has to be executed for multiple times to write to the below mentioned registers in FPGA. The first two digits represent RegH & RegL and the last two digits represent DataH & DataL. Data to be sent in sequence: 0000, 0000, 1100, 1200, 1C<DDC_High_Reg Value>, 1D<DDC_Low_Reg Value>, 1F01, 0000, 0000, 1E01. Then use XferINTDataIn() to receive data from board which gives the read back values from DDC device. This is the optional read back from the DDC device immediately after configuring the DDC registers. The data length must be 512 and the array should be initialized with 4096 elements. After the DLL function execution, the array specified as a argument in DLL function contains read back data. Parsing the read back data for DDC registers value and Die Id: 1. First retrieve elements from all the even indices. 2. Now delete the elements at 0, 4, 8, 12 indices 3. The elements at indices 1, 5, 9, 13 can be left as such 4. Then replace each elements at indices 2, 3, 6, 7, 10, 11 with two elements that are the decimal equivalent of high nibble and low nibble of the corresponding element respectively. The array now contains DDC Register data and Die Id at specific indices depending on the DDC device present on the EVM board. Each element in this array represents either high or low nibble of the data. Index Device Value 64 DDC264 High Register High Nibble (if 16 bit mode) 65 DDC264 High Register Low Nibble (if 16 bit mode) 66 DDC264 Low Register High Nibble (if 16 bit mode) 67 DDC264 Low Register Low Nibble (if 16 bit mode) 68 DDC264 Die Id (if 16 bit mode) 192 DDC264 High Register High Nibble (if 16 bit mode) 193 DDC264 High Register Low Nibble (if 16 bit mode) 194 DDC264 Low Register High Nibble (if 16 bit mode)

195 DDC264 Low Register Low Nibble (if 16 bit mode) 196 DDC264 Die Id (if 16 bit mode) 80 DDC264 High Register High Nibble (if 20 bit mode) 81 DDC264 High Register Low Nibble (if 20 bit mode) 82 DDC264 Low Register High Nibble (if 20 bit mode) 83 DDC264 Low Register Low Nibble (if 20 bit mode) 84 DDC264 Die Id (if 20 bit mode) 240 DDC264 High Register High Nibble (if 20 bit mode) 241 DDC264 High Register Low Nibble (if 20 bit mode) 242 DDC264 Low Register High Nibble (if 20 bit mode) 243 DDC264 Low Register Low Nibble (if 20 bit mode) 244 DDC264 Die Id (if 20 bit mode) Data at indices 64,65,66,67,68 should match data at indices 192,193,194,195,196 for 16 bit mode and data at indices 80,81,82,83,84 should match data at indices 240,241,242,243,244 for 20 bit mode if the DDC is configured successfully. To Hard Reset the DDD device use XferINTDataOut() to send the following register values. The first two digits represent RegH & RegL and the last two digits represent DataH & DataL. Data to be sent in sequence: 0000, 15FF, 15FF, 1500, 1500, 15FF, 15FF. 3. Data Capture: Use FastAllDataCap() for Data Capture. Before data capture, FPGA and DDC must be configured properly. Initialize the arrays AVGArr, RMSArr, P2Parr, MAXArr, MINArr with Channels*2 elements. Initialize the array AllData with Channels*Samples elements. After the DLL function execution, the arrays will be filled with corresponding data. AllData array will have data in the order as shown below. (X Channels Count, N Samples Count) AllData Array Index Side AllDataAorBFirst = 0 AllDataAorBFirst = 1 Sample # Channel # 0 A B 1 1 1 A B 1 2 (X 1) A B 1 X X B A 1 1 (X + 1) B A 1 2 (2X 1) B A 1 X 2X A B 2 1 (2X + 1) A B 2 2 (3X 1) A B 2 X 3X B A 2 1 (3X + 1) B A 2 2

(4X 1) B A 2 X X*(N-2) A B N 1 (X*(N-2) + 1) A B N 2 (X*(N-1) 1) A B N X X*(N-1) B A N 1 (X*(N-1) + 1) B A N 2 (X*N 1) B A N X The AVGArr, RMSArr, P2Parr, MAXArr and MINArr arrays will have corresponding data in the order A_ChX, A_Ch(X-1),, A_Ch1, B_ChX, B_Ch(X-1),, B_Ch1. These arrays will always have A side s data first and B side s data second and from last channel to first channel.