Products > Test Equipment

open source GPIB adapter

<< < (20/42) > >>

deepfryed:

--- Code: ---avr-size --mcu=atmega32u4 --format=avr TestAndMeasurement.elf
AVR Memory Usage
----------------
Device: atmega32u4

Program:    9190 bytes (28.0% Full)
(.text + .data + .bootloader)

Data:        241 bytes (9.4% Full)
(.data + .bss + .noinit)

--- End code ---

I shouldn't take a lot of space. I followed the instructions on getting the bootloader flashed, unplug and plug usb back in, short pin 4 & 6 of the ISP header (MOSI & GND) for abour 3 seconds and the bootloader should appear as a flash drive. Mount it and then copy the file across


--- Code: ---sudo mount /dev/sdb /media/avr
sudo dd if=TestAndMeasurement.bin of=/media/avr/FLASH.BIN bs=512 conv=notrunc oflag=direct,sync
sudo umount /media/avr

--- End code ---

This works as advertised for me.

dazz1:
For me the problem is that the FLASH.BIN file is taking up 24kB of 32kB memory, so no room for the measurement app file.

deepfryed:
what is the FLASH.BIN file ?

There are 2 artefacts, the bootloader.hex and the TestAndMeasurement.bin files. The bootloader is programmed through the avrdude command as described in the readme.

Once the bootloader presents the device as a flash drive, you copy the  TestAndMeasurement.bin file to the drive and name it FLASH.BIN, that way the bootloader can program the flash once the file is written.

avr-size tells me TestAndMeasurement.elf is about 9K, should not be anywhere close to 20k+

dazz1:
FLASH.BIN  appears way back in reply No.41.   I missed the bit about renaming it.
I will do what you have done and that should work.

dazz1:
Hi
I didn't do what you said.  I tried something else. 
I started by copying the TestAndMeasurement.bin file to FLASH.BIN.  Same file, different name.
For all of the commands below, the USB-GPIB adapter was connected to a usbasp programmer via the ISP connector. 

I ran this command in Linux:

--- Code: --->$ avrdude -P usb -c usbasp -p m32u4 -e -U flash:w:FLASH.BIN
--- End code ---


and got the following messages in response:


--- Code: ---avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "FLASH.BIN"
avrdude: input file FLASH.BIN auto detected as raw binary
avrdude: writing flash (9312 bytes):

Writing | ################################################## | 100% 5.40s

avrdude: 9312 bytes of flash written
avrdude: verifying flash memory against FLASH.BIN:
avrdude: load data flash data from input file FLASH.BIN:
avrdude: input file FLASH.BIN auto detected as raw binary
avrdude: input file FLASH.BIN contains 9312 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 4.74s

avrdude: verifying ...
avrdude: 9312 bytes of flash verified

avrdude: safemode: Fuses OK (E:F3, H:D8, L:FF)

avrdude done.  Thank you.
--- End code ---

After this, the status LED started flashing on the GPIB adapter.  So this looks like success.

I like writing this sort of thing into Linux shell scripts to reduce the chance of error.  I have 4x more adapters to build and program.  A script means I can exactly reproduce a complex command sequence.
My script looks like this:


--- Code: ---#!/bin/bash
# uploads usb-gpib firmware to usb-gpib adapter.

# version 1.2 13 Nov 2023


avrdude -P usb -c usbasp -p m32u4 -e -Uefuse:w:0xcb:m
avrdude -P usb -c usbasp -p m32u4 -e -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m
avrdude -P usb -c usbasp -p m32u4  -U flash:w:BootLoader.hex
# -> yields
#  avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)
# copy the TestAndMeasurement.bin file to FLASH.BIN.  Probably not necessary, but it worked.
# This command loads the firmware.
avrdude -P usb -c usbasp -p m32u4 -e -U flash:w:"FLASH.BIN"
# run this command to read and verify the firmware
avrdude -P usb -c usbasp -p m32u4 -U flash:v:"FLASH.BIN"
--- End code ---

At the end of running these commands, the status LED slowly flashed on the usb-GPIB adapter.    So it all appears to have worked.
I then tried shorting the two ISP pins to try and get the adapter to appear as a drive, but that didn't work.

The final test I haven't done is to try controlling a device.  I have a HP 3478A multi-meter.    I just need to find some software compatible with the adapter.  One I tried was looking for a COM port.

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