Author Topic: open source GPIB adapter  (Read 28566 times)

0 Members and 2 Guests are viewing this topic.

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
open source GPIB adapter
« on: November 25, 2021, 10:37:19 pm »
I saw the recent thread here on NI adapter authenticity.   I'd been pondering buying something so it was timely.

I also found this old thread here inquiring about about open source adapters.

One of the comments on the thread was "the real cards are GPIB32 and VISa compliant. something none of the homebrews does."

I stumbled on this project which claims to be VISA compliant https://github.com/xyphro/UsbGpib

Has anyone tried it or are there any recommended projects to build since the 2012 thread?  Or is one of the commercial devices (if authentic) still the way to go?  Note I'm asking for a functional opinion not time vs money as that's very subjective.

I like the right angled compact design of the above githib design.
« Last Edit: November 25, 2021, 10:41:36 pm by dorkshoei »
 

Offline Nx-1997

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
Re: open source GPIB adapter
« Reply #1 on: November 25, 2021, 11:43:29 pm »
I have built and successfully tested the xyphro’s UsbGpib adapter. The good news is that it is compatible with all popular vendor visa software, that means that it works with NI Visa, Keysight Visa, and Roden&Schwarz Visa. I personally prefer the R&S Visa as its only 59 MB in size and works perfectly but no python visa support. Only the NI Visa software is supported by the Python’s PyVisa library. The adapter is also very fast in terms of data transfer speed, faster than Keysight 82357B adapter and AR488 adapter.

Now the bad news is that the adapter shows up as a USB device and not as a GPIB device that means compatibility is not as great compared to a traditional GPIB adapter. As in Image 1, if a software does not search for USB devices, then xyphro’s UsbGpib adapter will not be detected as shown in image 2. You would have to include the “USB” search string, shown in image 3, for the software to detect the adapter, as shown in image 4. Also you can only connect 1 instrument per adapter and build costs are higher compared to AR488 adapter.
« Last Edit: November 26, 2021, 08:43:55 am by Nx-1997 »
 
The following users thanked this post: lowimpedance, ch_scr, teddychn

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: open source GPIB adapter
« Reply #2 on: November 25, 2021, 11:46:51 pm »
I have built and successfully tested the xyphro’s UsbGpib adapter. The good news is that it is compatible with all popular vendor visa software, that means that it works with NI Visa, Keysight Visa, and Roden&Schwarz Visa. I personally prefer the R&D Visa as its only 59 MB in size and works perfectly but no python visa support. Only the NI Visa software is supported by the Python’s PyVisa library.
Fortunately that is not true. :phew: Pyvisa also works with PyVISA-Py which is a Python based implementation of a Visa library which prevents you having to install the dreadfull NI Visa software. 
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: Kean

Offline Nx-1997

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
Re: open source GPIB adapter
« Reply #3 on: November 25, 2021, 11:51:51 pm »
Nice, I hasn't aware of this library (https://github.com/pyvisa/pyvisa-py). I will test it out when I get time.
 

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #4 on: November 26, 2021, 12:26:37 am »
Now the bad news is that the adapter shows up as a USB device and not as a GPIB device that means compatibility is not as great compared to a traditional GPIB adapter.
Do any of the open source adapters show up as a GPIB adapter?   Is there an alternative you recommend?
 

Offline Nx-1997

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
Re: open source GPIB adapter
« Reply #5 on: November 26, 2021, 12:42:04 am »
Now the bad news is that the adapter shows up as a USB device and not as a GPIB device that means compatibility is not as great compared to a traditional GPIB adapter.
Do any of the open source adapters show up as a GPIB adapter?   Is there an alternative you recommend?

I personally don't know of any open source GPIB adapters that show up as GPIB devices. Your best bet would be to get a used NI GPIB-USB-HS adapter or a pci/pcie gpib adapter. If you plan on creating your own scripts/software then the xyphro’s UsbGpib adapter will work well.
 

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #6 on: November 26, 2021, 12:54:57 am »
Now the bad news is that the adapter shows up as a USB device and not as a GPIB device that means compatibility is not as great compared to a traditional GPIB adapter.
Do any of the open source adapters show up as a GPIB adapter?   Is there an alternative you recommend?

I personally don't know of any open source GPIB adapters that show up as GPIB devices. Your best bet would be to get a used NI GPIB-USB-HS adapter or a pci/pcie gpib adapter. If you plan on creating your own scripts/software then the xyphro’s UsbGpib adapter will work well.

Thanks.  So what were your build costs?  I thought I saw $14 mentioned on xyphro's github page.    This AR488 setup doesn't seem like it would be that much cheaper.    I also dislike micro-usb, it's not very durable.     I prefer USB-B that xyphro uses.     Also like that he has the case design ready for printing.
 

Offline Nx-1997

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
Re: open source GPIB adapter
« Reply #7 on: November 26, 2021, 01:14:01 am »
For AR488 pro micro adapter:
Arduino pro micro 1pcs - $7 CAD with shipping
Centronics Connectors 5pcs - $13 CAD with shipping
PCB 5pcs (optional) - $16 CAD with shipping

For xyphro’s UsbGpib:
ATMEGA32U4RC-AU-ND 5pcs – $37.65 CAD Digikey
SMD Components - $8 CAD Digikey
Centronics Connectors 5pcs - $13 CAD with shipping
PCB 5pcs - $16 CAD with shipping

Cost in USD will be lower.
Xyphro’s cost of 14$ USD per adapter is probably true.

I got the connectors from here: https://www.aliexpress.com/item/32795413098.html?spm=2114.13010708.0.0.7bff4c4d5RM2NJ
« Last Edit: November 26, 2021, 01:28:26 am by Nx-1997 »
 

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #8 on: November 26, 2021, 01:24:06 am »
Nx-1997  thank you for your help. Much appreciated.

If anyone in US has a spare xyphro PCB they don't want please send me a PM. They are thin enough that they should be shippable taped to a piece of cardboard at the 1oz letter rate.
 

Offline jjoonathan

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: us
Re: open source GPIB adapter
« Reply #9 on: November 26, 2021, 01:53:16 am »
Nice, I hasn't aware of this library (https://github.com/pyvisa/pyvisa-py). I will test it out when I get time.
My setup is GPIB ----AD007---> Ethernet -> pyvisa-py. I've used it for about 10kloc of scripting at this point, and I love it. No NI drivers, no Keysight drivers, no nonsense, just python and jupyter and it just works.

EDIT: and no USB drivers either, and no serial libraries. No Device Manager, no INF files, no udev files, no FTDI drivers. Really.
« Last Edit: November 26, 2021, 02:01:57 am by jjoonathan »
 

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #10 on: November 26, 2021, 03:39:25 pm »
My setup is GPIB ----AD007---> Ethernet -> pyvisa-py.

Are there any open source ethernet designs?  Or are they all USB?   Plenty of cheap SoC's now with Ethernet support.
 
The following users thanked this post: CatalinaWOW

Offline jjoonathan

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: us
Re: open source GPIB adapter
« Reply #11 on: November 26, 2021, 07:45:41 pm »
I don't think so, but I'd love to be wrong about that!
 

Offline giovannirat

  • Regular Contributor
  • *
  • Posts: 107
  • Country: at
 
The following users thanked this post: dorkshoei, jjoonathan

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #13 on: November 30, 2021, 02:49:20 am »

For xyphro’s UsbGpib:
ATMEGA32U4RC-AU-ND 5pcs – $37.65 CAD Digikey

ATMEGA32U4 seems pretty solidly discontinued. Octopart shows 0 in stock at authorized distributors.

Utsource.com who are IME about as reputable as you can get with Chinese chip sellers shows their stock is all "used".  All the third parties on their site claim new which I assume is BS along with theChinese eBay/aliexpress sellers.


 

Offline robert.rozee

  • Frequent Contributor
  • **
  • Posts: 279
  • Country: nz
Re: open source GPIB adapter
« Reply #14 on: November 30, 2021, 04:11:26 am »
ATMEGA32U4 seems pretty solidly discontinued. Octopart shows 0 in stock at authorized distributors.

Utsource.com who are IME about as reputable as you can get with Chinese chip sellers shows their stock is all "used".  All the third parties on their site claim new which I assume is BS along with theChinese eBay/aliexpress sellers.

see:
https://www.microchip.com/en-us/product/ATmega32U4
ATmega32U4
Status: In Production.

the part is, however, mostly out of stock. like a great many devices from a variety of manufacturers, more supplies are not likely to be seen until late 2022.


cheers,
rob   :-)
 

Offline Kean

  • Supporter
  • ****
  • Posts: 2095
  • Country: au
  • Embedded systems & IT consultant
    • Kean Electronics
Re: open source GPIB adapter
« Reply #15 on: November 30, 2021, 12:35:31 pm »
Almost 15k pcs (TQFP) expected to be available for direct purchase in March (I don't put much trust in their stock levels or ETA dates though)
https://www.microchipdirect.com/product/ATMEGA32U4-AUR
 

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #16 on: November 30, 2021, 03:29:48 pm »

For xyphro’s UsbGpib:
ATMEGA32U4RC-AU-ND 5pcs – $37.65 CAD Digikey

ATMEGA32U4 seems pretty solidly discontinued. Octopart shows 0 in stock at authorized distributors.

Utsource.com who are IME about as reputable as you can get with Chinese chip sellers shows their stock is all "used".  All the third parties on their site claim new which I assume is BS along with theChinese eBay/aliexpress sellers.

I'm also pretty sure ATMEGA32U4RC above is not the correct part.     Looking at the data sheet the RC has an internal oscillator and isn't compatible with an external.   The UsbGpib uses an external 16mhz crystal.

You need the ATMEGA32U4-AU which of course is not in stock.    I may get used ones from utsource,  I've had fairly good luck with them before.
 

Offline maxwell3e10

  • Frequent Contributor
  • **
  • Posts: 869
  • Country: us
Re: open source GPIB adapter
« Reply #17 on: November 30, 2021, 04:52:34 pm »
I am wondering if the xyphro's code can be modified slightly to use standard Arduino Pro Micro. A few of the pin assignments need to be changed and the bootloader is different. But otherwise one can just get a complete Arduino board and wire it up to GPIB connector.
« Last Edit: November 30, 2021, 04:54:12 pm by maxwell3e10 »
 

Offline Nx-1997

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
Re: open source GPIB adapter
« Reply #18 on: November 30, 2021, 06:26:24 pm »

For xyphro’s UsbGpib:
ATMEGA32U4RC-AU-ND 5pcs – $37.65 CAD Digikey

ATMEGA32U4 seems pretty solidly discontinued. Octopart shows 0 in stock at authorized distributors.

Utsource.com who are IME about as reputable as you can get with Chinese chip sellers shows their stock is all "used".  All the third parties on their site claim new which I assume is BS along with theChinese eBay/aliexpress sellers.

I'm also pretty sure ATMEGA32U4RC above is not the correct part.     Looking at the data sheet the RC has an internal oscillator and isn't compatible with an external.   The UsbGpib uses an external 16mhz crystal.

You need the ATMEGA32U4-AU which of course is not in stock.    I may get used ones from utsource,  I've had fairly good luck with them before.

The ATMEGA32U4RC and ATMEGA32U4 are the same, only difference is the fuse configuration. I bought the ATMEGA32U4RC because the ATMEGA32U4 was out of stock. You will have to set the fuses anyway when flashing the bootloader.
 

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #19 on: November 30, 2021, 07:24:35 pm »

The ATMEGA32U4RC and ATMEGA32U4 are the same, only difference is the fuse configuration. I bought the ATMEGA32U4RC because the ATMEGA32U4 was out of stock. You will have to set the fuses anyway when flashing the bootloader.

Perhaps I'm just not understanding the datasheet or it's confusingly worded.

6.2.1 Default Clock Source ATmega16U4 and ATmega32U4 The device is shipped with Low Power Crystal Oscillator (8.0MHz-16MHz) enabled and with the fuse CKDIV8 programmed, resulting in 1.0MHz system clock with an 8 MHz crystal. See Table 28-5 on page 348 for an overview of the default Clock Selection Fuse setting.

6.2.2 Default Clock Source ATmega16U4RC and ATmega32U4RC The device is shipped with Calibrated Internal RC oscillator (8.0MHz) enabled and with the fuse CKDIV8 programmed, resulting in 1.0MHz system clock. See Table 28-5 on page 348 for an overview of the default Clock Selection Fuse setting.
 

Offline Venturi962

  • Regular Contributor
  • *
  • Posts: 123
  • Country: us
Re: open source GPIB adapter
« Reply #20 on: November 30, 2021, 08:28:01 pm »
The ATmega32U4RC will work fine, that's what I'm using in the ones I built up.

I did have to slow down the bitclock when flashing the bootloader (note the -B 10 at the end) YMMV:

avrdude -c usbasp -p m32u4 -e -Ulock:w:0x3F:m -Uefuse:w:0xcb:m -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m avrdude -c usbasp -p m32u4 -U flash:w:BootLoader.hex -B 10
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1075
  • Country: gb
Re: open source GPIB adapter
« Reply #21 on: November 30, 2021, 09:13:04 pm »

ATMEGA32U4 seems pretty solidly discontinued. Octopart shows 0 in stock at authorized distributors.

Still plenty in the channel in the form of pro micro arduinos. I've only glanced at xyphro's code, but I think it could be fairly easily modified to work with the pcb I did for the AR488. Probably with a slight loss of speed, as the pinouts are likely to be less optimised for the code.

Of course, that wouldn't give the layout and usb connector you prefer. The best solution to that is probably to 3d-print a case that gives extra support to the micro-usb connector - I think there's one already in the AR488 thread.

As for ethernet versions : yes, that would be great (although USB is quite convenient in providing power). One way to do it would be via an ethernet-equipped pi or Beaglebone linked to a bunch of USB adapters. Direct connection to ethernet would be faster, but most instruments are fairly slow. Also, all the single board computers with ethernet that I know of (beaglebone, arduino, raspberry pi and teensy 4.1) have 3.3V I/O so you'd need to use the proper buffers. This might seem no great disadvantage or even an improvement but a single bus also means you can't run data transfers in parallel as you can with multiple USB ports.
« Last Edit: November 30, 2021, 09:15:25 pm by artag »
 

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #22 on: November 30, 2021, 09:58:51 pm »
Still plenty in the channel in the form of pro micro arduinos.
Indeed. It makes me wonder whether the Chinese "new" stock available for direct purchase is then actually authentic, vs used/remark.   The fact that utsource (who are one of the few honest sellers) has marked all their stock as "used" makes me suspicious of the rest.
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1075
  • Country: gb
Re: open source GPIB adapter
« Reply #23 on: December 05, 2021, 05:59:44 pm »
Quite possibly. However, I've bought chinese ARduino micros recently and they've all worked OK. So even if they're clones or pulls, they do seem to be functional at least IME.
 
The following users thanked this post: Andreas

Offline dorkshoeiTopic starter

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
Re: open source GPIB adapter
« Reply #24 on: December 30, 2021, 03:05:00 am »
I ordered from utsource, they listed two used lots,  each several thousand.     Of course it turns out they had zero.   

I guess I'm waiting till they come back into stock.   I'm in no rush so that's fine.   Spent the last couple of days 3D printing some enclosures for them ;-)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf