Author Topic: My GPIBUSB rev3 Adapter  (Read 6665 times)

0 Members and 1 Guest are viewing this topic.

Offline scasagrandeTopic starter

  • Contributor
  • Posts: 45
  • Country: ca
    • My Blog
My GPIBUSB rev3 Adapter
« on: January 15, 2014, 11:25:08 pm »
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 website here some of the major changes. I'll copy the main points here:

Hardware
  • Pull-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.

Software
  • Several 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 tweaks
  • Error 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[0].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 at its Github page.


You can find all the files on my github account and the adapter can be found on my website Galvant Industries.
 

Offline scasagrandeTopic starter

  • Contributor
  • Posts: 45
  • Country: ca
    • My Blog
Re: My GPIBUSB rev3 Adapter
« Reply #1 on: January 18, 2014, 03:41:34 pm »
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.

 

Offline tridentsx

  • Regular Contributor
  • *
  • Posts: 97
  • Country: us
Re: My GPIBUSB rev3 Adapter
« Reply #2 on: February 10, 2014, 02:46:11 pm »

Have you thought about cooperating with the sigrok project? I know they are aiming to introduce gpib support.
 

Offline scasagrandeTopic starter

  • Contributor
  • Posts: 45
  • Country: ca
    • My Blog
Re: My GPIBUSB rev3 Adapter
« Reply #3 on: February 26, 2014, 10:34:19 pm »

Have you thought about cooperating with the sigrok project? I know they are aiming to introduce gpib support.

Whoops, 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.
 

Offline scasagrandeTopic starter

  • Contributor
  • Posts: 45
  • Country: ca
    • My Blog
Re: My GPIBUSB rev3 Adapter
« Reply #4 on: March 15, 2014, 09:10:26 pm »
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 PC

The next update will probably focus on optimization. As usual, everything is open source and can be found at https://www.github.com/Galvant/gpibusb-firmware
 

Offline linux-works

  • Super Contributor
  • ***
  • Posts: 1999
  • Country: us
    • netstuff
Re: My GPIBUSB rev3 Adapter
« Reply #5 on: March 16, 2014, 02:43:44 pm »
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

Offline carpelux

  • Regular Contributor
  • *
  • Posts: 68
  • Country: se
Re: My GPIBUSB rev3 Adapter
« Reply #6 on: March 16, 2014, 04:04:51 pm »
Thanks for all the effort You make to keep the firmware updated and adding more features!

That's very much appreciated!
---------------------------------------
Catch the light
 

Offline scasagrandeTopic starter

  • Contributor
  • Posts: 45
  • Country: ca
    • My Blog
Re: My GPIBUSB rev3 Adapter
« Reply #7 on: March 17, 2014, 01:51:35 am »
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

That'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.

Thanks for all the effort You make to keep the firmware updated and adding more features!

That's very much appreciated!

I do my best! Thanks for the kind words :D
 

Offline philpem

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
  • That Sneaky British Bloke
Re: My GPIBUSB rev3 Adapter
« Reply #8 on: March 17, 2014, 10:34:55 pm »
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: [Select]
# stop modem-manager mucking around with FTDI FT232 USB-serial adapters
SUBSYSTEM=="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: [Select]
# stop modem-manager mucking around with FTDI USB-serial adapters
SUBSYSTEM=="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.
Phil / M0OFX -- Electronics/Software Engineer
"Why do I have a room full of test gear? Why, it saves on the heating bill!"
 

Offline scasagrandeTopic starter

  • Contributor
  • Posts: 45
  • Country: ca
    • My Blog
Re: My GPIBUSB rev3 Adapter
« Reply #9 on: March 17, 2014, 11:03:57 pm »
I actually ended up figuring out that it was indeed that package, and promptly purged it from my system.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf