Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-8451 DIO output not working

Hello!

 

I am using the USB-8451 OEM, and I am using the C library to control it. So far, I'm able to use SPI without issue, and the DIO inputs are working just fine. I've been trying to configure P0.1 and P0.2 as outputs, but they have not been functional so far. I have tried several things:

  • I have tried the default push-pull and open drain (with a 5k pull-up to 5V). Neither worked, with push-pull staying low and open drain staying pulled-up.
  • I have tried the USB-8451 pins disconnected (except to my multimeter) and connected to my custom board, where P0.1 and P0.2 both turn on a single transistor each, which is a very light load.
  • I have tried setting the voltage level of the device using ni845xSetIoVoltageLevel()
  • I have tried controlling the lines with ni845xDioWritePort() and ni845xDioWriteLine()
  • I have set the entire 8 lines in the port to outputs and tried to control them -- none of them are functional
  • I have tried power cycling (removing USB cable) the USB-8451, but it behaves consistently

Here is simplified pseudo code for what I'm executing:

#include "nu845x.h"

#define PAIR_DIOLINE 0x02 // second DIO line
#define POWER_DIOLINE 0x04 // third DIO line

void main()
{
// Find the only NI device
char pFirstDevice[256];
if (ni845xFindDevice(pFirstDevice, NULL, NULL))
return;

// Open the device
NiHandle handle = 0;
if (ni845xOpen(pFirstDevice, handle))
return;

// Set P0.1 and P0.2 to outputs
uInt8 portMap = 0;
portMap |= (PAIR_DIOLINE & POWER_DIOLINE);

if (ni845xDioSetPortLineDirectionMap(handle, PORT_0, portMap))
return;

// Set our outputs high
uInt8 pWriteData = 0;
pWriteData |= (PAIR_DIOLINE & POWER_DIOLINE);

if (ni845xDioWritePort(handle, PORT_0, pWriteData))
return;
}

 

This problem seems similar to an old, unresolved thread: 

https://forums.ni.com/t5/Digital-I-O/USB-8451-DIO-line-loss-of-control/m-p/1107473/highlight/true?pr...

 

We only have this one USB-8451 board now, but it is new and has only been used for this purpose.

I greatly appreciate any suggestions or help you can provide!

-Matt Riggs

0 Kudos
Message 1 of 3
(3,520 Views)

Was this ever fixed? I have the USB8451 and I cannot get the digital output lines to respond to high/low settings.  I'm using the LabVIEW pallet SPI tools.

0 Kudos
Message 2 of 3
(1,920 Views)

In my case, the LabVIEW pallet VI write digital line doesn't configure the port for output.  Despite being called "write" that has to be done prior to calling the write VI.

0 Kudos
Message 3 of 3
(1,915 Views)