Streaming 16 Bit Transfers Using the NI USB-8451

Updated Apr 25, 2024

Reported In

Hardware

  • USB-8451

Issue Details

I have a National Instruments USB-8451 I2C/SPI device and need to perform streaming for 16 bit transfers. Is this possible?  Does the 8451 device support the SPI Stream API?

Solution

The USB-8451 only supports 8 bit transfers. The best way to write a 16-bit number is to split it into two 8-bit numbers and write them back-to-back. There will be a small delay (approximately 10-20 us) between the 2 bytes. This is a small delay, however, and is typically not a limiting factor in your program.

The best way to do this is to write or read a byte array of length 2. The first and second byte will be written/read sequentially. The "Atmel AT25080A Write" example, for instance, writes a 16-bit Data Address by using the "Split Number" function to break the 16-bit number into two bytes. Those bytes are then fed into an array.
 

Please note that this is a hardware limitation and that writing or reading 16 bit numbers in the method above will affect the performance of streaming programs, slowing them down.

The USB-8451 does not support the SPI Stream API.  This is a hardware limitation of the USB-8451.  If you need to use the SPI Stream API you can use the USB-8452. The 8452 does support the SPI Stream API.