Skip to content

Commit

Permalink
updated for fw v5 and hw rev4
Browse files Browse the repository at this point in the history
  • Loading branch information
scasagrande committed Jul 22, 2014
1 parent 9ad73f5 commit 658e3e2
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 41 deletions.
Binary file modified basic_commands.odt
Binary file not shown.
97 changes: 67 additions & 30 deletions basic_commands.txt
@@ -1,44 +1,81 @@
Galvant Industries GPIBUSB Command List
Galvant Industries GPIBUSB Command List – Firmware v5

** Baudrate: 460800 **
** Note: All writes to the controller must end with a carriage return ('\r' or dec:13) **
** All responses from the adapter will have a CR added. **
** Baudrate: 460800, standard 8N1 serial settings, no flow control **
** Note: All writes to the controller must end with a carriage return ('\r' or dec:13) or newline ('\n' or dec:10)**
** All responses from the adapter will have a CR added by default. **

All of this information can be found, along with additional information, can be found in the readme.md file for the firmware located at github.com/Galvant/gpibusb-firmware

+a:1
Set the GPIB address of the device you wish to communicate with. Here the target address is 1. Check the device to find what its address is.
++addr 1
Sets the GPIB address of the device you wish to communicate with. Here the target address is 1. GPIB address range from 1 to 31. Check the device to find what its address is. When in device mode this will set the address of the device.

+eoi:1
Used to toggle EOI detection on (1) and off (0). If set to on, the controller will stop reading bytes from the device when EOI is asserted. When set to off, the controller will stop when it reads the byte defined by the +eos: command. Default is on (1). Most devices will use EOI, some will give you the option, and some will not. For those that give you the option, it is highly recommended that you use EOI to signal end of data.
++auto 1
Used to toggle automatic response reading on (1) and off (0). If set to on (default) the adapter will automatically start reading the response from the device if your data contained a question mark (?).
When set to off, the response will not be read and you will need to send the ``++read`` command to
do so. If set to on, reading will terminate on EOI if ``++eoi 1`` is set, or will terminate on EOS charactrs if ``++eoi 0`` is set.

+eos:1
Set the character that the device uses to signal end of data. This is especially important when EOI
is off. However, some instruments will use both a termination character and use EOI. If you make sure to set EOS even if you are using EOI data termination, the controller will suppress the last byte. It is recommended that you disable any termination characters at the instrument and just use EOI.
To set the termination character, put the decimal form of the character after the colon. For example, to
set the character to 'z', you would write +eos:122
++clr
Sends the "Selected Device Clear" (SDC) to the currently specified GPIB address as per ``++addr``.

+read
Force the controller to read data from the instrument by placing the instrument in talk mode. Normally this is NOT required. When writing commands that end with a question mark (?), the controller will automatically read the response. However, older instruments do not include question marks at the end of query commands. In these cases, using this command will prompt the controller to read the response data.
++debug 0
Used to toggle simple debug messages on (1) and off (0). When set to on, communicaiton timeout error messages are sent to the host PC containing basic details as to when and what timed-out. This includes which data line timed-out (DAV, NDAC, NRFD), if you were waiting for it to go high or low, as well as if the adapter was reading or writing. Default is off.

+test
Used to test the controller and your communication software. Controller will respond with: testing\n\r
Controller needs to be plugged into an instrument that is on (ie red LED off) for this to work.
++eoi 1
Used to toggle EOI assertion when writing on (1) and off (0). If set to on, the adapter will assert EOI on the last byte sent over the GPIB bus. Default is on (1). Most devices will use EOI, some will give you the option, and some will not. For those that give you the option, it is highly recommended that you use EOI to signal end of data.

+get
Short for �Group Execute Trigger�. This command will send the GPIB bus command to all attached instruments. Introduced in firmware version 3.
++eos [0|1|2|3]
Set the character that the adapter uses to signal end of data. EOS characters are appended to the end of data being sent to GPIB devices and removed from the data received from GPIB devices. When using ```++read``` reading will terminate when EOS characters are detected. There are four options for this command: ```++eos 0``` appends CR+LF, ```++eos 1``` appends CR, ```++eos 2``` appends LF, and ```+eos 3``` does not append anything. Default is 3.

+strip:0
Sets the number of characters to remove from the end of the instrument's response before sending it to the attached computer. This is useful when the instrument appends a CR as the adapter uses CR to terminate communication. This can prevent having to include extra serial port reads in an effort to clear the buffer when programming. NOTE: This command can fail if the total number of bytes to be sent to the computer is close to an integer multiple of 100. Introduced in firmware version 3.
+++eot_enable 1
Used to toggle end-of-transmission (EOT) characters on (1) and off (0). When set to on, data received
from your GPIB devices will have the EOT character appended to the end when forwarded to the attached PC. This character is specified with the ```++eot_char``` command. Default is on.

+ver
Returns the firmware version. Introduced in firmware version 3.
++eot_char 13
Specifies the character that will be appended to all transmissions sent from the adapter to the attached PC. The value is a number in the set [0,255] which is the decimal version of the desired ASCII character. Default is 13 (CR).

+autoread:1
Used to toggle automatic response reading on (1) and off (0). If set to on (default) the adapter will automatically start reading the response from the device if your data contained a question mark (?). When set to off, the response will not be read and you will need to send the +read command to do so. This is useful for when uploading small amount of binary data to your instruments as 0x3F (ascii for "?") will cause the adapter to attempt to read a response. Introduced in firmware version 4.
++ifc
Asserts the GPIB IFC line for 150us.

+reset
Resets the microcontroller. Can be useful for when you need settings back to power-on default, or if and instrument/device has decided it no longer wishes to listen to the GPIB bus. Introduced in firmware version 4.
++llo
Disable front panel operation of the currently addressed instrument by sending the GPIB command byte LLO.

+debug:0
Used to toggle simple debug messages on (1) and off (0). When set to on, communicaiton timeout error messages are sent to the host PC containing basic details as to when and what timed-out. This includes which data line timed-out (DAV, NDAC, NRFD), if you were waiting for it to go high or low, as well as if the adapter was reading or writing. Default is off (0). Introduced in firmware version 4.
++loc
Enables front panel operation of the currently addressed instrument by sending the GPIB command byte GTL.

++mode 1
Used to switch the adapter between controller mode (1) and device mode (0). Default is controller mode.

++read [eoi]
Sets the currently addressed GPIB device to talk. This is useful when ``++auto 0`` is set or if you have an instrument that does no rely on the question mark query syntax. There are two ways to use this command: ``++read`` will read until the EOS characters set by ``++eos`` is found, or ``++read eoi`` will read until the EOI line is asserted.

++read_tmo_ms 1000
Set the GPIB read/write timeout period in milliseconds.

++rst
Resets the GPIBUSB adapter. Any unsaved settings will be restored to the previously saved values.
Make sure to wait a few seoncds after sending this command for the adapter to fully restart.

++savecfg 1
Saves current settings to EEPROM so that they can be preserved through restarts and power cycles.
Although you can query the savecfg value with ``++savecfg``, this is only done for compatibility reasons. The only way to save your settings to EEPROM is to send ``++savecfg 1``. The following
variables are saved: ``++mode``, ``++addr``, ``++eot_char``, ``++eot_enable``, ``++eos``, ``++eoi``,
and ``++auto``.

++spoll
Perform a GPIB serial poll on the currently specified GPIB address. In addition, you can inline specify a different address with the syntax ``++spoll 16`` where 16 is the target GPIB address for your serial poll.

++srq
Returns that status of the GPIB SRQ line. Returns `1` if the line is asserted or `0` if not. If this returns `1` then that means a device on your GPIB bus is requesting service. You should then perform serial polls via ``++spoll`` to find which device needs service.

++status 0
Sets the status byte of the adapter when in device mode. This byte is transmitted over the GPIB
bus when addressed with a serial poll. Currently, device mode will not assert SRQ no matter
what you set the status byte to. This will be implemented in a future firmware update. Valid
values are `[0,255]`.

++trg
Perform a GPIB bus trigger on the currently specified GPIB address by sending the GPIB command
byte `GET`.

++ver
Returns the string ``Version 5.0``.
Binary file modified box_insert.odt
Binary file not shown.
22 changes: 11 additions & 11 deletions box_insert.txt
@@ -1,4 +1,4 @@
Galvant Industries GPIBUSB rev3
Galvant Industries GPIBUSB rev4


Thanks for purchasing our USB-to-GPIB adapter! This hardware is released as open source hardware. This means you can find all the source files online at github.com/Galvant where you are free to download them to share, use, change, or anything else you like!
Expand All @@ -9,7 +9,7 @@ By purchasing this adapter, you are supporting open source hardware and the deve


Warning!
This device contains lead-free (Pb) in all solder joints but was not assembled in a lead-free environment. Be sure to wash your hands after handling so you do not ingest any residue on your hands.
This device contains lead-free (Pb-free) in all solder joints but was not assembled in a lead-free environment. Be sure to wash your hands after handling so you do not ingest any residue on your hands.
This adapter has only been tested at room temperatures, at standard humidity levels. As such, there is no guaranteed operation outside of these conditions.
This product contains ESD sensitive devices. Refrain from touching any of the surface mount components soldered to the board, unless you are taking proper ESD safety precautions.

Expand All @@ -29,23 +29,23 @@ If you have any questions, comments, or concerns please send an email to contact
Visit our website at galvant.ca, follow us on twitter @Galvant_Ind, and watch Steven's YouTube channel for development of new products! youtube.com/user/stevencasagrande

If you find any bugs, develop any firmware changes, or have any suggestions, be sure to send us an email! We'll see about including your suggestions in the github repositories for everyone else to use!
Quickstart Windows
1. Plug adapter into free USB port. Windows 7 should automatically download the required drivers. If your version of Windows does not automatically download the drivers, visit ftdichip.com/FTDrivers.htm and download and install the Virtual COM Port driver.
Quickstart Windows
1. Plug adapter into free USB port. Windows 7 should automatically download the required drivers. If your version of Windows does not automatically download the drivers, visit ftdichip.com/FTDrivers.htm and download and install the Virtual COM Port driver.
2. Find which COM port your adapter is. You can find this information in the Windows device manager (right click Computer -> Properties -> Device Manager). Look for the entry with FTDI in the name.
3. Download a serial terminal client such as Termite (compuphase.com/software_termite.htm)
4. Follow communication steps below.

Quickstart Linux
Quickstart Linux
1. Make sure you are running a version 3.0.0-19 or greater Linux kernel. To check this type uname -a into the terminal. Most modern Linux distributions will already be using this. It is highly recommended that you upgrade to the latest distribution version (and thus kernel) to ensure operation.
2. Add your user to the dialout usergroup. Type usermod -a -G dialout name where you replace name with your username. Restart computer to make sure this takes effect. This ensures that your account can read and write to serial ports.
3. Plug adapter into a free USB port, and find what the port name is. Most of the time it will be /dev/ttyUSB0. To find this, type ls /dev | grep ttyUSB into the terminal.
4. Use a serial terminal program to connect to the adapter. Some examples include Putty and Minicom.
4. Use a serial terminal program to connect to the adapter. One example is CuteCom.
5. Follow communication steps below.

Communication
1. Set your program to 460800 baud and termination to CR. If you are not able to set the termination character, be sure to add a CR (carriage return, \r) to all communications. This baud rate is not an option in the Terminite dropdown list and you must manually type it in the field.
1. Set your program to 460800 baud, termination to CR or LF, standard 8N1 serial settings, and no flow control. If you are not able to set the termination character, be sure to add a CR (carriage return, \r) or LF (linefeed, \n) to all communications. This baud rate is not an option in the Terminite dropdown list and you must manually type it in the field.
2. Connect GPIBUSB to instrument(s). Ensure that the red LED is off. This ensures that the adapter has correctly taken control of the attached instrument(s).
3. Use the command +test (with a CR at the end) to check that everything is working. If the adapter responds with testing\n\r then everything has been setup, and you are connected to the instrument(s).
4. Set your target instrument by sending +a:1 where 1 is replaced with the GPIB address of your target instrument. If automating communication in a script, it is recommended that you include a slight delay (0.02sec) between successive commands.
5. Send your command of interest. A good test on most instruments is *idn? . If your query ends in a question mark, the adapter will automatically get the instrument response and write it to the computer.
6. For older instruments, your query might not end with a question mark. In this case send the command +read to force the adapter to read the instrument response by putting the instrument into talk mode.
3. Use the command +test (with a CR at the end) to check that everything is working. If the adapter responds with testing\n\r then everything has been setup.
4. Set your target instrument by sending +addr 1 where 1 is replaced with the GPIB address of your target instrument. If automating communication in a script, it is recommended that you include a slight delay (0.02sec) between successive commands.
5. Send your command of interest. A good test on most instruments is *idn? . If your query ends in a question mark, the adapter will automatically get the instrument response and write it to the computer. Consult your instrument manual to see if it supports this command.
6. For older instruments, your query might not end with a question mark. In this case send the command ++read to force the adapter to read the instrument response by putting the instrument into talk mode.

0 comments on commit 658e3e2

Please sign in to comment.