2020. április 25., szombat

GP-IB 5. - V2.0 Board

When I wrote the previous part of this post, one of my friends complained, that was to short. I can promise. The current one will not be.

I already have several GPIB boards on my desk. Actually I have 1.0, 1.1 (and now 2.0) version of my board. One of the 1.0 boards doesn't work correctly. I meant, I need some diagnostics into the firmware to track down the problem. So I wrote a diagnostics extension to the current instruction set. It is able to manipulate the GPIB pins directly (I tried to resolve the error of this board, but the results were inconclusive).

v2.0 Board
To step forward, I soldered in the next generation board. It also need some software modification as it use ATMEGA32U4 instead of the ATMEGA328P on the previous one.

Everything went easy. Too easy.
The ISP programming was successful immediately. The software modifications took less than five minutes. The board upload worked, just right after fixing one single easy to handle bug.
Connected to my test HP3478A multimeter. Run a scan command. It immediately found the instrument and reported back the reading. The only gotcha was the reading characters appeared one by one slowly.

Next day - troubleshoot
I was thinking one unsoldered pin, and reading timeout cause the problem.
Fired up the diag mode, and realized that the D1, IFC, SRQ and ATN always reporting back high logical level, whatever I do.
Tracking down the issue - playing with the other boards - just came out, that the diag mode doesn't handle certain pins correctly. Modified the diag mode. It resolved the issues on the 1.0 and 1.1 boards, but not on this one. The D1 and the ATN issue remained.
Later on, somehow I figured out that those are used on the Arduino Leonardo board (what I was using as configuration and the bootloader of it) as RX and TX LEDs for the USB communication. Holly shit.

Redesign or fight?
The dilemma came here. I've two options:
Either I redesign the board, and send to manufacturing once more, or fight with the Ardunio bootloader, core, whatever. I chose to fight. Reasons:

  • Design and manufacturing has costs, and need several days (or even weeks) until the new board arrive
  • The ATMEGA32U4 has two externally accessible full 8 bit ports. Those can be used for faster communication with direct port manipulation. Unfortunately those LEDs are use one pin of each of this ports. So if I don't use them, I lose the speed here.
  • Digging deep is fun. I can learn a lot from it.

Blame the bootloader
Actually I don't know why, maybe I read something on a forum, I was thinking, I need to modify the bootloader, and it will resolve the problem (maybe the serial use it for the communication, I don't know)

New bootloader
First of all Identified the source code of the bootloader. It is located here (https://github.com/arduino/ArduinoCore-avr/tree/master/bootloaders/caterina). Checked the Makefile it also need a library called LUFA for the USB communication. I also checked this out. Added the latest Win64 compatible avr-gcc and make.
I tried various ways to point the Makefile to the LUFA, all of my attempts failed. Also it missed grep tool. I felt like the Windows is a dead-end for this build.

Switch to Linux
Didn't wanted to build a linux machine, or add a Hyper-V based Linux. So I fired up the Subsystem for Linux and installed the Ubuntu 18.04LTS from the Microsoft Store.
Installed avr-gcc, build tools, make, etc. on it.
Found the filesystem location of the Ubuntu in the Windows filesystem and copied the source code over.
It wasn't work. I got various permission issues with the copied files, so I gave up and cloned the repos once more.
Trying to compile gave the same errors as on Windows without the grep problem. After several path modifications, adding the USB VID and PID finally it started the build. The result was a catastropy:

The bootloader in question was built last time 8 years ago. Both the avr-gcc and the LUFA library stepped forward since.
Figured out what tag was used originally, switched the repo to it. Now the bootloader compiled successfully.

Testing with the new bootloader
I didn't wamt to hack it into the Arduino IDE so I flashed the bootloader manually to my board. Uploaded the code also. And....

and it failed.

Hack the core?
No. Even I figured out that the problem is probably in the USBCore.c, I didn't wanted to hack it. It wouldn't create a future proof solution.
Looking around and thinking lead me to create a custom Arduino board specification for my project.

New board config - not yet
First of all I wanted to have something I can learn from. I found an ATMEGA32U4 based custom board from ArachnidLabs (http://www.arachnidlabs.com/tsunami/), and the git repository for it: https://github.com/arachnidlabs/arachnidlabs-boards
It turned out immediately that I need a stable place to to host the json and the package zip. Something I can count on that will be there for a while. Something can be accessed without any authentication voodoo (like OneDrive).
As the AVR-GPIB project of mine hosted on GitLab, I was looking around there. As Github has Github pages, what a surprise, GitLab has GitLab pages.
I read through the documentation, it was still not clear, how to setup the GitLab pages.
Created a repo named suf.gitlab.io, put the files in there. Nothing happened.
Ok, it looks like I need a gitlab-ci.yml for building the site. This isn't surprising concept to me, as in the last few years I'm working as DevOps engineer. Writing Jenkins CI/CD pipeline scripts on daily bases.
Wrote the script, pushed the repo, failed. Some naming wrong. Corrected.
Next. Building correctly. The site still give 404 back.
After many tries realized, that my files from the GPIB subdirectory landed into the root of the site. I was thinking that it is because the root has no files in it, just the GPIB folder. So added an index.html.
The previously successful build failed again.
After reading many things, several trials, came out, that the only approach what is working, to add everything to a newly created temporary folder and rename (mv) it to public, what is the designated name of the publishing.
So my GitLab pages site born: https://suf.gitlab.io
It is small, it is yellow, it is sour, but ours (I know it is not got through in English, as it refers to an epic Hungarian movie from '69 - https://en.wikipedia.org/wiki/The_Witness_(1969_Hungarian_film)).

New board config - now really
Created the json, modified the pins_arduino.h (pointing the LEDs to two not externally exposed MCU pins), built the package, created the hash, added into the json, uploaded the whole thing to the GitLab, added the json to the Arduino IDE, went to the board manager and...
nothing happened.
Repaired two things looked like bug: name of the json. I don't know if it is a requirement, or just a kept convention, but renaming don't harm.
Realized, that I didn't change the length of the package file in the json, so now I did it.
Push to GitLab, back to Arduino, my config appeared in the Board Manager
Install: failed. There must be a single folder inside the package.zip.
Changed the required things, push to GitLab. Install now works.
Try to upload the code I wrote.
Getting weird inconclusive errors, communication problems. Switched back to Arduino Leonardo, getting the same errors. It smelled like problems with the Windows COM handling. Reboot resolved it.
Try to upload once more. There are missing avrdude parameters. Various parameter related issues. Finally I added into the package.txt whatever I found. It looks like that the ArachnidLabs config was written for an earlier Arduino IDE what doesn't require those parameters.
Now the board upload works.

Try it out
GP-IB diag functions now work as I expected. We are ready!!!!
The diag works, the communication with the instruments, not. Enough! Sleep!

Next day
It was something itching in my mind. Tried out the previously working boards. Stopped working those too.
Either my HP 3478A multimeter died, what I'm using for the tests, or the diag modifications what I did in the code later on, disrupted the communication.
Figured out soon: the diag was buggy. Fixed it. Now the v2.0 board works.

End of this story.
Will continue with the further hardware and software development of the GPIB adapter.

2020. április 14., kedd

GP-IB 4.

Nine month. Today exactly nine month ago written last about my GP-IB adapter (http://pakahuszar.blogspot.com/2019/07/gp-ib-3.html). Its been a hard delivery.
I'm announcing proudly the birth of the working GP-IB interface software. It still need to learn and grow. Things are missing from its skills like device mode and USBTMC capability.
Both the father:

The mother:

And the child:

In good shape:

And waiting for a long and prosper life.

2020. április 9., csütörtök

HP 3488A

This will be a long association chain. Just follow!
It is started with a picture on facebook about a Kenwood analog two channel AC voltmeter. It can be nicely used to check stereo audio equipment channel differences. I love the concept, but still I'm not an analog meter guy.
I was thinking. What if I pickup one of my digital bench meters and develop some desktop software around my own (still in development) GP-IB USB adapter, and add an uncontrolled MCU based channel switch. Uhh, this sound ugly, in addition, this is not the post where I will explain it. Just get it, I'm developing it, and publishing soon.
So go back: I chosen one of my HP 3478A 5.5 digit multimeter for this. And here come a few things.
  • I need a switch for the project
  • The display of the 3478A is a heap of crap without backlight
  • I don't want to kill the original display on those unit, so get something similar, cheaper.

As usual I was looking around the eBay. And look what I found. Two HP 3488A. those are loaded with cards (usually you can find it empty), for €102 delivered. So I bought it immediately.
It is a good practice for the display modifications, if they work (the seller didn't guarantied it), can be used as a switch for the project above, and also for other purposes. Also, it nicely fit into my test equipment collection.
So here they are:

First of all, I removed all of the cards, cleaned the units (get rid of all of the stickers, dirt)
Let see the inventory:

  • Two HP3488A units. One of it miss its power button. No stands.
  • Two 44471A General Purpose relay cards. One of it even has the connector block, the other don't
  • Two 44470A Matrix relay cards. Both of them with connector block, just from one of the blocks the plastic insert was missing

One misterious, HP branded, and hacked - some (not even nice) modifications are made by one of the previous owners.
This is the mysterious card, I would appreciate, if somebody can give me any info on it:

After a bit cleaning, I tried out the units. for the first smoke test, both looks like working, the self tests are succeeding, I can hear the relay click from console, and from remote GPIB commands.
As you know, I'm in the 3D design, and printing for a while.
Here I needed two missing plastic parts. One for the power switch replacement

And one for the connection block insert.
I designed both, in my regular OpenSCAD:

 Here they are printed:

Left is the original, right is the printed:

Now, the power button in its place:

Project of getting in shape the HP 3488A units now completed.

2020. április 1., szerda

2kW Bench Power Supply 2.

Please don't look for the first part under the title above! It was published as Few stories ...
It took a while to go further with this project.
I built and tested the my delay circuit mentioned here.

Works as expected.
Done all of the cabling, mechanical work, needed for the assembly.

I was choosing a C20 connector instead of the regular C14. The two power supplies can consume maximum 3kW, so I felt that a bigger connector is needed.
After almost of a year skip, I restarted my 3D printer. So I created a 3D printed back panel:

I made a short video shot to show how the delayed startup of the two supplies works:

So, this unit is working now. The only thing is missing, the computer control.
The two units originally has two separate optically isolated USB to Serial units. I wanted to solve this with one USB port. So, I ordered a dual channel FTDI module, what unfortunately not yet arrived.
The USB port already assembled to the back, it just waits for the module and an optoisolator board design from me. This will be the second phase of this project.