Lantana

Moving to Codeberg

I have migrated all my source codes from GitHub to Codeberg.

Codeberg is a community-driven software development platform operated by Codeberg e.V., a non-profit association based in Berlin, Germany. I am a supporting member of this association. The platform is based on Forgejo, a Gitea fork.

Three of my projects remain fully mirrored on GitHub:

You can continue to open issues and pull requests there. All my other projects are now archived on GitHub, and the development takes place on Codeberg.

You can also log in via GitHub and GitLab there, so you should have no problem with continuing to send me bug reports and pull requests. You don't need a separate account to do this.

I did not make the decision to move to Codeberg lightly. There are two main thoughts that made me do it.

  1. The recent history of the former Twitter platform showed me how fragile a social network can be when it is under the control of a commercial company. I deliberately chose the federated platform Mastodon as my new home because it is not owned and operated by a single company. As a non-profit association, Codeberg is also owned by the community.

  2. I am deeply concerned about the recent events in the US following the inauguration of Donald Trump. Therefore, I want to reduce my dependence on US-based commercial platforms as much as possible. I prefer to act in time rather than having to react when it's too late.

Image: The Forgejo mascot by David Revoy (CC-BY 4.0)

Batteryless OP-1

The Teenage Engineering OP-1 (classic) The Teenage Engineering OP-1 is a portable synthesizer and sound recording system. I got one in 2016 because I was fascinated by its abilities that were shown in many YouTube videos. But to be honest, my musical talent is limited, and so it became more of a toy that was finally stowed away in a cupboard for several months.

When I took it out again, I found the battery deeply discharged. Considering the age of the battery, I decided not to charge it again, because there is a risk that it would swell and damage the OP-1. Instead my plan was to remove the battery and use the OP-1 without it, since I don't make use of its mobility anyway. It would then need to be connected to USB power for using it, but that would be absolutely fine for me.

I also found reports of people where the battery did not charge anymore, or was already depleted after a couple of minutes. There are many reasons for a battery change.

Note that this article is about the classic OP-1, not about its successor, the OP-1 field.

Removing the Old Battery

CAUTION: Be very careful when handling LiPo batteries! Do not use sharp blades or pointed tools to remove the old battery. Never use force and avoid physical damage. Never short circuit the battery! Make sure that the terminals of the battery cables cannot accidentally touch each other. If you notice any swelling or unusual heat, stop using the battery immediately. Dispose of batteries properly, following local regulations.

If you should still have a warranty on the device (for any reason), it will be voided with the procedure.

There is a good guide at iFixit about how to open the OP-1 and remove the battery. To do so, you need to remove the back panel and a couple of the keys that hide the case screws.

On my OP-1, I found out that it wasn't necessary to remove the back panel. The battery was only lightly glued to the case, and I could carefully remove it with the connector ribbon cable still in place.

All necessary keycaps, and scissors mechanisms, are removed to uncover the case screws. The opened OP-1, with the battery already removed.

The battery connector needs to be lifted up, not pulled to the side. Although I was careful, I broke the terminals out of the connector's housing. It was okay for me, since I intended to use the OP-1 without battery anyway.

However, my plan failed…

The Disappointment

After I removed the battery, I powered the OP-1 via USB, and turned it on. Unfortunately it crashed after a few seconds.

A screenshot of the crash. I wish the source code was open.

I later found out that the OP-1 works without battery when plugged into a USB charger, but it crashes almost immediately when plugged into the USB port of a PC. Since this is the only way to access the file system of the OP-1, running it without a battery does not seem to work.

Well then, let's order a new one and get the OP-1 fixed properly. It's a LiPo 055070 (aka 505070) battery with 3.7V and a capacity of 1800mAh. In case you also broke the housing of the power connector: it's a Molex Pico-EZmate receptacle crimp housing, 1.2mm pitch, 2 circuits (part number 781720002).

A New Battery?

And here comes the next disappointment.

Teenage Engineering refers to iFixit as spare part vendor. However, iFixit does not sell these batteries in Germany, and they seem to be out of stock in other countries.

Then I asked the manufacturer for help. They answered that they had no replacement batteries for the OP-1 in stock, and that they don't know when or if they would ever be in stock again. Their suggestion was to keep using the original battery.

I searched the internet and asked retailers for replacement batteries, but to no avail. So I was stuck. The OP-1 wouldn't work without batteries, and a new fitting battery was nowhere to be found. Would I have to throw away my OP-1 which is still looking almost pristine?

Going Batteryless

The simple answer is: No. I could use any other LiPo battery with 3.7V and similar, smaller dimensions. It would have a smaller capacity, and would need to be charged more often, but otherwise it would be okay.

However, my original goal was to use the OP-1 without any battery. I would have to find a way to make it run when connected to a PC.

I started an experiment. Instead of a battery, I used an electrolytic capacitor. The first one I found in my tinkering box was a 470µF 35V type, and I connected it to the battery connector with alligator clips.

Capacitor connected to the battery connector.

A first test showed that it fixed the crash, and the OP-1 now even started when connected to the PC. However, when I tried to establish an USB connection for transporting files, it now immediately shut down.

I tried the biggest capacitor I could find in my box, which had 4700µF 16V. This time, the OP-1 did not crash anymore no matter how hard I tried. Unfortunately, the 4700µF capacitor is far too big to fit into the OP-1 case.

What fits perfectly though are coin cell supercapacitors. I ordered two Eaton KR-5R5V155-R EDLCs (1.5F, 5.5V), but basically any supercapacitor can be used that is not higher than 5mm and is rated for voltages of 3.7V or more. Also, one supercapacitor would be sufficient as it would still exceed the capacity of my test capacitor (4700µF = 0.0047F) by far.

My tests with the supercapacitors were very promising. When I used both of them, the OP-1 was still working for about three seconds after being disconnected from USB.

WARNING: Using supercapacitors instead of batteries is experimental. If in doubt, always replace your old battery with a new LiPo battery!

Never perform firmware upgrades after this modification! It is possible that the device relies on sufficient battery power during the upgrade process. Your device could become bricked!

Also remember to always turn off your OP-1 before disconnecting from power, to avoid data loss and file system corruption.

I 3D-printed a frame for the capacitors and put it into the space of the original battery. Since the case is made from milled aluminum, it is important to take care for proper insulation! The bottom side of my frame is solid for that reason.

The printed frame, with two supercapacitors placed inside. The contacts are covered with kapton tape. The frame is placed into the space of the battery.

And that's it! Now I have a batteryless OP-1. Even though it needs to be permanently connected to a USB power source now, I never have to worry about old or deeply discharged LiPo batteries again.

What I've Learned

To be honest, I was very disappointed with Teenage Engineering. The OP-1 was an expensive item. It's ok for me if the manufacturer doesn't offer warranty after this long. It's also fine if they don't have spare parts in stock after almost 10 years.

Still, I wish they had a better solution to offer than just suggesting that I keep using the original battery, even at the risk of swelling (which would ruin the case and be a potential fire hazard). In essence, they were telling me to throw away a machine that was otherwise still good.

Fun Fact

By the way… Did you know that the actual display of the OP-1 is much larger than the window of the case? About the bottom third of the OLED display is unused.

Closeup of the display. It is actually much larger than the case window.

Fedora, Darktable and Canon CR3 files

Note to myself, but maybe you found this article via search engine... 🙂

Symptome: You are trying to post-process a Canon CR3 RAW image file with Darktable, but it doesn't show any CR3 files.

Reason: Darktable uses LibRaw for reading CR3 files, which in turn uses exiv2. New file formats are not compiled into Fedora's exiv2 though, presumably for licensing or patent reasons (see this bug report, tl;dr).

Solution: Uninstall Fedora's Darktable version (either via dnf remove darktable or flatpak uninstall darktable), and install the flathub version via flatpak install darktable.

If you used the dnf version, you can copy the ~/.config/darktable directory to ~/.var/app/org.darktable.Darktable/darktable to keep your Darktable configuration.

RetroChipTester firmware update

The Retro Chip Tester (short: RCT) by Stephan Slabihoud is a chip tester that can test an incredible amount of RAMs, logic chips and other retro components. The good thing is that it is also affordable and fun to assemble.

After I skipped three updates, I thought that a firmware upgrade to the current v0.26 was now overdue. This article is rather meant to be a guide for myself, but maybe you will find it useful as well. It is only about a firmware update though. For an initial setup, you will first have to set the fuses of the ATmega, which is not part of this article.

To perform this update, I used a Fedora Linux with avrdude installed, and a Microchip PICkit 4 (just because I have one at hand). Other programmers will do as well (see the RCT documentation), maybe it's even possible to use a Raspberry Pi for it.

First I connected the PICkit to the ISP connector of the RCT:

1MISOMOSIGNDSCKVcc/RESET23456

Signal PICkit RCT
(NC) ⯈ 1
VTG 2 2
GND 3 6
MISO 4 1
SCK 5 3
/RESET 6 5
MOSI 7 4
(NC) 8

Please check twice that everything is connected properly, otherwise you can damage your hardware. Also remove an SD-Card reader module (if present), as it will block the ISP port.

According to the documentation, the RCT must not be powered by an external power source and the programmer simultaneously. The VTG line does not provide power though, but is used as a target voltage input by the PICkit. It is still necessary to power the RCT externally (e.g. by USB or by a barrel plug).

I then downloaded the firmware and unpacked the zip file. Now all there was left to do is to change into the directory where the archive was unpacked, and run avrdude:

avrdude -Cavrdude.conf -v -patmega2560 -cpickit4_isp -Pusb -xmode=avr \
  -Uflash:w:Chip-TesterPro-FW-v0.26.hex:i

(Remember to amend the bottom line to match your firmware version.) If the following error should appear, just run the command again:

avrdude jtag3_open_common() error: PICkit 4 in PIC mode detected
        switching to AVR mode
        please run Avrdude again to continue the session

If the flashing process should fail, you can always fix the problem and do another flash attempt.

Sidecar Restauration, Part 3

In the third and final part, I am going to futureproof the Sidecar and finally test it. Will it work after all the hours and patience I put into the repair?

Gotek Drive

I probably only own a single 5¼" floppy disk, back from my time at school. However the Sidecar won't do much without floppies, so I decided to add a Gotek drive.

The modification must be fully reversible, and I also wanted to keep the original look of the Sidecar with its floppy drive. I designed a Gotek bracket for the expansion slot and a control panel with OLED display and encoder. The panel is screwed to the front air grille, so no holes need to be drilled into the case.

The Gotek bracket on the expansion slot. The control panel, ready for mounting. The control panel, mounted to the front of the case.

I made a new flat cable to connect the Gotek drive and the floppy drive to the mainboard. The Gotek drive is supposed to be drive A:, while the floppy drive should be B:. Both drives can be configured with jumpers, so there is no need to make a twisted floppy cable.

First Test Run

For the first test run I did not connect the Sidecar to the Amiga yet. If something on the Sidecar was badly broken, it wouldn't damage the Amiga that way.

So I turned on the power. The fan spun up, the power LED lit up, but nothing else happened. Well, since the Sidecar is not meant to work as a standalone PC, this is probably normal. At least there was no magic smoke and no smell of smoldering electronics. I took the opportunity to check the voltages, and they were all correct and stable.

Things looked pretty good.

Making a Janus Workbench

The Sidecar is controlled by the Amiga. It has no connectors for a monitor or keyboard. Fortunately, the driver disk can still be found on the internet. For installation, I first had to make a copy of the original Workbench 1.2 disk, and then run the installer from the install disk.

On my Amiga 1000 however, the installation failed because the RAM disk ran out of memory. My Amiga is equipped with the maximum 512KB of Chip RAM, so it was supposed to work. I tried it multiple times, but always got this strange error.

I gave up and set up a UAE instance of an Amiga 500 with Kickstart 1.2 and 2 MB of Fast RAM. On this machine I was finally able to complete the installation.

The installer is a bit strange and not based on the Amiga installer tool that came later. It is best to use the default options and wait patiently for each step to complete.

Test Runs and Fixes

My test configuration, with the Amiga 1000 and the Sidecar. It takes a lot of space. It's finally time for a real test run.

Connecting the two devices isn't easy and can damage the hardware if done wrong. First I unplugged the power cords from the Sidecar and the Amiga. Then I connected the Sidecar to the expansion port of the Amiga. It's a bit tricky to find the correct position, but the joystick and mouse connectors are a good orientation guide. There is no need to use force.

The Sidecar also has a power cord extender. I plugged it into the Amiga's power connector and made sure that the Amiga's power switch was turned on. Both devices can now be controlled with the power switch of the Sidecar.

CAUTION: You must never turn on power to the Sidecar unless the Amiga is already powered up. Otherwise you will damage your Amiga! You can avoid this problem by using the power cord extender and making sure that the Amiga's power switch is always on.

Now it was time for the truth. I booted the Janus Workbench I prepared above, but got a Guru Meditation during startup. I tried other driver versions and other floppy disk images I could find, but it always ended with the flashing red square.

Fortunately, the hardware registers are well described in the A500/A2000 Technical Reference Manual, Section 4.1. The description is for the A2088XT bridge board, but it is very similar to the Sidecar.

I quickly hacked some small diagnostic tools. They confirmed that the 128KB bridge RAM and the six replaced bus drivers were working fine.

I also found that the PC reset did not work. I only managed to actually reset the PC once. It played a chime and then actually accessed the MS-DOS disk I had in the Gotek drive. This means that the PC side was basically working, but the bridge board was having problems.

There are four PALs and three FPLAs on the upper board. The PALs have a specified memory retention time of about 20 years, which is long past. I remembered that the PALs on my MaestroPro were already having memory problems due to old age.

The fusemaps of the PALs can be found on the Amiga Wiki. I replaced the four PALs with modern ATF16V8C-7PU GALs.

After that I was able to reset the machine reliably. The Guru Meditation was also gone when I booted the Janus Workbench. But the Sidecar still refused to come back out of retirement. What I got now was a garbled PC screen.

No Guru Meditation, but the screen content isn't good yet.

But I was on the right track! There is also a single PAL (and two FPLAs) on the lower board. I replaced this PAL as well, and also replaced the ribbon cables that are connecting both boards. The original cables still looked good, but the wires may have been damaged or corroded, and replacement is cheap.

The Sidecar with the replaced PALs and new cables.

Next attempt. And finally, this time I was successful! I tested the machine for about an hour, formatted some floppy disks I bought somewhere, started Turbo Pascal. Everything worked reliably, and it was impressive to see MS-DOS running in one Amiga window and still have the full power of Amiga's multitasking to run Amiga software.

MS-DOS in one window, Amiga Workbench and Clock in other windows.

I was lucky. The PALs were easy to replace, as compatible GALs are still being produced today. The FPLAs can also potentially lose their programming, but there are no modern replacements. Mattis Lind designed a replacement board that uses a modern CPLD, but there are no corresponding JED files for programming them.

And there it is, my fully restored and futureproofed Commmodore A1060 Sidecar!

The Sidecar, fully restored, and with Gotek controller.

The restoration was much more difficult than I expected. There were many bad surprises waiting for me, and more than once I was close to giving up the project and storing the Sidecar away for later.

This beast is difficult to repair. First of all because of its size. The Amiga 1000 plus Sidecar was too big for the table in my tiny workshop, so I could not use my scope. Also there is not much use in running the Sidecar alone, so you always need a running Amiga 1000 for troubleshooting. Third, it's hard to find a place to put the Sidecar's PSU while probing the boards. The open nature of the PSU also poses a risk of electrocution if accidentally touched. All in all it was an interesting experience and I have learned a lot about Commodore bridgeboards in general and the Sidecar in special, but I probably wouldn't do it again.