Digilent Port Communications User Manual
Page 3
Digilent, Inc
TM
DPCUTIL Programmer’s Manual
www.digilentinc.com
© Digilent, Inc.
Page
3 of 14
The Device Table
All communication modules accessed through
DPCUTIL are kept in a table called the device
table. All details needed to connect to a device
are stored in this table. Each device in the
table is assigned a name and DPCUTIL uses
this name (and not the index) to access the
device. The device table can only be modified
through a dialog box included in the DPCUTIL
DLL. Calling the DvmgStartConfigureDevices
function will open this dialog box.
To get the total number of devices in the
device table, call the DvmgGetDevCount
function. To get the name of a device with a
given index, call the DvmgGetDevName
function. A device table always has a default
device in it. The index of this device can be
obtained by calling DvmgGetDefaultDev. If
there are no devices in the device table,
DvmgGetDefaultDev will return –1.
Using the DPCUTIL Data Transfer
functions
The data transfer functions in DPCUTIL rely on
the logic loaded into the FPGA. This logic
must reserve byte-sized registers used for
reading and/or writing. Through these
registers, the DPCUTIL data transfer functions
will communicate with the FPGA through a
connected communications module. As
mentioned before, the data transfer functions
allow for:
1.
a register be written to or read from
2.
many registers can be written to or
read from as a single transaction.
3.
a stream of bytes to be sequentially
written to or read from a single
register
In this way, an application can communicate
with an FPGA through DPCUTIL. For a more
detailed explanation of the interface between
the FPGA and communications module, see
Digilent Parallel Interface Module Reference
Manual.
Before using any data transfer functions, the
application must connect to a communication
device using DpcOpenData. The first
parameter is a pointer to an interface handle
(hif). If the function returns successfully, this
handle will be used to connect to the device in
all proceeding data transfer calls. The device
is specified by its assigned name in the device
table and passed as the second parameter in
the DpcOpenData function.
After this API function is called, any of the data
transfer functions can be used. When finished,
close the device using DpcCloseData.
About JTAG
Most logic memory devices are programmable.
Many chip manufacturers accomplish this by
conforming these devices to a standard
specified in IEEE 1149.1. This is the Joint Test
Action Group, or JTAG. A device is said to be
JTAG compliant if it contains a JTAG TAP
controller and the following pins: TDI, TDO,
TMS, and TCK.
TDI inputs data into the JTAG TAP controller,
and TDO provides outputs. TMS is used to set
the JTAG TAP controller to a specified state,
and TCK is used to clock bits into and out of
the JTAG TAP controller. After being set to the
proper state by TMS, bits are shifted into the
TAP controller on TDI while bits are shifted out
on TDO. Any FPGA, CPLD, or PROM that is
JTAG compliant can be erased, programmed,
and verified using this standard.
The TDI and TDO pins of several JTAG
devices can be connected together to form a
chain. This is called a JTAG scan chain. In
order to program a device in the JTAG scan
chain, all other devices are first set to
BYPASS, meaning that they are ignored and
not to be configured. Then a series of bits are
shifted into the scan chain through TDI to
configure the device.
For more information on JTAG functionality
and programming, read the IEEE 1149.1