DLN-Series Interface Adapters User Manual

In this user manual you will get the full instructions on how to start using your DLN-series adapter in the compatible MS Windows and Linux OS. Also here you will find answers about using DLN software (binaries, firmware update, using DLN server service etc.).

Rating: 
Average: 3.2 (202 votes)

System Requirements

To run DLN-series PC-I2C/SPI/GPIO adapters software on your computer you should have:

  • MS Windows XP, Vista, 7, 8(8.1), 10 or Linux operating system compatible PC.

  • At least 256 Mb of RAM.

  • Available USB port.

Some of the DLN software applications work only in MS Windows OS.
Rating: 
Average: 2.4 (5 votes)

Installation & Using DLN Adapter in MS Windows

DLN-series USB-I2C/SPI/GPIO interface adapters are assigned to access your hardware from PC using I2C, SPI interfaces and GPIO.

Before you start using the DLN-series adapters, you need to install the USB communication driver suitable for your operation system. The driver is installed together with the DLN setup package, which can be found in the Downloads section of the www.dlnware.com web site.

In the following chapter we will show you the step-by-step installation instructions for different operation systems.

In case you use the DLN series adapters as a part of your product, you can prepare a redistributable package based on DLN drivers and API libraries. The instructions are given in the Redistributable Package section.

Rating: 
Average: 4.7 (79 votes)

Installing DLN Setup Package

DLN setup package works with DLN-series adapters in MS Windows OS. DLN setup package includes the drivers for the DLN adapters and the software to operate with them. DLN setup package also includes libraries, source files, documentation and demo applications.

To install the software for the DLN-series adapters on MS Windows, download and launch the latest DLN setup package from the Downloads section of the www.dlnware.com web site.

If the software has been previously installed, the installation wizard will ask your permission to uninstall it and continue upgrade.

Already installed message

When the installation begins, the “License Agreement” screen will appear.

License Agreement Page

Upon reading the license agreement, in case you agree with the conditions, press the I Agree button to continue the installation.

The “Choose Install Location” screen will be displayed.

Choose Install Location page

After you select the destination folder, click the Next button. You will be asked to choose the desired interface type.

Interface Types page

By default the Server Based Interface is selected and recommended in most cases. By using the Direct Interface you can reach higher bandwidth when you transfer a large amount of data, but it only allows one application at the time communicate with the DLN adapter. For additional information refer to the Interface Types section.

When you click the Next button, you will see the “Choose Components” screen.

Choose Components page

The Core component contains the driver and libraries that are necessary to interface the DLN-series adapters. You can’t unselect it, because it is used by all other parts.

The Binaries section contains the precompiled and ready to use applications.

The Redistributable section contains the drivers and libraries that you may need to build a setup for your DLN-based application.

The Examples section contains source code for demo applications in various programming languages. You can expand this section and choose demos in specific languages. Some of the examples are not available for the Direct Interface mode. For additional information refer to the Interface Types section.

The Documentation section contains this user manual, schematics and API manuals in various programming languages.

Click the Install button to proceed with the installation of the components that you have chosen.

Rating: 
Average: 4.5 (84 votes)

Interface Types

You can either interface the DLN series adapters directly or through the DLN server application. With direct interface you can reach higher bandwidth when you transfer a large amount of data, but it only allows for one at a time application to communicate with the adapter.

At the moment the direct interface is not available for applications that use .Net library; applications that are developed in C#, VB.Net and LabView.
Rating: 
Average: 1.6 (5 votes)

Direct Interface

Through direct interface your application directly communicates with the DLN series adapter. The library and driver help to establish this connection, but don’t route your requests.

Benefits of the direct interface:

The communication is faster than that of the server-based interface. This can be noticeable during the transfer of large amounts of data. In accordance to our measurement, during SPI transfer at high frequencies (above 10 MHz), the bandwidth became twice as fast.

Rating: 
Average: 1 (1 vote)

Server-Based Interface

In server-based interface your application connects to the DLN server by TCP/IP and the server routes your requests to the appropriate adapter.

Benefits of the server-based interface:

  • Several applications can communicate with the same adapter simultaneously.

  • The DLN-series adapter (together with the DLN server) can be connected to a remote PC (even if one is located at another part of the world). All the communication is done through TCP/IP.

  • Single application can manage multiple adapters that are connected to different computers.

Rating: 
No votes yet

Installing DLN Adapter Driver

After the DLN setup package is installed, connect a DLN-series adapter to your PC with a USB cable. Windows will start searching the driver for the DLN adapter. After a short time you should see the message “Device driver software installed successfully” or similar. Now your device is fully installed and ready to use.

DLN device installed message

DLN setup package determines your MS Windows version (x86 and x64) and installs compatible driver.

DLN adapter driver is digitally signed and can be used with any compatible version of MS Windows.

Rating: 
Average: 5 (1 vote)

Software Applications & Demos

DLN-series adapters are supplied with a variety of examples that cover almost every aspect of development. They are not all designed to be impressive when you run them, but their source code is carefully written to show good programming practices.

Software examples source code is included into DLN setup package, which can be downloaded from Downloads page.

This documentation lists complete, ready-to-use code samples and applications that correspond to different DLN-series adapters features. All examples are supplemented with detailed source code description and tips.

We also provide a number of ready to use applications. You can evaluate the DLN-series adapter with these applications or use them during your daily work. Most of these applications are also supplemented with the source code in a variety of programming languages.

See anything missing? Please send an e-mail to support@diolan.com, where we’re collecting suggestions for future DLN code samples, and we’ll do our best to make it available!

To help you quickly find the appropriate example, we divided them into the following categories:

SPI examples

  • SPI master interface examples.

  • SPI slave interface examples.

  • 25 series SPI Flash programming examples.

  • AT45DB series SPI DataFlash programming examples.

I2C examples

  • I2C master interface examples.

  • I2C slave interface examples.

  • 24 series I2C EEPROM programming examples.

GPIO examples

  • Single GPIO pin usage examples.

  • Configuring and using of multiple GPIO pins examples.

Additional interfaces

  • ADC examples.

  • UART examples.

  • PWM examples.

  • Pulse and frequency counter examples.

  • LEDs examples.

Generic examples

Generic examples show how to connect to the DLN series adapter from a variety of programming languages, get device and software version, work with several DLN-series adapters simultaneously.

Rating: 
Average: 2.8 (5 votes)

Supported Programming Languages & Frameworks

Diolan is committed to making all of our technologies equally accessible from different programming languages. It doesn't matter what framework or technology you use. You can easily interface DLN-series adapter in the familiar surrounding.

If you need an example for additional programming language of framework, just send us an email to support@diolan.com. New samples are added frequently so check back often.

C/C++ examples are available for the following frameworks and technologies:

  • Command line C and C++ applications.

  • MFC C++ GUI examples.

  • Cross-platform QT C++ GUI examples.

  • .NET C++/CLI examples.

C# and VB.NET examples are available as Windows Form Applications.

There are LabView Instrument Driver and LabView examples available for all supported interfaces.

Most of the examples can work with all DLN-series adapters. They check if the specific feature is supported by the selected adapter and enables or disables the corresponding controls.

Rating: 
No votes yet

SPI Examples

The SPI (Serial Peripheral Interface) examples demonstrate SPI master and slave modules and events interface incorporated in DLN-series adapters.

spi-master-port-configuration.png

SPI Master Configuration Software

Configures SPI master interface - SPI mode, frequency, slave select pins, SPI data frames size and SPI delays.

spi-master-read-write.png

SPI Master Full-duplex Read/Write Software

Performs synchronous full-duplex SPI transfer.

spi-slave-port-configuration.png

SPI Slave Configuration Software

Configures SPI slave interface - SPI mode, frame size and SPI slave events.

spi-slave-receive.png

SPI Slave Receive Software

You can use "SPI Slave Receive" application to receive data from SPI slave device.

 

Rating: 
Average: 2 (1 vote)

SPI Master Configuration Software

Use "SPI Master Port Configuration" software application to configure the SPI master interface of your DLN-series adapter. You can also configure the SPI master interface by clicking the "Configure" button in SPI Master Read/Write program.

spi-master-port-configuration.png

Software Description

"SPI Master Port Configuration" software application allows you to configure the following SPI Master parameters:

SPI Master Port Enabled
This parameter allows to enable/disable SPI Master port. You should always enable this parameter before operating with SPI master interface. However you can change the states of other SPI Master parameters regardless of the state of current parameter.
CPOL and CPHA

At CPOL=0 the base value of the clock is zero.

  • For CPHA=0, data are captured on the clock's rising edge (low→high transition) and data are propagated on a falling edge (high→low clock transition).
  • For CPHA=1, data are captured on the clock's falling edge and data are propagated on a rising edge.

At CPOL=1 the base value of the clock is one (inversion of CPOL=0).

  • For CPHA=0, data are captured on clock's falling edge and data are propagated on a rising edge.
  • For CPHA=1, data are captured on clock's rising edge and data are propagated on a falling edge.
That is, CPHA=0 means sample on the leading (first) clock edge, while CPHA=1 means sample on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling. Note that with CPHA=0, the data must be stable for a half cycle before the first clock cycle. For all CPOL and CPHA modes, the initial clock value must be stable before the chip select line goes active.
Frequency
This parameter allows to set SPI Master port frequency.
  • DLN-1 USB-SPI Interface Adapter supports SPI clock frequency from 2 kHz up to 4 MHz.
  • DLN-2 USB-SPI Interface Adapter supports SPI clock frequency from 2 kHz up to 18 MHz.
  • DLN-4M and DLN-4S USB-SPI interface adapters are more powerful. They support SPI bus clock frequency up to 48 MHz, but the low frequency bound for them are only 376 kHz.
The Frequency parameter is rounded to the nearest compatible frequency value.
Frame Size
The size of the SPI frame.
Release SS Between Frames
Release the slave select line between successive SPI frames. Only for DLN-4M and DLN-4S adapters.
Delay Between Frames
Delay between successive SPI frames transmission. Only for DLN-4M and DLN-4S adapters.
Delay After SS
Delay after SS line assertion and before start of data transfer. Only for DLN-4M and DLN-4S adapters.
Delay Between SS
Delay after DLN-series adapter releases one SPI slave select line and before it asserts the another SPI slave select line. Only for DLN-4M and DLN-4S adapters.
Slave Select Pins
Slave Select pins to be asserted during the SPI transfer.
Rating: 
Average: 2 (1 vote)

SPI Master Full-duplex Read/Write Software

Use "SPI Master Read Write" software application to write and obtain data through SPI Interface.

spi-master-read-write.png

Software Description

The following application components are available:

Port" Combo-box
Select available SPI Master port. Disabled if only one SPI port is available.
"Configure" Button
Press this button to open SPI Master configuration dialog. Read SPI Master Configuration page for details.
"Open Device" Button
Press this button to open or reopen device. Open Device Dialog Box will appear if several devices are connected to the same computer, so you will me able to select proper device.
Write Data" Hex Field
Type hex data to be sent to SPI Slave device.
Read Data" Hex Field
Read Hex data from the SPI Slave device.
Read/Write" Button
Press this button to execute Read/Write operation.
Note that some application components are disabled until SPI Master port is disabled. Enable SPI Master port at SPI Master Configuration dialog to get access to application components.
Rating: 
Average: 1 (1 vote)

SPI Slave Configuration Software

Use "SPI Slave Port Configuration" software application to configure the SPI slave interface of your DLN-series adapter. You can also configure the SPI slave interface by clicking the "Configure" button in SPI Slave Receive program.

SPI Slave interface is supported only by DLN-4S adapter.

spi-slave-port-configuration_0.png

Software Description

"SPI Slave Port Configuration" software application allows you to configure the following SPI Slave parameters:

SPI slave module enabled
Enable or disable SPI Slave port.
CPOL and CPHA

At CPOL=0 the base value of the clock is zero.

  • For CPHA=0, data are captured on the clock's rising edge (low→high transition) and data are propagated on a falling edge (high→low clock transition).
  • For CPHA=1, data are captured on the clock's falling edge and data are propagated on a rising edge.

At CPOL=1 the base value of the clock is one (inversion of CPOL=0).

  • For CPHA=0, data are captured on clock's falling edge and data are propagated on a rising edge.
  • For CPHA=1, data are captured on clock's rising edge and data are propagated on a falling edge.

That is, CPHA=0 means sample on the leading (first) clock edge, while CPHA=1 means sample on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling. Note that with CPHA=0, the data must be stable for a half cycle before the first clock cycle. For all CPOL and CPHA modes, the initial clock value must be stable before the chip select line goes active.

Frame size
The size of the SPI frame. SPI frame size can be from 6 to 16 bits.
SPI slave events enabled
Enable of disable fixation of the SPI slave events.
SS Rise Event Enabled
Enable or disable fixation of the SS rise events.
Event Buffer Size
The size of event buffer.
Reply Shortage Action
The are 2 parameters available: send zeros or resend last buffer.
Reply Mode
Set the SPI slave reply mode. There are 3 types available: Off, SS based, count based.
Rating: 
Average: 2.5 (2 votes)

SPI Slave Receive Software

You can use "SPI Slave Receive" software to receive data from SPI slave device.

spi-slave-receive.png

Software Description

The following application components are available:

Port" Combo-box
Select available SPI slave port.
"Configure" Button
Press this button to open SPI Slave configuration dialog. Read SPI Slave Configuration page for details.
"Open Device" Button
Press this button to open or reopen device. Open Device Dialog Box will appear if several devices are connected to the same computer, so you will be able to select proper device.
Log Field
The available data and events logs are posted to this field.
Rating: 
Average: 1 (1 vote)

Redistributable Package

If you use DLN adapter with your product, sometimes you will need to redistribute DLN driver and API libraries with your product software. For this case we prepared all required files for you.

When setup package is installed, you can locate all required redistribution files at "..\Program Files\Diolan\DLN\redistributable" folder. These are all required files (DLN driver for x86/x64 versions of Windows and API libraries) you need to use DLN adapter on the any compatible system and computer.

Rating: 
Average: 1 (2 votes)

DLN Adapter Firmware Update

DLN Firmware Update application (fw_update.exe) can be downloaded from the Downloads section of the www.dlnware.com web site.

To update firmware of your DLN-series adapter execute DLN Firmware Update application.

You will see the following window:

DLN adapter firmware update application

If the connected device can not be seen from application, you may need to run device in the bootloader mode. To perform this, unplug DLN adapter from USB, close JP4 jumper on the DLN-2 or JP1 jumper on the DLN-1 and DLN-4M/S adapters. Open jumper. Plug adapter to USB.

Choose firmware version you want to install on the DLN-series adapter.

Press Upload button. After successful firmware update, you will see Firmware upload finished message.

You can check “Automatically upload the most recent firmware to the connected adapters” check-box for your convenience. All connected adapters will be updated to the latest firmware version.
Rating: 
Average: 3 (2 votes)

U2C-12 Compatibility with DLN-2 Adapter

Before we developed the DLN-series USB-I2C adapters, we had a U2C-12 USB-I2C adapter that was used by thousands of our customers.

After U2C-12 adapter was discontinued, we replaced it with the DLN-2 adapter, which has exactly the same form factor. Some of our customers began to use our new API, because it provides more advanced functionality, while other customers didn’t want to change their software.

We put our customers at the center of all we do and we developed the firmware for DLN-2 USB-I2C adapter that is fully compatible with the previous U2C-12 API.

There are two versions of DLN-2 adapters: DLN-2 adapter itself with DLN firmware and DLN-2-U2C adapter with U2C-12 compatible firmware for customers which still use currently obsolete U2C-12 adapter.

DLN-2 and DLN-2-U2C adapters have identical hardware and price. The difference between them is firmware. DLN-2-U2C adapter has U2C-12 compatible firmware, so you can use it as original U2C-12 adapter.

Rating: 
Average: 3 (2 votes)

Identifying Device

To identify which version of DLN-2 adapter (DLN-2 itself or DLN-2-U2C) you have, navigate to Device Manager and look for “Universal Serial Bus controllers” and “Diolan DLN-series Adapters” section.

Device Manager with DLN adapters

Here you will find either DLN-2 Multi Protocol Adapter in the “Diolan DLN-series Adapters” section, if you have DLN-2 Adapter or U2C-12 USB-I2C/SPI/GPIO Interface Adapter in the “Universal Serial Bus controllers” section, if you have DLN-2-U2C adapter version.

If you do not see any of devices in the Device Manager, it may be you did not install proper setup package for your adapter version. Please note, that DLN-2 with DLN firmware uses DLN driver, which can be installed with DLN setup package (please read Installing DLN Setup Package). And DLN-2-U2C adapter use U2C-12 driver from the I2CBridge setup package, which can be downloaded from the Downloads section of the www.dlnware.com web site.

Rating: 
Average: 1 (1 vote)

DLN-2 to DLN-2-U2C Conversion

If you have DLN-2 adapter and want to acquire DLN-2-U2C adapter, firmware can be easily changed.

To upload U2C-12 compatible firmware to DLN-2 adapter, download U2C-12 Compatible Firmware Uploader (dln_2_u2c.exe) from the Downloads section of the www.dlnware.com web site. Plug-in board to USB port, run dln_2_u2c.exe application, choose latest available firmware version and press Upload button to upload firmware to DLN-2 adapter.

U2C-12 Compatible Frmware Uploader application

Now you have fully compatible U2C-12 board which can work with U2C-12 driver and API.

To successfully run dln_2_u2c.exe application, you need both dln.dll and i2cbrdg.dll to be installed in your system, so before you run U2C-12 Compatible Firmware Uploader, also check you have installed DLN and I2CBridge software packages.
Rating: 
Average: 1 (2 votes)

DLN-2-U2C to DLN-2 Conversion

It is possible to perform reverse conversion from DLN-2-U2C to DLN-2 adapter.

In this case, you need to download DLN Firmware Update (fw_update.exe) application from the Downloads section of the www.dlnware.com web site. Then close JP4 jumper on the board, plug-in board to USB, open JP4 jumper and run fw_update.exe. Choose latest available firmware version of DLN-2 adapter and press Upload button.

DLN Firmware Update application

Now you have original DLN-2 adapter which uses DLN driver and software.

In common, you can use DLN Firmware Update application for updating DLN-2 adapter as well as other DLN-series adapters you bought.
Rating: 
Average: 1 (1 vote)

Installation & Using DLN Adapter in Linux

All required files for DLN-series adapters installation and operation in Linux can be found and downloaded from the Downloads section of the www.dlnware.com web site.

Rating: 
Average: 1 (6 votes)

Installing DLN Adapter Software

Rating: 
Average: 1 (4 votes)

Operating with dln_srv in Linux

For server manipulation you can use dln_srv_script, which you can find at linux_setup folder. Make it executable 

sudo cp dln_srv_script /usr/local/bin 
cd /usr/local/bin 
chmod +x dln_srv_script

Now you can use the following commands at terminal to start, stop or restart dln_srv service:

dln_srv_script start
dln_srv_script stop
dln_srv_script restart

 

Rating: 
Average: 2 (1 vote)