Products > Test Equipment

open source GPIB adapter

<< < (23/42) > >>

caiser01:

--- Quote from: dazz1 on November 15, 2023, 06:43:54 am ---I wrote the TestAndMeasurement.bin file to the adapter using the usbasp programmer.  Yes, I now realize this wipes out the bootloader.    What it does do is run the TestAndMeasurement firmware.  This causes the LED to flash at about 0.3Hz but the PC no longer detects the usb connection being made.  That is new.  Most likely a hardware fault because I have not changed the software.

--- End quote ---

That is the correct behavior for the GPIB application firmware. The light will blink and no USB device will show up until you connect it to the GPIB port of an instrument and power the instrument on. The adapter will then detect the instrument and present itself to the PC as a USB device with the appropriate VISA resource string. xyphro describes his philosophy behind this behavior here: https://github.com/xyphro/UsbGpib#usb-enumeration

dazz1:

--- Quote from: caiser01 ---
That is the correct behavior for the GPIB application firmware. The light will blink and no USB device will show up until you connect it to the GPIB port of an instrument and power the instrument on. The adapter will then detect the instrument and present itself to the PC as a USB device with the appropriate VISA resource string. xyphro describes his philosophy behind this behavior here: https://github.com/xyphro/UsbGpib#usb-enumeration

--- End quote ---

Yes, but I am no longer seeing a usb  connection on my PC regardless of what I do.  At present the adapter is plugged into a gpib device (HP 3478A), the LED is flashing, but the PC does not see the usb adapter.  I am working to the hypothesis that there is a hardware fault on the usb section.   The first step is to concat the bootloader and TestAndMeasurement files to see if I can get the adapter to present itself as a CD-ROM.

alan.bain:
I have a little direct adaptor Ethernet to GPIB built around a STM32 F439ZI Nucleo and a small daughter board with bus transceivers (so it can operate multiple devices). It seems to work well and at some point I produced a PCB with the whole lot on it to avoid needing the Nucleo, must test someday (the prototype worked well enough it just got used).

It speaks a Prologix like command set and seems featured enough to run an HP3048 type phase noise setup.  It doesn't support parallel poll because I didn't need it and never wrote the software although the hardware should support it.

It's very convenient as the whole equipment rack is connected to ethernet and can happily be controlled by any wifi device without lots of USB wires to risk pulling off surface mount USB micro sockets!

(Happy to share the firmware source code / put in public domain for others to use)

dazz1:
I have taken a closer look at the HEX files.  I think they already include the correct memory address locations.  It should be possible to load both with them ending up in the right locations in flash.
So from the windows side, I ran the avrdude command shown in the attached screen snip.

The response indicated successful programming.  When I plugged the adapter into the PC usb port, nothing.  No flashing LED, no ding from the PC to indicate a USB connection.  The later may be the usb hardware fault. 

When I run the the avrdude command that only programs the TestAndMeasurement.hex and not the BootLoasder.hex

--- Code: ---avrdude -c usbasp -p m32u4 -U flash:w:TestAndMeasurement.hex
--- End code ---
Then I get the flashing LED back again.

It would be useful to know if both hex files can be programmed and then run on hardware known to be working.  If both hex files can be programmed with one command, that would simplify things.
The software includes a magic value which I think triggers the call to the BootLoader at address 0700h by enabling the watch dog timer, but I haven't studied this in detail.


--- Code: ---void Jump_To_Bootloader(void)
{
    // If USB is used, detach from the bus and reset it
    USB_Disable();
   
    // Disable all interrupts
    cli();
   
    // Wait two seconds for the USB detachment to register on the host
    Delay_MS(2000);
   
    // Set the bootloader key to the magic value and force a reset
    //Boot_Key = MAGIC_BOOT_KEY;
    wdt_enable(WDTO_250MS);
    Delay_MS(500);
((void (*)(void))0x7000)();
    for (;;);
}
--- End code ---

The next thing I will do is some troubleshooting of the USB hardware to see if I can find something.

caiser01:
Okay, I combined the two original hex files from xyphro's repository with this command:


--- Code: ---srec_cat BootloaderMassStorage.hex -Intel TestAndMeasurement.hex -Intel -o UsbGpib-combined.hex -Intel
--- End code ---

Then I programmed that combined hex file to one of my five working adapter of xyphro's hardware design using this command:


--- Code: ---avrdude -c atmelice_isp -p m32u4 -e -Ulock:w:0x3F:m -Uefuse:w:0xcb:m -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m -U flash:w:UsbGpib-combined.hex
--- End code ---

Right away the LED started flashing. I shorted the two pins on the programming header and the virtual USB drive appeared on my PC as expected. Unplugged and replugged the USB cable and then connected the adapter to my HP 5385A frequency counter. The USBTMC device became visible and then I was able to talk to the counter interactively from Python.

So the hex file attached below when flashed to the hardware I have results in a working UsbGpib adapter.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod