USB to SPI adapters with straightforward API and many easy-to-use applications

Features

Configurable SPI bus frequency 2kHz-48MHz

You can connect adapter to any SPI device and adjust the frequency to reach the maximum throughput. The SPI bus frequency is configured with a single function call.

Configurable SPI mode (clock polarity and phase)

SPI specification defines 4 modes of data transmission. They are composed by combination of clock polarity (CPOL) and clock phase (CPHA) parameters. DLN SPI-USB adapters support all 4 modes.

Half-duplex & full-duplex data transactions

Diolan SPI to USB adapter can transmit data to an external SPI device, from an external SPI device or in both directions simultaneously.

Configurable SPI delays

Some SPI slave devices require additional time to process data. You can configure delays at different data transmission stages to fulfill the slave device requirements:

  • Delay between data frames
  • Delay after slave selection
  • Delay between different slaves selections

There are no SPI delays by default.

SPI slave reselection between data frames

Every SPI transmission starts with selecting the slave device. Some SPI slave devices are able to receive large data packages during a single transaction, while others require slave select line to be reasserted for each byte or word of data (data frame).

You can configure the size of data frame and instruct DLN series adapter to reassert slave select pin between frames.

Configurable frame size 8-16 bits

The DLN adapter transmits the data bit after bit via SPI bus. Logically, your application and an SPI slave device treat this data as an array of 8-bit or 16-bit words within single USB frame. Some SPI slave devices (for example, digital-to-analog or analog-to-digital converters) operate even with 12-bit words.

The ability to set any frame size in the available range allows the DLN adapters to support a wide range of SPI slave devices.

SPI bus voltage 3.3V (5V tolerant)

The SPI bus voltage can be supplied either by DLN USB-SPI adapter, or by your hardware. The DLN adapters can supply 3.3V, but DLN-1 and DLN-2 adapters are 5V tolerant, so you can use them in 5V SPI circuits.

USB bus powered. Provide up to 350 mA of power to your embedded project.

The DLN USB-SPI adapters are powered directly from USB. No external power supplies are required. The USB to SPI adapters can also supply power for your hardware. The amount depends on specific device (see comparison table).

SPI Multi-Master

DLN SPI to USB adapters can share the bus with another SPI master device. This is important for rapid testing and debugging of closed SPI system.

Connect multiple SPI slaves. Up to 5 slave select pins are available

The exact quantity of available SS pins depends on specific adapter (see comparison table).

Additional API for SPI flash interface

It is supported only by DLN-4M and DLN-4S adapters.

ID and serial numbers are accessible from software.

Need to interface separate SPI busses simultaneously? You can connect several USB to SPI adapters to the same PC and interface them from the same software. Every adapter is uniquely identified by serial number, assigned during the manufacturing. You can change the ID number from software to prepare similar fixtures with multiple adapters in each fixture.

Asynchronous and event driven SPI slave interface

DLN-4S adapter provide event-driven interface for SPI slave devices. The events are generated when the SPI slave meets the certain predefined conditions. You can preconfigure the SPI adapter to send events after transaction. Polling, that wastes computer resources and bus bandwidth, is not required.

Upgrades are free and can be easily applied.

We are constantly working to add new features to our USB-SPI adapters. The upgrade can be applied without disconnecting the USB-SPI adapter from PC. You can use our firmware update utility (open source) or integrate upgrade into your setup.

Free software (downloadable from website)

The USB to SPI adapters come with a set of easy to use software applications. For SPI interface we provide the following programs:

Configures the SPI master interface, writes and reads data over the SPI bus.

Configures the SPI slave interface, receives data from SPI master device, and logs it.

Logs asynchronous SPI slave transactions as well as events from other interfaces (e.g. digital and analog input pins, pulse and frequency counters, etc.)

Allows configuring the SPI master device and sending SPI transactions from command line or batch file script. Especially useful if you need to combine several I2C transactions as a set.

These applications are free and open source code. You can use them as a starting point for your own software development.

Open Source Examples & Demos

After installing our setup package you’ll get access to dozens open source demos in different programming languages, varying from the simplest to the most advanced.

If you need additional demo or instructions on how to interface DLN USB to SPI adapters from your favorite programming language just contact us. Our engineers and support team will be happy to assist you.

API and Programming

With just a few lines of code you can interface SPI bus from computer.

#include "..\..\..\common\dln_generic.h"
#include "..\..\..\common\dln_spi_master.h"
#pragma comment(lib, "..\\..\\..\\bin\\dln.lib")

int main()
{
	// Open device
	HDLN device;
	DlnOpenUsbDevice(&device);

	// Set SPI frequency
	uint32_t frequency;
	DlnSpiMasterSetFrequency(device, 0, 100000, &frequency);

	// Enable SPI master
	uint16_t conflict;
	DlnSpiMasterEnable(device, 0, &conflict);

	// Prepare output buffer
	uint8_t input[10], output[10];
	for (int i = 0; i < 10; i++) output[i] = i;

	// Perform SPI transaction
	DlnSpiMasterReadWrite(device, 0, 10, output, input);

	// Print received data
	for (int i = 0; i < 10; i++) printf("%02x ", input[i]);

	// Disable SPI and close device
	DlnSpiMasterDisable(device, 0, 0);
	DlnCloseHandle(device);

	return 0;
}
            

LabVIEW SPI Library and Examples

Labview apps

The LabVIEW package for USB to SPI adapters includes:

  • LabVIEW Instrument Driver
  • LabVIEW SPI master and slave components
  • LabVIEW examples for SPI master and SPI slave interfaces
  • Documentation

You can easily integrate the LabVIEW SPI driver components into any application.

All software examples are free and open source.

read more

Which SPI adapter is right for your application?

Diolan offers many adapters for USB to SPI interface. Below we list the most popular. They differ by form factor, supported frequencies and features. However, they all share the same API and can be easily interchangeable. You would not need to modify your software if you decide to switch to another adapter in the future.

SPI to USB Adapter DLN-4M

The DLN-4M adapter is available in two variations: with enclosure (DLN-4ME) or without enclosure (DLN-4M). It has most of the functionality you need to start interfacing your SPI slave device.

DLN-4M has highest SPI bus frequency parameters (up to 48Mhz) and high speed USB interface (480Mhz). Also you can configure additional SPI delays if your SPI slave device requres such.

The DLN-4ME adapter comes in handy plastic enclosure with rubber sides. Two pin headers are hidden inside the enclosure, so the number of accessible input/output lines are limited to 26 (the 26 pin D-SUB connector). SPI bus, as well as other most popular interfaces (I2C, GPIO, ADC, pulse and frequency counters) are present at this connector. You can easily make an elegant cable (or we can do it for you) to connect DLN-4ME adapter to your hardware. We sell the mating connectors and hoods for it.


USB-I2C/SPI/GPIO Adapter DLN-2

The most popular adapter is DLN-2. This is a middle-price product smd it has all required functionality to start interfacing your SPI slave device.

The SPI lines are available on 2 connectors:

  • The dedicated 2x10 pin header SPI connector outputs MISO, MOSI, SCK and SS lines.
  • If you need additional signals (I2C, ADC, PWM, GPIO, etc.), you can connect the standard flat cable to 2x40 pin header.

DLN-2 supports SPI bus frequency up to 18Mhz and USB interface up to 12Mhz. SPI bus voltage can be used with 3.3V, but SPI pins are 5V tolerant.

$98.40

USB to SPI Slave Adapter DLN-4SE

The DLN-4S USB-SPI adapter is based on the same hardware as DLN-4M, but it adds support for SPI slave interface (you can use it with your SPI master device).

The SPI slave interface is asynchronous. You load the data (if you need to send data to the I2C master device); all the remaining work is done by the USB to SPI adapter. It waits for SPI master device to initiate the data transfer. After transaction is finished, your software receives event with data sent by the SPI master.

Additionally you can configure event buffer size, SPI mode, frame size, reply shortage action and mode.

DLN-4S adapter is also available in two variations – with or without plastic enclosure.


DLN-1 PC-I2C/SPI/GPIO Interface Adapter

Our customers use the DLN-1 adapter as a part of their device. This adapter is very small, only 50x40mm.

It’s connectors are not populated, so they can be soldered in a variety of ways. You can also solder the wires directly to the adapter and get the reliable permanent connection.

The functionality of DLN-1 adapter is mostly similar to DLN-2 adapter. The SPI frequency can be set only up to 4Mhz.

$63.20

Comparison Chart
USB-SPI Adapter
DLN-1

DLN-2

DLN-4M

DLN-4S
All 4 SPI Modes Support Yes Yes Yes Yes
SPI Interface Clock Frequency 2 kHz - 4 MHz 2 kHz - 18 MHz 376 kHz - 48 MHz 376 kHz - 48 MHz
Frame Size YesConfigurable (8-bit to 16-bit) YesConfigurable (8-bit to 16-bit) YesConfigurable (8-bit to 16-bit) YesConfigurable (8-bit to 16-bit)
Configurable SPI delays
(no delays by default)
No No Yes Yes
SPI Bus Voltage 3.3V (5V tolerant) 3.3V (5V tolerant) 3.3V 3.3V
USB Interface Full Speed (12MHz) Full Speed (12MHz) High Speed (480MHz) High Speed (480MHz)
SPI Master Interface Yes Yes Yes Yes
SPI Slave Interface No No No Yes
SPI Flash Interface No No Yes Yes
Additional Interfaces
  • I2C master (400kHz)
  • 32 digital I/O
  • 4 analog inputs
  • 1 PWM output
  • 1 Pulse counter
  • I2C master (1MHz)
  • 32 digital I/O
  • 8 analog inputs
  • 2 PWM outputs
  • 2 pulse counters
  • I2C master (1MHz)
  • UART interface
  • 48 digital I/O
  • 8 analog inputs
  • 3 PWM outputs
  • 3 pulse counters
  • I2C master (1MHz)
  • I2C slave
  • UART interface
  • 48 digital I/O
  • 8 analog inputs
  • 3 PWM outputs
  • 3 pulse counters

Additional Interfaces

In addition to SPI interface, DLN series adapters also support:

  • I2C master and slave interfaces
  • GPIO (General Purpose Inputs and Outputs)
  • ADC (analog to digital converter)
  • Pulse and frequency counters
  • PWM (pulse-width modulation)
  • UART

We have many customers that used our adapters to interface SPI device in one project, appreciated how easy it is. Later they used the same adapters in other projects that required additional interfaces.

Embed USB-SPI bridge in your hardware

All DLN series USB to SPI adapters are also available as system-on-chip.

You can significantly reduce your solution cost by embedding chips with our firmware in your hardware.

Our engineers will be happy to assist you during the integration. This way you will get the low cost solution that is fully compatible with Diolan adapters and can be used with the same software and API.

Try USB to SPI Adapters with No Obligation

Test Drive is a unique program offered by Diolan to assist you in evaluating and selecting the best interface adapter for your task. You will have 45-days risk free experience.

If the adapter does not satisfy your requirements, you can either return it back or exchange it to another adapter. The difference in price will be refunded.

Contact Us

Have additional question or can’t find the required information? Contact us by using the form below:

* Required Fields

How to Order

Order Online

Products can be purchased directly from our web site. The payment is safe. We don't collect credit card numbers. We even don't know them. All the payments are processed securely by PayPal.

Request a Quotation

To request a quotation add items to your shopping cart. From shopping cart you can click the link "Request a Quotation", specify your shipping address and we will send you the formal quotation.