Products > Test Equipment
open source GPIB adapter
dazz1:
Hi
I may have found the bug mentioned in the README file.
When I plug in the adapter into the PC USB, it tells me the USB device is not recognised.
Yesterday I successfully uploaded the firmware from the PC to the adapter with the same cable and that worked OK. So I don't think I have a hardware problem. The leading hypothesis is that using avrdude to load the firmware has exposed the bug.
dazz1:
I found some ready-made GPIB control software here:
https://www.eevblog.com/forum/testgear/hp-34401a-standalone-software/
I just need to get my adapter working first.
With the usb interface malfunctioning, I can't over-write the existing software via the usb connection. I will have to do it with avrdude.
caiser01:
--- Quote from: dazz1 on November 13, 2023, 02:17:35 am ---I didn't do what you said. I tried something else.
--- End quote ---
deepfryed was telling you the right way to do it, which is the way xyphro outlines in his README on GitHub (https://github.com/xyphro/UsbGpib)
--- Quote from: dazz1 on November 13, 2023, 04:46:30 am ---When I plug in the adapter into the PC USB, it tells me the USB device is not recognised.
Yesterday I successfully uploaded the firmware from the PC to the adapter with the same cable and that worked OK. So I don't think I have a hardware problem. The leading hypothesis is that using avrdude to load the firmware has exposed the bug.
--- End quote ---
Since you deviated from the flashing process that the developer recommends, I would first try erasing and re-flashing using xyphro's instructions exactly before assuming there is a bug. I have flashed several of these adapters without issue by following the xyphro's instructions, and they work correctly afterward. If you prefer to script the process, as you showed in your earlier post, that's fine but the process should still follow what is outlined by the developer.
Once the adapter has been flashed and you see the LED blinking, you can connect the adapter to an instrument. One simple method of testing is by using the pyvisa-shell application (https://pyvisa.readthedocs.io/en/latest/introduction/shell.html). This will allow you to interactively communicate with the instrument to test basic functionality. Alternatively if you have a VISA implementation from one of the commercial vendors, they all include a utility that allows you to interactively send commands to and read from the instrument. My personal favorite is Rohde & Schwarz (https://www.rohde-schwarz.com/us/applications/r-s-visa-application-note_56280-148812.html). The R&S Tester app will allow you to quickly check communication with an instrument.
Finally, if you're familiar with Python, here is a simple script that can be used to read from the HP 3478A you mentioned in your earlier post. Please note: Your VISA resource string will be different because your adapter will have a different serial number to mine.
--- Code: ---# HP 3478A Multimeter simple read test
import pyvisa
rm = pyvisa.ResourceManager()
multimeter = rm.open_resource('USB0::0x03EB::0x2065::GPIB_23_3423331363435161F191::INSTR')
# Set function to DC volts
multimeter.write('F1')
try:
while True:
print(float(multimeter.read().strip()))
except KeyboardInterrupt:
multimeter.clear()
multimeter.close()
rm.close()
--- End code ---
dazz1:
--- Quote from: caiser01 on November 14, 2023, 02:40:35 pm ---
--- Quote from: dazz1 on November 13, 2023, 02:17:35 am ---I didn't do what you said. I tried something else.
--- End quote ---
deepfryed was telling you the right way to do it, which is the way xyphro outlines in his README on GitHub (https://github.com/xyphro/UsbGpib)
--- Quote from: dazz1 on November 13, 2023, 04:46:30 am ---When I plug in the adapter into the PC USB, it tells me the USB device is not recognised.
Yesterday I successfully uploaded the firmware from the PC to the adapter with the same cable and that worked OK. So I don't think I have a hardware problem. The leading hypothesis is that using avrdude to load the firmware has exposed the bug.
--- End quote ---
Since you deviated from the flashing process that the developer recommends, I would first try erasing and re-flashing using xyphro's instructions exactly before assuming there is a bug. I have flashed several of these adapters without issue by following the xyphro's instructions, and they work correctly afterward. If you prefer to script the process, as you showed in your earlier post, that's fine but the process should still follow what is outlined by the developer.
Once the adapter has been flashed and you see the LED blinking, you can connect the adapter to an instrument. One simple method of testing is by using the pyvisa-shell application (https://pyvisa.readthedocs.io/en/latest/introduction/shell.html). This will allow you to interactively communicate with the instrument to test basic functionality. Alternatively if you have a VISA implementation from one of the commercial vendors, they all include a utility that allows you to interactively send commands to and read from the instrument. My personal favorite is Rohde & Schwarz (https://www.rohde-schwarz.com/us/applications/r-s-visa-application-note_56280-148812.html). The R&S Tester app will allow you to quickly check communication with an instrument.
Finally, if you're familiar with Python, here is a simple script that can be used to read from the HP 3478A you mentioned in your earlier post. Please note: Your VISA resource string will be different because your adapter will have a different serial number to mine.
--- Code: ---# HP 3478A Multimeter simple read test
import pyvisa
rm = pyvisa.ResourceManager()
multimeter = rm.open_resource('USB0::0x03EB::0x2065::GPIB_23_3423331363435161F191::INSTR')
# Set function to DC volts
multimeter.write('F1')
try:
while True:
print(float(multimeter.read().strip()))
except KeyboardInterrupt:
multimeter.clear()
multimeter.close()
rm.close()
--- End code ---
--- End quote ---
I agree with all of the above but I generally don't learn a lot by just following the instructions. I want to modify the Xyphro software to run on my hardware, while remaining compatible with the Xyphro version. To do that I need a deeper understanding of programming model and tool chain. I have programmed in a number of languages but not Python or C++ so I intend to learn. Before this project, I had never heard of avrdude but now I can write usable commands.
I will use those links to the gpib type software. They will be useful as a confidence check and for diagnostics.
My understanding is that it should be possible to program the firmware by flashing one image to avoid the need for the two step process that can't be scripted (unplug/plug in the adapter). It appears the way to do that with the Xyphro software is to use avrdude to read back an image of a fully flashed usb-gpib adapter flash and use that to write to other un-programmed adapters. When first plugged in, the adapter would not appear as a memory device.
I have avrdude installed on the windows side so I am going to play around with that. If things get truly desperate, I might even be forced to follow the instructions.
caiser01:
--- Quote from: dazz1 on November 14, 2023, 07:13:58 pm ---My understanding is that it should be possible to program the firmware by flashing one image to avoid the need for the two step process that can't be scripted (unplug/plug in the adapter). It appears the way to do that with the Xyphro software is to use avrdude to read back an image of a fully flashed usb-gpib adapter flash and use that to write to other un-programmed adapters.
--- End quote ---
If you want a single hex file that combines the bootloader and GPIB application, there's another way that might be easier. Go get SRecord (https://srecord.sourceforge.net/) and use srec_cat to concatenate the hex files for the bootloader and the application. Both hex files are available already compiled in xyphro's repository. The command to concatenate them will look similar to this:
--- Code: ---srec_cat BootloaderMassStorage.hex -Intel TestAndMeasurement.hex -Intel -o combined.hex -Intel
--- End code ---
That should give you a single hex file you can flash with avrdude in one step.
I would still encourage you to flash one adapter by the original instructions so you have a known good baseline before you start changing things.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version