GPIB to USB Interface, Elektor 04-2011

/!\ English version of the German page GPIBtoUSB.

Rainer Schuster was so friendly, and has programmed in a good style a GPIB to USB converter with Win32 demo program to read a Tektronix TDS210 oscilloscope presented in the magazine Elektor 04-2011. The whole thing is much cheaper than commercial circuits, for hobby purpose.

Unfortunately, by not using a GPIB bus driver, it is only possible to connect not more than one GPIB device. The R8C CPU can deliver up to 60 mA at the I / O ports in total. Per output, but it should not be more than 2 mA in order not to exceed the voltage of 0.8V for the LOW level. With IEEE-488 GPIB standard, each device on the bus has a termination 3 KOhm resistor to +5V and 10 KOhm to 0V.

Development Software

After 5,5 years the Toolchain from Renesas is a little bit scrambled.

Good explanation for beginners: Erste Schritte mit Renesas M16C und GCC (German)

Problems:

Simplified Hardware

Since the R8C Starter Kit (supplement in the 12-2005 Elektor magazine!) was present in the junk box I looked for a suitable USB-Serial cable. At Ebay for only EUR 5 (including shipping) there is a Nokia CA-42 clone (Polific PL2302 chip) available. I ordered it, but it gave the following difficulties:

The Nokia cable plug was sealed, the pin assignment was difficult to determine, see picture on the right. Click the picture to enlarge it. If the color to pin determination is done, you can start soldering. My assignment:
Pin Color Signal
8 red GND
7 green Data out from phone
6 white Data into phone
5 brown ?
4 black +3.3 V
3 orange Accessory Control Interface
.. blue schield

attachment:GPIB_USB_Kabel1_DSC01698.jpg

Now I have learned, that only the cable with the blue USB plug housing (rubber like) does have a pl2303 chip inside. The cable with a black USB plug hard plastic housing does have a seldom used OTI 6858 chip (Ours Technology Inc.), which has drivers for Windows and Linux only. But this one has a DTR line and the USB +5 V readily available.

The +5 V from the USB port on the cable end were not available. The sealed USB connector was carefully opened (cut) and a wire fed out from the +5 V terminal to the cable end.

attachment:GPIB_USB_Kabel1_DSC01698.jpg

The construction was made ​​on a breadboard of Vero company. There the GND and +5 V lines were already routed.

attachment:GPIB_USB_Kabel1_DSC01698.jpg

The whole circuit has been built in an old housing (4-port USB hub). The GPIB connector could be fastened well there. For wiring Wire wrap wire was used, which does not stand out so much at 18 lines. The maxim was fast and inexpensive. I have a diagram with Eagle5 drawn and attached:GPIB_USB.sch

attachment:GPIB_USB_Kabel1_DSC01698.jpg

In order to sees something of the diagram here as a PNG file. Plus a PDF file for better printout GPIB_USB.pdf.

attachment:GPIB_USB.png

Test of the circuit

In order to test the basic function of the program and the interface, you need a terminal program. May I suggest PUTTY, it also works on Win 7-32.

PUTTY Parameters, Session:
  Connection Type: serial
  Serial line: COMx (x = USB Serial Emulation Nummer, z.B. 6)
  Speed: 38400

Keyboard input (blind, no Echo): "I", strg"J" (upper case I, Control+J = LineFeed)

Answer:
GPIB/USB converter V1.0

or
Set local echo ON
Text from the clipboard is inserted into the terminal window via the middle mouse key.

or with the MAC OS X Terminal (sudo because of /var/spool/uucp access):
$ sudo cu -l /dev/cu.PL2303-0000103D -s 38400
Help for "cu" (Call Up another system):
    ESCAPE: strg + alt gr + N = ~
    Terminate: ~.
    Variable: ~v
    Commands: ~?
    \ = SHIFT + alt + 7

All that was tested under Virtual Box V.4.0.6 in MAC OS X 10.6.

Firmware Comands

The commands can be sent manually in a terminal to the GPIB-USB converter. All commands must be terminated with Linefeed (Ctrl + J).

Changes in the Firmware

Unfortunately there is a bug in the file GPIB_functions.c.

        if (data & 0x80) p3_1=0; else p3_1=1;
        data = data <<1; //shift to p0_1..p0_7
        p0= ~data;

Extensions to GPIB_USB.c

To be able to operate my HP Logic Analyzer HP1631D in a useful manner with this interface a few commands were added:

The extended files are here for download: GPIB_USB.c , GPIB_functions.c and binary Release.zip.

Application Program hp1630.py for Logic Analyzer

/!\ 2016-08-21 Software update - you can find an actual software version here. The renewed program hp1630_p23.py was made compatible for Python 2 and 3, and tested on Linux Ubuntu 16.04-32, Mac OS X 10.11.6 El Capitan, and Windows 7-64. Now it can be used as an example program also for other GPIB instruments.

For comfortable using the HP Logic Analyzer HP1631D, I have written a Python command line program hp1630.py. It actually runs under MAC OS X, but should be easily ported to Win32 or Linux. If you run the programm without parameter you get get a help message. The GPIB Address of the device is coded to 4. The following commands are build in, as Command Line Parameter:

If you want to run a different GPIB device so you have to adjust the program accordingly. Since Python is a multi-platform interpreter programming language, an adoption should not be so difficult.

Screen Shots

Finally a hardcopy picture from the HP1631D in Waveform mode: txo10MHz_BNC.png

and GPIB analyze text screen (command Beep) with Bus Preprocessor HP10342B and Inverse Assembler (IHPIBc & IHPIBi):

   1 State Listing____________________Data Acquired Apr 13 2007 09:58
   2                                                REMOTE        <|
   3 Label> ADDR          ATN  Mnemonic  HEX EOI  SRQ  REN  IFC  STAT
   4 Base > [HEX]  [                   ASM                    ]  [HEX
   5  
   6 [Mark]   X    [               Instructions               ]   X$
   7  
   8 -0003*   0           ATN   TAG_00   40            REN        DA
   9 -0002*   0           ATN   *UNL*    3F            REN        DA
  10 -0001*   0           ATN   LAG_04   24            REN        DA
  11 +0000    0                   B      42            REN        DB
  12 +0001    0                   P      50            REN        DB
  13 +0002    0                   ;      3B            REN        DB
  14 +0003    0                 <LF >    0A  EOI       REN        D9
  15 +0004*   0           ATN   TAG_00   40            REN        DA
  16 +0005*   0           ATN   *UNL*    3F            REN        DA
  17 +0006*   0           ATN   LAG_04   24            REN        DA
  18 +0007*   0           ATN    GTL     01            REN        DA
  19  
  20  
  21  
  22  
  23  
  24 
hp1630_HC_GPIBf.txt

List of pages in this category:

-- RudolfReuter 2011-06-17 08:43:38


Go back to CategoryLogicAnalyzer or StartSeite ; KontaktEmail (ContactEmail)

GPIBtoUSB2 (last edited 2016-08-22 04:37:35 by RudolfReuter)