Jump to content
  • 0

Partial ulDOutScan with USBDIO32HS


Remi B

Question

Hi,

 

I'm using the C++ API with a USBDIO32HS on Ubuntu.

I can successfully use `ulDOutScan` to output data to a whole port, but I need to do that on a single pin of that port, not the entire port, as I need the other pins as inputs.

 

Is it possible to do a digital out scan to a single pin of a port, while keeping the other pins as inputs or High-Z?

 

Thanks!

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1

The ports use LCX245 octal transceiver chips in between the screw terminals and the FPGA. In mixed direction asynchronous control, I believe it flips the direction back and forth depending if the function is DBitOut or DBitIn. The DOutScan functionality doesn't have this capability. Removing the direction test from the DOutScan driver code is not recommended.

best regards,

John

Link to comment
Share on other sites

  • 0
57 minutes ago, JRys said:

Hello,

The ulDOutScan function writes the whole port, there's no option for updating a single line or group of lines.

Best regards,

John

Is this a hardware or library limitation? I would be very happy if the function still scanned the whole port, but worked even if some pins are configured as inputs (and let them as inputs, without turning them into outputs).

Link to comment
Share on other sites

  • 0

The ulDOutScan is only concerned with moving data from the buffer to the driver memory, which is written out to the hardware. It can write data at rates up to 8Mb/s and can do it continuously - not just for a short burst. For slow IO, you have the ulDBitIn and ulDBitOut functions that can update or read a single line. However, this is asynchronous and much slower. Think on the order of hundreds of writes per second.

Best regards,
John

Link to comment
Share on other sites

  • 0

Hi John,

Sorry, I think I'm expressing myself inaccurately.

I'm using the USBDIO32HS to test a device that has multiple bidirectional IOs. In this specific case, I'm trying to simulate a UART signal out of one of the USBDIO32HS pins, so I'm using the ulDOutScan function at ~100k samples/second, which works perfectly to simulate my signal.

However, the function requires all 16 pins of the port to be configured as outputs, and I'd like the other 15 pins of the port to be inputs / high-impedance, to avoid conflicts with the other signals my device outputs.

Is that possible? I know the library does not allow it, but is this limitation strictly from the library? Or the device itself cannot perform an output scan if some pins are inputs?
In other words, is the library artificially limiting what the device can do, by enforcing that all pins of the port must be outputs, while the hardware doesn't necessarily need them to be?

Edited by Remi B
Link to comment
Share on other sites

  • 0

> You could try setting the 15 don't care lines to input with ulDConfigBit, but it may throw an error when you call ulDOutScan.

Yup, this is exactly what I tried at first and the library threw an error. This is surprising to me, since port bits can be a mix of inputs and outputs for single bit read/writes, so that looks like a library limitation for output scans?

What would happen if that check in the library was to be removed?

https://github.com/mccdaq/uldaq/blob/24ba881e81ceeb24ff924852c7f56dda072d0282/src/DioDevice.cpp#L258

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...