My GPIBUSB rev3 Adapter - Page 1
Forum section: electronics / projects

author: scasagrande
author_rank: Contributor
timestamp: January 15, 2014, 11:25:08 pm
content: Hey everyone! Its been a while since I've done an update on this project, but I finally updated my OSHW USB to GPIB adapter.Back in 2012 I made a post here talking about the old version of my adapter. Just this past weekend I finally completed rev3 which features a few of the suggestions I have gotten over the months. I posted on my websiteheresome of the major changes. I'll copy the main points here:HardwarePull-up resistors have been replaced with the proper GPIB line driver ICs. This should increase the number of devices you can have attached to the bus as well as prevent the bus from powering the adapter when the PC is powered off.Switched from the FTDI FT232RL to the FT230X USB bridge.SoftwareSeveral new commands including +autoread, +reset, and +debug.Watchdog timer fixed, solving the recent issue on newer Linux distros where initial USB enumeration would cause the adapter to lock-up until the reset button was pushed.GPIB handshake timeout tweaksError LED (red) now provides slightly more information. Each boot sequence will now quickly flash the error LED twice. If the LED stays solid red at boot it means that there are no devices powered up on the bus (or not enough of them). If the LED keeps flashing in pairs of two that means it is continuously rebooting. This is normal for approx 30sec after initially plugging the adapter into PCs running Linux distributions such as Ubuntu 13.10.I also uploaded my first video in a long time talking about the changes I put in rev3. WARNING CONTAINS EXTRA RAMBLING. I'll try to get another video up either tomorrow or on Friday showing the adapter in action.In the video I also mention a Python project called InstrumentKit. In order to help abstract the user away from having to deal with adapter-specific commands (eg: setting the target GPIB address, etc) my friend and I started a Python library (InstrumentKit). Here, we took things another step further and abstracted hardware-channel specific instructions away. This part is similar to that of VISA. InstrumentKit allows you to communicate with equipment via Python while maintaining a consistent API across instruments and keeping you away from having to deal with the specifics associated with the physical connection. This means serial, tcpip, nix filelikes (eg /dev/usbtmc0), my adapter, etc are all opened with a single command (or a single line in a YAML config file). Here is a quick example of how I use it to download the waveform from my TDS224:>>> import numpy as np>>> import instruments as ik>>> scope = ik.tektronix.TekTDS224.open_gpibusb('/dev/ttyUSB0', 1)>>> [x, y] = scope.channel.read_waveform()But that's all I'll say about that for now and I'll make another post and video at a later time with more details. You can check out the work-in-progress atits Github page.You can find all the files on mygithub accountand the adapter can be found on my websiteGalvant Industries.

author: scasagrande
author_rank: Contributor
timestamp: January 18, 2014, 03:41:34 pm
content: I uploaded a new video last night that goes over how to use my adapter in two different software environments. First is Ubuntu 13.10 + Python + InstrumentKit and the second is Win7 + Terminite.

author: tridentsx
author_rank: Regular Contributor
timestamp: February 10, 2014, 02:46:11 pm
content: Have you thought about cooperating with the sigrok project? I know they are aiming to introduce gpib support.

author: scasagrande
author_rank: Contributor
timestamp: February 26, 2014, 10:34:19 pm
content: Quote from: tridentsx on February 10, 2014, 02:46:11 pmWhoops, missed your post. I was aware that they had a list of GPIB adapters where they have a link back to my original blog post back when I launched hw rev2 in 2012. Perhaps I will get in contact with them and see if they are interested.

author: scasagrande
author_rank: Contributor
timestamp: March 15, 2014, 09:10:26 pm
content: After many days, I just finished off firmware version 5 for my adapter. This is probably my biggest update yet. A lot of people asked for compatibility with the Prologix commands so that's what I focused on. Here is an overview of the new firmware:- Nearly all Prologix command set support. The adapter should now work with some pre-existing software tools and examples on the internet that were originally intended. Some will require a few changes for baud rate and flow control settings.- Improved termination character handling- SRQ support (but no parallel polling, only serial)- Improved stability- Device mode (first version so there may be fixes in the future)- Most settings can be stored in EEPROM- Basic FIFO buffer for data sent from the PCThe next update will probably focus on optimization. As usual, everything is open source and can be found athttps://www.github.com/Galvant/gpibusb-firmware

author: linux-works
author_rank: Super Contributor
timestamp: March 16, 2014, 02:43:44 pm
content: hi, I bought your adapter about 2 yrs ago on ebay. will this firmware work with that old adapter? (I can't locate that unit; it was packed away during a house move and I have yet to find it so far). I do have it and wondering if it will work with the new release and if so, maybe I'll try harder to locate that unit.cheers/bryan

author: carpelux
author_rank: Regular Contributor
timestamp: March 16, 2014, 04:04:51 pm
content: Thanks for all the effort You make to keep the firmware updated and adding more features!That's very much appreciated!

author: scasagrande
author_rank: Contributor
timestamp: March 17, 2014, 01:51:35 am
content: Quote from: linux-works on March 16, 2014, 02:43:44 pmThat's part of the dream, but the current version will not work with the old hardware revision. Some code had to change because of the GPIB bus driver chips. I'll need to back port all the changes. Thankfully I use git so it won't be *too* bad, but still a pain.Quote from: carpelux on March 16, 2014, 04:04:51 pmI do my best! Thanks for the kind words

author: philpem
author_rank: Frequent Contributor
timestamp: March 17, 2014, 10:34:55 pm
content: The issue you mention with the 30-second wait is most likely down to Ubuntu trying to probe for a modem (!) on the USB port. To make Ubuntu behave, you have to put a file like this in /etc/udev/rules.d/ftdiserial.rules:Code:# stop modem-manager mucking around with FTDI FT232 USB-serial adaptersSUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ENV{ID_MM_DEVICE_IGNORE}="1"That works for the FT232; you may need to change the USB Product ID (idProduct==...) above for other chips (use "lsusb" to get the VID and PID of other USB-serial adapters). Alternatively you can remove the PID entirely and use something like this:Code:# stop modem-manager mucking around with FTDI USB-serial adaptersSUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0403", ENV{ID_MM_DEVICE_IGNORE}="1"... which will disable modem-manager probing for any FTDI USB device.

author: scasagrande
author_rank: Contributor
timestamp: March 17, 2014, 11:03:57 pm
content: I actually ended up figuring out that it was indeed that package, and promptly purged it from my system.