11 ms·
Nubsio GPIO API – A Windows USB interface for controlling external devices
- keithnz 10y agoI don't get it, why is this even high up on HN? There's a ton of similar products, many which do a lot more than this that can be controlled using .net
- nitrogen 10y agoLink to some of them maybe? --- Edit: some I have used or heard of that may or may not have .net support: USB Bit Whacker - http://www.schmalzhaus.com/UBW/ http://www.schmalzhaus.com/UBW/ Ultimarc control interfaces (haven't tried them) - http://www.ultimarc.com/ http://www.ultimarc.com/
- keithnz 10y agoheh, just did :)
- shawnz 10y agoYou could use a raspberry pi with Windows 10 IoT core.
- JoachimSchipper 10y agoThis was downvoted quite a bit when I came across it, but can someone explain why it's so bad? Sometimes you do want to add GPIO to an existing Windows machine, but if you just want to mess around with .Net and some simple electronics, the parent's suggestion is cheap and simple (and e.g. https://github.com/raspberry-sharp/raspberry-sharp-io https://github.com/raspberry-sharp/raspberry-sharp-io claims to support this use case.)
- Nexxxeh 10y agoOnly the Pi 3 (and CM3, CM3L presumably) are supported iirc.
- bbarn 10y agohttp://www.phidgets.com/products.php?category=0 http://www.phidgets.com/products.php?category=0 Used these for some simple automation needs in the past. Simple .net library available on the site. Not nearly as cheap as the one in the post (which I did have to google 3 different sites to find the price of)
- tyingq 10y agoAn FTDI FT232H is popular in this space as well. You can get one already on a breakout board for $15. https://www.digikey.com/products/en?mpart=2264&v=1528 https://www.digikey.com/products/en?mpart=2264&v=1528 Tutorials, etc, here: https://learn.adafruit.com/adafruit-ft232h-breakout https://learn.adafruit.com/adafruit-ft232h-breakout Includes some python code that works on Windows, Linux, etc.
- fredericaltorre 10y agoAdafruit does not support .NET on Windows.
- tyingq 10y agoAdafruit just put the chip on a breakout board. There's .net support for it. A couple of sources: http://www.ftdichip.com/Support/SoftwareExamples/MPSSE/FTCSPI.htm http://www.ftdichip.com/Support/SoftwareExamples/MPSSE/FTCSP... https://github.com/zhelnio/MPSSELight https://github.com/zhelnio/MPSSELight
- madeintheusb 10y agoYou are right there is .NET support, I used it the SPI library. I think there one library for I2C and one for SPI. I settled on the FTDI ft4222 which is somehow easier to program and can only do SPI and I2C (no IO, no UART). The FT232H could be faster in SPI.
- keithnz 10y agoI make a lot of use of these for production control and testing systems from .net - http://www.mccdaq.com/ http://www.mccdaq.com/
- madeintheusb 10y agoI did find some device that can do DAC/ADC or IO for $99. I did not find one that can also do SPI and I2C. one the web site, could give a link to a device like Nusbio from the web site http://www.mccdaq.com/ http://www.mccdaq.com/
- kenz0r 10y agoSerial interface, and GPIO reads are polled. Its a good first or second year uni project, but its not a product.
- rattray 10y agoSorry, just a curious passerby - why are those things bad?
- jjcc 10y agoPolling usually is not considered to be a real time method. To reduce latency it will consume unnecessary CPU cycle, I think
- 8note 10y agofor the operating systems version of real time, i'd consider it polling to be real time. you ensure that part of your code will always take the same amount of time.
- Matthias247 10y agoit actually is, as long as your polling interval is deterministic and meets the requirements of your target application (polling interval < state change interval). If you look at real hardware (or FPGAs) they will basically do polling: The input gets sampled at each clock cycle and will then get processed. And hardware is definitely realtime :) The downside of polling is that you burn CPU resources when actually nothing happens. Interrupt driven designs help there.
- sokoloff 10y ago> If you look at real hardware (or FPGAs) they will basically do polling: The input gets sampled at each clock cycle and will then get processed. And hardware is definitely realtime :) Smiley noted; I think we can agree that "polling at 10s of MHz on an input pin" becomes something quite different than "polling at 10s of kHz on the other side of a USB link".
- NinoScript 10y agoPlease change the default direction to input (high-z). You could potentially fry some sensor or make a short circuit if they start in output before the code changes them to input.
- Animats 10y agoAgreed. Power up sequencing on dumb low-level interfaces has to be thought through carefully. You may turn on something you don't want to turn on. I have a device which controls an antique Teletype machine from a USB port. It uses the request to send signal on a USB-simulated serial port to start the Teletype motor. This works fine on Linux. On Windows, the motor starts and stops several times when the USB device is plugged in or Windows starts up. That's because an old Windows feature is probing the serial port for a serial mouse. Annoying.
- fest 10y agoIt's even more annoying when Windows does succeed interpreting data coming from device and cursor starts moving around and clicking randomly.
- jacquesm 10y agoBetter yet: provide a 'output state valid' bit that is held low as long as some magic hasn't happened. Even an output configured as an input could cause that output to drift into 'undefined' territory. An output state valid bit can be used to suppress all activation of external actuators until the software has been initialized and the state of the outputs can be safely exposed.
- ngcc_hk 10y agowonder (i) anything for mac and xcode based trial and (ii) any programmer suggested. all just for hobby and my attempt to understand. have beadboard exprience and follow a course that use windows xp and M3 and a propeiority tool from TI.
- sigmaprimus 10y agoWhat makes this anything more than an arduino in a box? http://playground.arduino.cc/Interfacing/Csharp http://playground.arduino.cc/Interfacing/Csharp
- deleted 10y ago[deleted]
- mbanzi 10y agoDepends on the protocol they use on the USB connection. Serial over USB has its quirks. Using a Leonardo, a Due or a SAMD21 based Arduino allows you to implement something like HID which should give you better latency
- madeintheusb 10y agoYou are right though I do think HID is limited to 64 Kbytes/S. But an SAMD21 or 32U4 could allow me to build a cheaper product. I have to think about it now. What I am currently achieving is - 100Kbytes/S in I2C with a 10Mhz I2C EEPROM and - 2.4 Mbytes/S in SPI with a NOR FLASH at 103Mhz using the FTDI FT4222 and the FT232H should the same or better.
- eggy 10y agowhat makes Arduino anything more than an open source Basic Stamp? I was using Basic Stamps a decade before Arduino came along. It's about choice.
- sigmaprimus 10y agoI would think the fact that it is open source as you mentioned is the reason. My question was not meant to criticize just wondering if I missed something that makes these boards a better choice for an application I'm working on. I looked into basic stamp years ago also but the cost of them and my lack of funds at that time forced me to go down the PIC road instead.
- madeintheusb 10y ago
- kodfodrasz 10y agoIt is not clear to me if this is a product anouncement, or a blog article about something you made using a product. If the former, then why should anyone choose this over Netduino? If the latter: why have you chosen this product? edit: by browsing the page I saw it is the former.
- molticrystal 10y agoI think it would be more interesting to take ports found on many computers that aren't being used and turn them into GPIO. There are Ethernet to Serial adapters [1] [2], I wonder if it could go further. There is also dvi, hdmi, displayport with lots of wires and a chip behind them. Displayport even has " A bi-directional, half-duplex auxiliary channel" [3] , though I'd want to look at the spec to see how that could be used, or if it could be contorted to a GPIO purpose. [1] https://en.wikipedia.org/wiki/PHY_%28chip%29 https://en.wikipedia.org/wiki/PHY_%28chip%29 [2] https://electronics.stackexchange.com/questions/24588/is-there-any-way-to-send-serial-data-over-physical-ethernet-layer-with-no-encaps https://electronics.stackexchange.com/questions/24588/is-the... [3] https://en.wikipedia.org/wiki/DisplayPort https://en.wikipedia.org/wiki/DisplayPort
- Animats 10y agoThere's tons of those things. Adafruit has one.[1] They're useful, but if you're doing something with critical timing, you usually don't want a Windows machine on the other end. [1] https://www.adafruit.com/product/2264 https://www.adafruit.com/product/2264
- pjmlp 10y agoOr UNIX for that matter, both don't play on the same league as high integrity OS, if that is what you mean. http://www.ghs.com/products/rtos/integrity.html http://www.ghs.com/products/rtos/integrity.html
- madeintheusb 10y agoI would not say: There's tons of those things. But the FT232H breakout from Adafruit is great and the cheapest. But they do not offer .NET support on Windows and FTDI does not either. Here is one of my experiment with Adafruit FT232H breakout in C. https://twitter.com/MadeInTheUSB/status/848799047632773120 https://twitter.com/MadeInTheUSB/status/848799047632773120
- dheera 10y agoHow is this better than an Arduino and just serial communication, which all of these languages support?
- mbanzi 10y agoCheck out https://microsoft.hackster.io/en-US/windowsiot/basic-windows-remote-arduino-47eeb9 https://microsoft.hackster.io/en-US/windowsiot/basic-windows... from microsoft. As I wrote in another comment Serial over USB is not great if you want to contain latency. Something like HID or a custom protocol using the Leonardo or the Zero would give you much better results
- yitchelle 10y agoUsing a i7 with Win10 just to get the blink LEDs application going is a bit over the top :-) Joking aside, having one of these for a kid to play with is a good way to introduce them to world of controls. They are some areas to work through (polled inputs, default pin configuration etc) but it is a good start. Hoping that v2.0 will be more bespoked.
- madeintheusb 10y agoI designed Nusbio 1 to be cheap and a first USB device for .NET developers with little knowledge in electricity to start playing with IO, I2C, SPI, ADC directly from Windows and .NET languages. It has some limitations in terms of IO default state, IO polling or speed of transfer (I2C:15Kbyte/S, SPI:15KBytes/S To 28KBytes/S). Samples in C#, VB.NET or Powershell codes are available on github. Regarding the IO polling issue, I do not think this can be address with a Windows PC or Linux on the Raspberry PI. I tested the USB interrupt for the FTDI FT4222 and this is not very impressive. Nusbio v2 coming sometime this year will address some of these issues, IO default state as input, increase in speed transfer (I2C:Up to 128Kbyte/S, SPI:Up to 2.4 Mbyte/S), 10 bit ADC. But unfortunately will be more expensive. Therefore not a device for beginner or small project. see https://twitter.com/MadeInTheUSB/status/848013033335029761 https://twitter.com/MadeInTheUSB/status/848013033335029761
- LeifCarrotson 10y agoFirst, love your username. And it's impressive to get this level of a product together! > Regarding the IO polling issue, I do not think this can be address with a Windows PC or Linux on the Raspberry PI. I tested the USB interrupt for the FTDI FT4222 and this is not very impressive. Yeah, that's not the right approach. As a controls engineer who builds PC-based test and manufacturing equipment, this is your competition: http://www.ni.com/pdf/manuals/374369a.pdf http://www.ni.com/pdf/manuals/374369a.pdf http://www.ni.com/pdf/manuals/374566d.pdf http://www.ni.com/pdf/manuals/374566d.pdf These can be programmed with .NET languages and C/C++ using Measurement Studio, or graphically through LabView. I think the critical differences are (1) using USB directly, rather than a serial emulator, enabling much higher data rates - you don't necessarily need this yet, low-speed is probably fine and (2) using internal FIFOs and Tasks to control IO instead of handling each bit over the connection. Essentially, what you want to do is push all the real-time stuff off to the microcontroller on the peripheral, and only synchronize every couple hundred milliseconds with the PC, which will essentially take in a large buffer with the history of the inputs at 1 kHz or more, and output a similarly sized buffer with the data to be encoded on the outputs until the next synchronization. Anything that needs to happen faster than that needs to be set up before hand.
- jacquesm 10y agoI would caution against trying to drive anything serious from an IO solution whose inputs are not interrupt driven. Please use a real time operating system for jobs like these and communicate with your windows box on a higher abstraction level than directly driving outputs. If you don't do that you risk your machinery not responding to critical inputs resulting in machine damage or worse. If all you want to do is play around with lights and switches then this is fine.
- nimish 10y agoWhy not just use https://developer.microsoft.com/en-us/windows/iot/docs/wra https://developer.microsoft.com/en-us/windows/iot/docs/wra ?