Difference between revisions of "Gpibgrok"
Uwe Hermann (talk | contribs) |
(Clarification on what the Tektronix USB-GPIB interface actually is) |
||
(25 intermediate revisions by 7 users not shown) | |||
Line 4: | Line 4: | ||
== 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. | Yet most of the GPIB-USB interfaces available don't use this device class; they typically use either a proprietary protocol or serial emulation. The originator on this project, [[User:Uwe_Hermann|Uwe_Hermann]], thought that the [http://www.tek.com/datasheet/gpib-usb-adapter TEK-USB-488] interface from Tektronix was being able to act as a controller (and it's ridiculously overpriced at around $740). But this interface is actually an USB host controller for a device already implementing USBTMC device class, and making it (and only this one) reachable through GPIB; e.g. making an USB-only oscilloscope implementing the USBTMC class reachable through GPIB. There is even an additional USB protocol to be implemented by this device to be able to control the GPIB address it will appear on. Thus, making a GPIB controller interfaced through this USBTMC class may not be possible, IMHO ([[User:Benoar|Benoar]]). | ||
We think we can make a GPIB-USBTMC interface that is: | We think we can make a GPIB-USBTMC interface that is: | ||
Line 17: | Line 17: | ||
== Hardware design == | == Hardware design == | ||
* | * STM32L0 ARM Cortex M0 | ||
** Built-in USB | ** Built-in FS USB with crystal-less operation | ||
** | ** Compatible with libopencm3 | ||
** | ** 32 pin LQFP keeps size low and assembly easy | ||
* | * Specialty transceivers | ||
* | ** 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 simplifies firmware | |||
* Two-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] | |||
== | == Firmware == | ||
This is more of a TODO list at the moment: | |||
* Start with libopencm3 | |||
** Add new class for USBTMC | |||
* 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 USBTMC can set to bootloader mode and reset processor, then when DFU is done, set flag back and boot to main | |||
== Components == | == Components == | ||
Line 33: | Line 55: | ||
* Right-angle, PCB mounted, male: | * 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€, but not available ATM) | ** 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€, but not available ATM), [http://www.digikey.de/product-search/de?x=0&y=0&lang=de&site=de&KeyWords=112-024-113R001 Digi-Key] (4.59€) | ||
** 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€, but not available, and minimum quantity required) | ** 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€, but not available, and minimum quantity required), [http://www.digikey.de/scripts/dksearch/dksus.dll?vendor=0&keywords=5552741-1 Digi-Key] (7.50€) | ||
* Straight (no right-angle), PCB mounted, male: | * 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€) | ** [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€), [http://www.digikey.de/scripts/dksearch/dksus.dll?vendor=0&keywords=552283-1 Digi-Key] (4.51€, but EOL soon? Minimum quantity?) | ||
* Straight (no right-angle), solder-cup, male: | * 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 Digi-Key] (2.90€) | |||
** [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€) TODO: Typo on page/datasheet, or is this really female? | ** [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€) 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 Digi-Key] (4.54€) | |||
* 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€), Digi-Key: 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€) | |||
=== GPIB protocol chips === | === GPIB protocol chips === | ||
Line 45: | 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. | * [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, 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://de.mouser.com/ProductDetail/Texas-Instruments/SN75160BDW/?qs=Dqy2GfToSoRN7kS7RA4kUqt%252bApV44GjizjHa8zhcESY%3d Mouser: € | * [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€], [http://www.digikey.de/product-detail/de/SN75160BDW/296-6844-5-ND/370216 Digi-Key] (2.33€) | ||
* [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. | * [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€], [http://www.digikey.de/product-detail/de/SN75161BDWR/296-14951-1-ND/562537 Digi-Key] (2.74€) | ||
* [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% | * [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€], [http://www.digikey.de/scripts/dksearch/dksus.dll?vendor=0&keywords=SN75162&stock=1 Digi-Key] (2.33€) | ||
== 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 || Digi-Key || $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 61: | 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] | ||
* [https://www.eevblog.com/forum/projects/usbtmcusb488-class-implementation-for-microcontrollers/msg2704048/#msg2704048 news of a USBTMC driver for TinyUSB stack] | |||
== 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 hardware and firmware, but new to open source. | |||
[[Category:GPIB interface]] |
Latest revision as of 18:52, 16 December 2022
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. The originator on this project, Uwe_Hermann, thought that the TEK-USB-488 interface from Tektronix was being able to act as a controller (and it's ridiculously overpriced at around $740). But this interface is actually an USB host controller for a device already implementing USBTMC device class, and making it (and only this one) reachable through GPIB; e.g. making an USB-only oscilloscope implementing the USBTMC class reachable through GPIB. There is even an additional USB protocol to be implemented by this device to be able to control the GPIB address it will appear on. Thus, making a GPIB controller interfaced through this USBTMC class may not be possible, IMHO (Benoar).
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 crystal-less operation
- Compatible with libopencm3
- 32 pin LQFP keeps size low and assembly easy
- Specialty transceivers
- 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 simplifies firmware
- Two-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 USBTMC
- GPIB
- Implement functions
- Serial poll
- Write
- Read
- Reset
- Local lockout
- Monitor and handle SRQs
- Implement functions
- 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 USBTMC can set to bootloader mode and reset processor, then when DFU is done, set flag back and boot to main
Components
GPIB connectors
- Right-angle, PCB mounted, male:
- Norcomp 112-024-113R001: about $5.5; Mouser (2.80€, but not available ATM), Digi-Key (4.59€)
- TE Connectivity 5552741-1: about $7.2; Mouser (5.87€, but not available, and minimum quantity required), Digi-Key (7.50€)
- Straight (no right-angle), PCB mounted, male:
- TE Connectivity / AMP 552283-1: Mouser (4.08€), Digi-Key (4.51€, but EOL soon? Minimum quantity?)
- Straight (no right-angle), solder-cup, male:
- Norcomp 111-024-103L001: Digi-Key (2.90€)
- Amphenol 57-20240: Mouser (4.93€) TODO: Typo on page/datasheet, or is this really female?
- Straight (no right-angle), solder, male:
- Norcomp 111-024-113L001: Digi-Key (4.54€)
- Straight (no right-angle), solder-cup/cable, male:
- Amphenol 57-30240: Mouser (7.19€), Digi-Key: N/A
- Straight (no right-angle), ribbon cable, male:
- MULTICOMP 5F30240P-10NN-XX: Farnell (2.31€)
GPIB protocol chips
- Philips/NXP HEF4738
- Fairchild 96LS488
- NEC uPD7210C/D
- National Instruments NAT7210: "Drop-In Replacement Chip for NEC µPD7210 Controller" (datasheet)
- National Instruments NAT9914: "Drop-In Replacement Chips for TI TMS9914A Controllers" (datasheet)
- National Instruments TNT4882: "High-Performance, Lower-Cost Single-Chip GPIB Talker/Listener ASIC" (datasheet)
- National Instruments TNT5002: "Single-Chip PCI-to-GPIB Talker/Listener ASIC" (datasheet)
(Pretty much all of them are no longer available, or horribly expensive, or hard to get, or a combination thereof.)
GPIB transceiver chips
- National DS75160A/61A/62A
- SN75160B: Octal General-Purpose Interface Bus Transceiver (datasheet). Mouser: 1.55€, Digi-Key (2.33€)
- SN75161B: Octal General-Purpose Interface Bus Transceiver (datasheet). Mouser: 1.45€, Digi-Key (2.74€)
- SN75162B: Octal General-Purpose Interface Bus Transceiver (datasheet). Mouser: 2.03€, Digi-Key (2.33€)
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 | Digi-Key | $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
- Massimiliano Gentile's thesis on writing a USBTMC driver for the AVR32 architecture.
- Hack a Day: GPIB connectivity twofer (covers Galvant GPIBUSB and Sven Pauli's RS232-GPIB interface)
- GPIB connector pinout
- news of a USBTMC driver for TinyUSB stack
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 hardware and firmware, but new to open source.