Difference between revisions of "Gpibgrok"

From sigrok
Jump to navigation Jump to search
(29 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{lowercase}}
This page documents some ideas and information for a GPIB-USBTMC hardware interface.
This page documents some ideas and information for a GPIB-USBTMC hardware interface.


== Motivation ==
== Motivation ==


There are many ways to communicate with devices that have a GPIB port, and sigrok aims to support as many of them as possible (see [[IEEE-488]]). However in this day and age the only reasonable interface for this would have to use a USB device port, since USB host ports are so ubiquitous. The USB standards include a device class specifically made for test and measurement, called the [http://www.usb.org/developers/devclass_docs/USBTMC_1_006a.zip USBTMC] class.
There are many ways to communicate with devices that have a GPIB port, and sigrok aims to support as many of them as possible (see [[IEEE-488]]). However in this day and age the only reasonable interface for this would have to use a USB device port, since USB host ports are so ubiquitous. The USB standards include a device class specifically made for test and measurement, called the [http://www.usb.org/developers/docs/devclass_docs/USBTMC_1_006a.zip USBTMC] class.


Yet most of the GPIB-USB interfaces available don't use this device class; they typically use either a proprietary protocol or serial emulation. There is only one GPIB-USBTMC interface that we know of: the [http://www.tek.com/datasheet/gpib-usb-adapter TEK-USB-444] from Tektronix, and it's ridiculously overpriced at around $740.
Yet most of the GPIB-USB interfaces available don't use this device class; they typically use either a proprietary protocol or serial emulation. There is only one GPIB-USBTMC interface that we know of: the [http://www.tek.com/datasheet/gpib-usb-adapter TEK-USB-444] from Tektronix, and it's ridiculously overpriced at around $740.
Line 16: Line 17:
== Hardware design ==
== Hardware design ==


* Using an ARM Cortex-M3 microcontroller would get us:
* STM32L0  ARM Cortex M0
** Built-in USB
** Built-in FS USB with crystaless operation
** Plenty of horsepower to handle the throughput a GPIB device will reasonably need
** Compatible with libopencm3
** Many different implementations to choose from, and many inexpensive development boards
** 32 pin LQFP keeps size low and assembly easy
** Can start with an existing development board + GPIB connector
* Specialty Trancievers
* Voltage levels on GPIB pins is "negative logic with standard TTL levels": true <= 0.8V, false >= 2.0V. (''to be verified'')
** TI still makes the SN75160 (data) and SN75161 (handshake)
** High current drive required for logic lines according to GPIB standard
** Directional bundling of pins based on protocol simplfies firmware
* 2 Layer PCB to keep cost low
* Designed to fit in L-COM housing for CIB24S GPIB connector
** Saves effort on custom enclosure
* Current design hosted at [https://upverter.com/lieser/def8f424a80b0d5a/gpibgrok/ Upverter]


== Software ==
== Firmware ==


Due to the long history of the IEEE-488 and SCPI standards, there are many devices out there supporting some earlier version of the protocol, and these will typically support commands that are vendor-specific, and syntax that is not compliant IEEE-488. Therefore supporting various device-specific or vendor-specific "quirks" will likely be a big part of real-world use-cases.
This is more of a TODO list at the moment:
* Start with libopencm3
** Add new class for USB TMC
* GPIB
** Implement functions
*** Serial poll
*** Write
*** Read
*** Reset
*** Local lockout
** Monitor and handle SRQs
* Commands
** All data is just passed thru from PC to GPIB device and back, parsing of SCPI or other protocols is not required in firmware
* Firmware update
** Use the DFU bootloader in libopencm3
** Modify to check register for boot flag instead of hardware pin
** Some special command in USB TMC can set to bootloader mode and reset processor, then when DFU is done, set flag back and boot to main


== Components ==
== Components ==
Line 31: Line 54:
=== GPIB connectors ===
=== GPIB connectors ===


* Right-angle PCB mounted male connector [http://www.digikey.com/product-detail/en/112-024-113R001/1024RMA-ND/955155 at Digikey]
* Right-angle, PCB mounted, male:
** Norcomp 112-024-113R001: [http://octopart.com/partsearch#search/requestData&q=Norcomp+112-024-113R001 about $5.5]; [http://de.mouser.com/ProductDetail/NorComp/112-024-113R001/?qs=IGgAdOvCTsSdej4q2f%2fo5Q%3d%3d Mouser] (2.80&euro;, but not available ATM), [http://www.digikey.de/product-search/de?x=0&y=0&lang=de&site=de&KeyWords=112-024-113R001 Digikey] (4.59&euro;)
** TE Connectivity 5552741-1: [http://octopart.com/partsearch#search/requestData&q=TE%20Connectivity%205552741-1 about $7.2]; [http://de.mouser.com/ProductDetail/TE-Connectivity-AMP/5552741-1/?qs=ZDXmSm13592KDB5YbnOqGQEXH8vBFTre66B%2ffSd9ajU%3d Mouser] (5.87&euro;, but not available, and minimum quantity required), [http://www.digikey.de/scripts/dksearch/dksus.dll?vendor=0&keywords=5552741-1 Digikey] (7.50&euro;)
* Straight (no right-angle), PCB mounted, male:
** [http://www.te.com/catalog/pn/en/552283-1 TE Connectivity / AMP 552283-1]: [http://de.mouser.com/ProductDetail/TE-Connectivity-AMP/552283-1/?qs=L%252bK8JgcrFouKshZpXbu%2foxXjsnB6QVdhWc5JSE3CA%2fU%3d Mouser] (4.08&euro;), [http://www.digikey.de/scripts/dksearch/dksus.dll?vendor=0&keywords=552283-1 Digikey] (4.51&euro;, but EOL soon? Minimum quantity?)
* Straight (no right-angle), solder-cup, male:
** [http://www.norcomp.net/rohspdfs/SCSI-050Ribbon/11Y/111/111-YYY-103L001.pdf Norcomp 111-024-103L001]: [http://www.digikey.de/product-detail/de/111-024-103L001/1024MA-ND/955139 Digikey] (2.90&euro;)
** [http://www.amphenolcanada.com/ProductSearch/drawings/AC/5720240.pdf Amphenol 57-20240]: [http://de.mouser.com/ProductDetail/Amphenol-Commercial-Products/57-20240/?qs=9QC6KritiMlxI%2fbOR6fN8o%2fx9VH%2fvGRssdGjBll89tQ%3d Mouser] (4.93&euro;) TODO: Typo on page/datasheet, or is this really female?
* Straight (no right-angle), solder, male:
** [http://www.norcomp.net/rohspdfs/SCSI-050Ribbon/11Y/111/111-YYY-113L001.pdf Norcomp 111-024-113L001]: [http://www.digikey.de/product-detail/de/111-024-113L001/1024PMA-ND/955147 Digikey] (4.54&euro;)
* Straight (no right-angle), solder-cup/cable, male:
** [http://www.amphenolcanada.com/ProductSearch/drawings/AC/5730240.pdf Amphenol 57-30240]: [http://de.mouser.com/ProductDetail/Amphenol-Commercial-Products/57-30240/?qs=2ZPlowQld1N7RBj5X0pv8db%252b15EhuRSLDpapiRNYO6M%3d Mouser] (7.19&euro;), Digikey: N/A
* Straight (no right-angle), ribbon cable, male:
** MULTICOMP 5F30240P-10NN-XX: [http://de.farnell.com/multicomp/5f30240p-10nn-xx/stecker-centronics-24-pol/dp/1099278 Farnell] (2.31&euro;)


=== GPIB protocol chips ===
=== GPIB protocol chips ===
Line 38: Line 74:
* [http://www.datasheetarchive.com/dl/Datasheets-112/DSAP0051077.pdf Fairchild 96LS488]
* [http://www.datasheetarchive.com/dl/Datasheets-112/DSAP0051077.pdf Fairchild 96LS488]
* [http://www.datasheetarchive.com/dl/Datasheets-24/DSA-476449.pdf NEC uPD7210C/D]
* [http://www.datasheetarchive.com/dl/Datasheets-24/DSA-476449.pdf NEC uPD7210C/D]
* [http://www.datasheetarchive.com/dl/Datasheets-313/195317.pdf National NAT9914]
* [http://sine.ni.com/nips/cds/view/p/lang/en/nid/10626 National Instruments NAT7210]: "Drop-In Replacement Chip for NEC µPD7210 Controller" ([http://www.ni.com/pdf/products/us/4gpib704.pdf datasheet])
* [http://sine.ni.com/nips/cds/view/p/lang/de/nid/11153 National Instruments NAT9914]: "Drop-In Replacement Chips for TI TMS9914A Controllers" ([http://www.ni.com/pdf/products/us/4gpib705.pdf datasheet])
* [http://sine.ni.com/nips/cds/view/p/lang/en/nid/12149 National Instruments TNT4882]: "High-Performance, Lower-Cost Single-Chip GPIB Talker/Listener ASIC" ([http://www.ni.com/pdf/products/us/4gpib702-703.pdf datasheet])
* [http://sine.ni.com/nips/cds/view/p/lang/en/nid/12150 National Instruments TNT5002]: "Single-Chip PCI-to-GPIB Talker/Listener ASIC" ([http://www.ni.com/pdf/products/us/4gpib700-701.pdf datasheet])


(pretty much all of them are no longer available)
(pretty much all of them are no longer available, or horribly expensive, or hard to get, or a combination thereof)


=== GPIB transceiver chips ===
=== GPIB transceiver chips ===


* [http://www.datasheetarchive.com/dl/Datasheets-21/DSA-418241.pdf National DS75160A]
* [http://www.datasheetarchive.com/dl/Datasheets-21/DSA-418241.pdf National DS75160A/61A/62A]
* [http://www.ti.com/product/sn75160b SN75160B: Octal General-Purpose Interface Bus Transceiver] ([http://www.ti.com/lit/gpn/sn75160b datasheet])
* [http://www.ti.com/product/sn75160b SN75160B: Octal General-Purpose Interface Bus Transceiver] ([http://www.ti.com/lit/gpn/sn75160b datasheet]). [http://de.mouser.com/ProductDetail/Texas-Instruments/SN75160BDW/?qs=Dqy2GfToSoRN7kS7RA4kUqt%252bApV44GjizjHa8zhcESY%3d Mouser: 1.55&euro;], [http://www.digikey.de/product-detail/de/SN75160BDW/296-6844-5-ND/370216 Digikey] (2.33&euro;)
* [http://www.ti.com/product/sn75161b SN75161B: Octal General-Purpose Interface Bus Transceiver] ([http://www.ti.com/lit/gpn/sn75161b datasheet])
* [http://www.ti.com/product/sn75161b SN75161B: Octal General-Purpose Interface Bus Transceiver] ([http://www.ti.com/lit/gpn/sn75161b datasheet]). [http://de.mouser.com/ProductDetail/Texas-Instruments/SN75161BDW/?qs=Dqy2GfToSoSEk6hSOlXO6PWl2ZlfYL4DQU8qvn8WRzg%3d Mouser: 1.45&euro;], [http://www.digikey.de/product-detail/de/SN75161BDWR/296-14951-1-ND/562537 Digikey] (2.74&euro;)
* [http://www.ti.com/product/sn75162b SN75162B: Octal General-Purpose Interface Bus Transceiver] ([http://www.ti.com/lit/gpn/sn75162b datasheet])
* [http://www.ti.com/product/sn75162b SN75162B: Octal General-Purpose Interface Bus Transceiver] ([http://www.ti.com/lit/gpn/sn75162b datasheet]). [http://de.mouser.com/ProductDetail/Texas-Instruments/SN75162BDW/?qs=Dqy2GfToSoQt2q38QBjULg%3d%3d Mouser: 2.03&euro;], [http://www.digikey.de/scripts/dksearch/dksus.dll?vendor=0&keywords=SN75162&stock=1 Digikey] (2.33&euro;)
 
== Bill of materials ==
 
{| border="0" style="background-color: #eeeeee; font-size: smaller" class="alternategrey sortable sigroktable"
|-
! align="left" | Description
! align="left" | Manufacturer
! align="left" | Part Number
! align="left" | Package
! align="left" | Quantity
! align="left" | Vendor
! align="left" | Price
 
|-
|| Generic Capacitor 100nF 10V || any ||  || 0603 || 5 ||  || $0.10
 
|-
|| Generic Capacitor 1 µF 10V || any ||  || 0603 || 2 ||  || $0.10
 
|-
|| Chip LED || Lite-On || LTST-C193TBKT-5A || 0603 || 1 || Digikey || $0.47
 
|-
|| SMT Micro USB Female right-angle bottom-mount connector type B || Molex || 473460001 || Receptacle || 1 || Newark || $0.52
 
|-
|| Connector, GPIB Sldr, Female || L-COM || CIB24S ||  || 1 || L-COM || $8.02
 
|-
|| Generic Resistor (0.0R) || any ||  || 0603 || 2 ||  || $0.10
 
|-
|| Generic Resistor (30) || any ||  || 0603 || 1 ||  || $0.10
 
|-
|| Common mode filter with ESD protection for USB 2.0 interface || STMicroelectronics || ECMF02-4CMX8 || QFN-8L || 1 || Arrow || $0.54
 
|-
|| Octal Transceiver GPIB Control || Texas Instruments || SN75161BDW || SOIC || 1 || Arrow || $1.60
 
|-
|| LP2980-N Micropower 50-mA Ultra Low-Dropout Regulator in SOT-23 Package || Texas Instruments || LP2980IM5-3.3/NOPB || SOT-23-5 || 1 || Arrow || $0.43
 
|-
|| Octal Transceiver GPIB Data bus || Texas Instruments || SN75160BDW || SOIC || 1 || Digikey || $2.18
 
|-
|| 32-bit MCU ARM Cortex-M0+, 64 KB Flash, 8 KB SRAM, 2 KB EEPROM, USB || STMicroelectronics || STM32L062K8T6 || LQFP32 || 1 || Arrow || $2.33
 
|}


== Resources ==
== Resources ==
Line 54: Line 143:
* [http://hackaday.com/2012/05/01/gpib-connectivity-twofer/ Hack a Day: GPIB connectivity twofer] (covers Galvant GPIBUSB and Sven Pauli's RS232-GPIB interface)
* [http://hackaday.com/2012/05/01/gpib-connectivity-twofer/ Hack a Day: GPIB connectivity twofer] (covers Galvant GPIBUSB and Sven Pauli's RS232-GPIB interface)
* [http://digital.ni.com/public.nsf/allkb/9BB2417C09C4D08786256BE9007D7B55 GPIB connector pinout]
* [http://digital.ni.com/public.nsf/allkb/9BB2417C09C4D08786256BE9007D7B55 GPIB connector pinout]
== Volunteers ==
Please edit this section with your name and (public) contact details if you are interested in developing this.
* [[User:Ivan747]] (same nick on IRC), experience in hardware, low level firmware (but not USB). Willing to participate with the support from someone experienced in USB protocols on any kind of ARM device. Contact: ivan747[at]users.sourceforge.net.
* [[User:Elbridge]] (same nick in IRC), experienced with hw and fw, but new to open source.

Revision as of 13:07, 20 September 2016

This page documents some ideas and information for a GPIB-USBTMC hardware interface.

Motivation

There are many ways to communicate with devices that have a GPIB port, and sigrok aims to support as many of them as possible (see IEEE-488). However in this day and age the only reasonable interface for this would have to use a USB device port, since USB host ports are so ubiquitous. The USB standards include a device class specifically made for test and measurement, called the USBTMC class.

Yet most of the GPIB-USB interfaces available don't use this device class; they typically use either a proprietary protocol or serial emulation. There is only one GPIB-USBTMC interface that we know of: the TEK-USB-444 from Tektronix, and it's ridiculously overpriced at around $740.

We think we can make a GPIB-USBTMC interface that is:

  • 100% free and open source, hardware and firmware/software
  • 100% standards-compliant
  • Considerably cheaper than anything else out there (less than $50)

In addition, since we'd be making essentially a "server-side" i.e. USB device-side implementation of the USBTMC protocol, this code would be reusable in projects such as Das Oszi.

Hardware design

  • STM32L0 ARM Cortex M0
    • Built-in FS USB with crystaless operation
    • Compatible with libopencm3
    • 32 pin LQFP keeps size low and assembly easy
  • Specialty Trancievers
    • TI still makes the SN75160 (data) and SN75161 (handshake)
    • High current drive required for logic lines according to GPIB standard
    • Directional bundling of pins based on protocol simplfies firmware
  • 2 Layer PCB to keep cost low
  • Designed to fit in L-COM housing for CIB24S GPIB connector
    • Saves effort on custom enclosure
  • Current design hosted at Upverter

Firmware

This is more of a TODO list at the moment:

  • Start with libopencm3
    • Add new class for USB TMC
  • GPIB
    • Implement functions
      • Serial poll
      • Write
      • Read
      • Reset
      • Local lockout
    • Monitor and handle SRQs
  • Commands
    • All data is just passed thru from PC to GPIB device and back, parsing of SCPI or other protocols is not required in firmware
  • Firmware update
    • Use the DFU bootloader in libopencm3
    • Modify to check register for boot flag instead of hardware pin
    • Some special command in USB TMC can set to bootloader mode and reset processor, then when DFU is done, set flag back and boot to main

Components

GPIB connectors

GPIB protocol chips

(pretty much all of them are no longer available, or horribly expensive, or hard to get, or a combination thereof)

GPIB transceiver chips

Bill of materials

Description Manufacturer Part Number Package Quantity Vendor Price
Generic Capacitor 100nF 10V any 0603 5 $0.10
Generic Capacitor 1 µF 10V any 0603 2 $0.10
Chip LED Lite-On LTST-C193TBKT-5A 0603 1 Digikey $0.47
SMT Micro USB Female right-angle bottom-mount connector type B Molex 473460001 Receptacle 1 Newark $0.52
Connector, GPIB Sldr, Female L-COM CIB24S 1 L-COM $8.02
Generic Resistor (0.0R) any 0603 2 $0.10
Generic Resistor (30) any 0603 1 $0.10
Common mode filter with ESD protection for USB 2.0 interface STMicroelectronics ECMF02-4CMX8 QFN-8L 1 Arrow $0.54
Octal Transceiver GPIB Control Texas Instruments SN75161BDW SOIC 1 Arrow $1.60
LP2980-N Micropower 50-mA Ultra Low-Dropout Regulator in SOT-23 Package Texas Instruments LP2980IM5-3.3/NOPB SOT-23-5 1 Arrow $0.43
Octal Transceiver GPIB Data bus Texas Instruments SN75160BDW SOIC 1 Digikey $2.18
32-bit MCU ARM Cortex-M0+, 64 KB Flash, 8 KB SRAM, 2 KB EEPROM, USB STMicroelectronics STM32L062K8T6 LQFP32 1 Arrow $2.33

Resources

Volunteers

Please edit this section with your name and (public) contact details if you are interested in developing this.

  • User:Ivan747 (same nick on IRC), experience in hardware, low level firmware (but not USB). Willing to participate with the support from someone experienced in USB protocols on any kind of ARM device. Contact: ivan747[at]users.sourceforge.net.
  • User:Elbridge (same nick in IRC), experienced with hw and fw, but new to open source.