A Replacement ULA for the Acorn Electron!

It Changes EVERYTHING! (If you have an #AcornElectron with a broken ULA) But seriously, this is an important moment in retro and we should all be really grateful that people like @mogwaay and The Board Folk are giving us these things to keep our systems alive

All your computers are dying!

As we all strive to scratch our nostalgia itch, the effects of time passing on these old machines is a growing problem. Old plastics are breaking down, capacitors are drying out, and components that were never expected to last for more than a few years are spontaneously expiring just when we need them to give us our Jet Set Willy fix. Custom chips can be especially difficult to replace. Popular computers like the commodore 64 and Sinclair ZX Spectrum are well catered for and it’s now possible to build entirely new versions of those micros using brand new parts.

But what about some of the less popular machines?

How about the Acorn Electron? In the UK market this was meant to be the ZX Spectrum killer. And if a young Bilbo Baggins had managed to release it in time for the Christmas rush it might have been a big hit.

For viewers watching from other regions who might not be familiar with the little Elk, this machine was meant to be a cheap, cost reduced version of the BBC Micro.
What’s a BBC Micro? Oh come on America!
Ok, the BBC Micro can be thought of as the British Apple 2. I hope that makes things clear.
Now the thing about the 1981 BBC micro is its one of the few machines, certainly one of the few very successful machines, that you can build from scratch today using all off the shelf parts. Most other machines released after that time were designed with cost in mind, and one good way to reduce the cost of building a computer is to amalgamate as much of the logic as possible into fewer chips. Which is where ULA’s or uncommitted logic arrays enter the picture. The ZX Spectrum ULA combines almost all of these chips here into this single 40 pin package. 

Acorn took a very similar approach when they designed the Electron. A machine meant to compete at the value end of the market, but compatible (partially) with the much more expensive and very popular BBC Micro. 

But is there a risk attached to buying a condition unknown, works the last time I used it in 1986, electron from ebay? If any of the chips inside this machine are broken you don’t need to worry, not at all. All of them are easily replaced, and cheaply too. For example, this LM324N opamp here costs 98p. For ten! The logic is cheap, the ram is cheap, a rom can be replaced with a cheap eprom, and the CPU is a fairly standard 2mhz 6502. Yep. Nothing in here to worry about. What’s that? Oh don’t worry about that. That’s nothing. Just keep looking at all the other cheap chips.
Oh. Ok. Well that would be the infamous Acorn Electron ULA. This chip is, more than any other in here, the beating heart of this little machine. If this goes wrong, and they do, your Elk becomes an ornament. Quite a pretty one I think.

Currently the value of second hand electrons, is there a new value? Is pretty much as low as it will ever be. The last few auctions I can see on ebay sold for around £30. And I think it’s down to this: The risk of buying one with a faulty ULA is reasonably high. And if you have to replace the ULA the current going rate for one of those is around the same £30. Which makes no sense at all. The ULA you buy for £30 could expire almost immediately. It’s a frustrating state of affairs. And something that’s becoming more and more of a problem as they get older.
So what’s the answer?

Well the solution is to recreate the failing old tech, using new tech. As I mentioned at the start, the ZX Spectrum has new chips available, including the notorious ULA in that machine. This was reverse engineered by Chris Smith, and then other clever people such as Don Superfo came along and made a Spectrum that didn’t even need a ULA! There are also, more interestingly for the subject of this video, recreations that drop straight into the same socket. In the spectrums case the VLA82 by Charlie Ingley and the Nebula from Retroleum. But currently there isn’t one for the Acorn Electron.
Well. There wasn’t!
Chris Jaimesson, or Mogway, or Jamsoft, pick a name Chris! Is someone I’ve known through his positive interactions in the retro community, mostly on twitter, and more recently on my discord server. Which you should join. It’s awesome. Chris has come up with something that might be of use in bringing one of these destroyed motherboards back from oblivion. 

Let’s have a chat with him so he can tell us exactly what he’s been building in his techno cupboard. 

Why the Elk?

Well I didn’t have any experience with Electrons growing up we had two BBC’s when I was young and after picking up the nostalgia bug I was like oh I really fancy getting back into the Acorn world. So the first one that you got was it broken? Yes! I picked up one on the infamous Facebook sale where it was on a drive I saw pictures of this driveway covered in electrons and I picked it up and I was thankful the case was in really good condition it was very poorly packed it came in good condition but I had a little peek inside and yes no ULA and then it was Twitter user Scurvy Geek who got back to me and said gave me a little Ray of Hope and said well I think there’s a few people working on ULA Replacements so I kind of thought well could I fill a niche there is there just a bog basic like I just want the elk to be an elk could I just find a bog basic Electron replacement so I thought how hard can it be! But at just at that time I was looking at it I started Eric Schlaepfer who’s known as TubeTime who’s a reverse engineering wunderkind he’s done a lot of great stuff on the PC side of things he released the Graphics Gremlin which was an ISA card which could do CGA and MDA on an FPGA and he open sourced it entirely again and I could basically crib the basic FPGA plumbing from the Graphics Gremlin as my basis to build upon to do my own Spin and add the little bits I needed to get it going on the Electron for ULA so really I’m taking my I’m standing on the shoulders of  giants so I took David Banks’s amazing ULA code and I mixed it with the Graphics Gremlin and stuff and kind of smashed it together and that’s how it came about really.

Thank you Chris. And well done for bringing this project to the community.
Chris has very generously sent me a prototype to build and try out for myself. But before we get into that we need to look at these. 

All four of these boards were very kindly sent to me by Dave Hitchins who some time ago picked up a big score of Electron motherboards and various other parts. These are from a notorious haul of scrapped Acorn Electrons from a Facebook seller not very far from me. In fact my own Electron came from that very same seller. I think the story goes that these are originally  from a repair shop of some sort and many of these boards were scrapped for their parts. Which, looking at the condition of the four boards here, makes sense. When I bought my own machine from that seller it was complete but not working, I made a video about its repair which is probably in the corner of your screen right now. If I remembered. 

To give this new ULA a home I need a board to install it into.

Let’s take a closer look at these boards and try to pick a winner. 

There are three issue 6 and one issue 4 boards. 

The issue 4 board, at first glance, seems to be in the best condition. Only missing its CPU and ROM, IC17, and of course it’s ULA. Although the ULA socket is still here which is a good thing. Meaning there will be less chance of damage in this important area. Unfortunately there is some damage here near the CPU. I think I can resurrect that if I need to. That doesnt look too bad. There’s a missing pad there. I’ve labelled this one board number 1. And so far it seems to be promising. Number 2 is the first of the three issue 6 boards. This one is missing IC19, the ROM, the CPU and the ULA looks to have been ripped from the board. There are bits of metal sticking up and four of the pads are obviously missing. This is low on the list, but not impossible. All of the memory is present, but all of the decoupling caps looked to have been chopped off. I honestly don’t know what’s going on here at the keyboard connector. 

On the other side – well that just looks nasty. A huge glob of molten solder was just dumped here. No idea why. But the back of the ROM and CPU are looking grim and the ULA vias have suspicious bits of leg still hanging on. 

The top of board 3. The keyboard connector is the same grotty mess, the ROM is here! That’s a bonus. The CPU is missing, and at first glance there don’t seem to be any missing or ripped traces. The RAM is all missing but it seems to be neatly done. And the ULA is no longer there, but there seems to be less burning and devastation. And the back? Well this could clean up. There are no obvious missing pads or traces. But that green inner square of the ULA area does look a bit suspect. I wonder if this has delaminated. This one is on the maybe pile.

Board 4 is quite similar to 3. It has no ROM, but it does have all the RAM. Someone really didn’t like ceramic disc caps, did they! Maybe rats ate them. And the other side looks like it could be a winner too. I can’t see any obvious damage, but like all the others I will need to clean up and give all of these a thorough inspection before I decide which one to bring back.
And hopefully we have a candidate for resurrection. 

In the end I narrowed it down to board number 3. Even though it has this delamination it doesn’t seem to be affecting anything important.  the rest of the board looks in very good condition after a bit of cleaning.
I removed all of the chips, testing them all outside the board in my TL866 minipro programmer, which is not a perfect test, but should show up anything totally broken, and replacing the grotty keyboard connector, and then installed sockets in all the places where the chips needed to go. Just in case. 

A few passive components needed to be replaced. I borrowed these along with a set of memory chips from one of the other boards.

In the ULA position I used strips of turned pin headers to create a socket. And to make sure it was the right size and shape I did in fact desolder my own ULA to use as a guide, holding the pin headers in place whilst I soldered.

I switched it on with the original ULA installed and it worked!

So that’s a working board that’s missing a ULA.
Now we get to the interesting bit! Is it possible to build a working ULA using all these parts?

I’m a big fan of SMD soldering, but I have to say I was a little apprehensive to say the least when I saw the size of the components and how close together they are on the board. These are mostly 0402 parts, which means they are 0.04 inches long and 0.02 inches wide. Here is a banana for scale… 

Ok, something more sensible. Here is a normal quarter watt resistor.

Even with eye magnification I can’t reliably see these sized parts well enough, so it’s time for my trusty microscope. I say trusty, I actually lost quite a lot of footage recorded on the scope. Including all of the chip soldering, so not as trusty as I would like, but the work went pretty smoothly overall so you didn’t miss too much on all of the fun stuff. 

The kit Chris sent over comprises of 2 boards. The lower board is the one that has just a few components needing to be installed. I thought it would be a good idea to get my practice in on this board before turning to the top board where there was a lot more to do in a much tighter space. And being aware of the tiny scale of things here I switched to a tip I don’t normally use, hoping it would give me more precise control. I see lots of skilled technicians using these witches’ nose tips, and I just don’t know how they do it. I found it quite frustrating to use. Normally with a chisel tip I can control where the solder will be on the iron, but with this one it just doesn’t like to be near the pointy part of the tip. And being round I couldn’t get it to touch the pad and component at the same time. Before too long I switched back to my chisel tip and found that much easier to use, if a little bulky. In fact with some of the components I found it easier to flow some solder onto the pads first and then just blast it with hot air.

This bottom board carries lots of heavy traces, especially the ground and 5v points. This capacitor here refused to attach at the end close to that via. The solder flowed nicely onto the end of the cap but the iron couldn’t carry the heat into the pad. 

It looks soldered here, but if you look carefully you can’t see any shiny solder on the pad. And heating the other end? It wasn’t attached. I grabbed the heat gun and blasted it with 400 degrees hot air. Something I would need to do quite a few times further into the build.

These castellated resistor arrays were to prove very tricky. There’s just the one on this base  board but you’ll see a few more on the top board. And they gave me quite a few headaches.

I assumed they would be reasonably simple, a bit of drag soldering on both sides and job done. 

But that big heavy plane of copper to the right joining all four of the connections on that side was just sucking the heat right out of my iron. It was all a good learning experience though. 

Let’s try that again!
This time I want to get some solder onto the pads before attaching the part. That can help conduct the heat into the board. Two of them just don’t want to take the solder though, so I have bumped up the heat on the iron to 400 degrees. That’s got another one. And. Oh that looks a bit messy. Yeah, it’s not improving the more I try. Flux will sort this out though. Again with the hot air gun.

You can see the solder flowing and then instantly freezing again as soon as the air is not pointed right at that spot. I’m not sold on this one being attached so here is my multimeter in continuity mode. And testing from the top of the connections on the resistor they are all connected on the tricky side. 

As I said, all of the footage of the chip installations was sadly lost. But you can see the chips in lots of this footage and they are all perfectly installed. I checked each pin was securely attached, and tested between all of them with a multimeter, checking for bridges.

More resistor arrays. I’m getting a better flow going (ho ho). Although that pad under the 5 on RN1 here looks suspect. We might come back to this later!

That’s all the components fitted. 

Chris informed me this version of the board would require a couple of small bodges to work correctly. These have already been fixed in the most recent updated version. I just need a couple of wire links… and a capacitor. And one big chunky resistor over here on the side.

Next I went around every part of the board checking for shorts. I checked all the legs of the chips again, and all of these resistor arrays. I checked between ground and the various power rails and found no problems.

With the soldering completed I moved on to programming the FPGA. A process I’m not familiar with or comfortable explaining in detail here. Rest assured Chris has a comprehensive guide for all of this and more on his repository (link in the description). There are certain types of programmer that you can buy which make this process fairly simple, just a few command line commands and files in the right place to start with. I ordered one of those programmers from Amazon. Amazon delivered something totally different, I think these are stepper motor drivers. Chris said “don’t worry! I will order you the right thing and get it delivered tomorrow” A package arrived the next day from Amazon. Aaaaaand it was the stepper motor thingies again. He’d ordered the same thing I had!

And so we stepped into the murky world of Linux. Or at least that’s how it feels to me. I appreciate it’s a wonderful operating system and can do so many incredible things, is super stable, reliable, mostly free etc, but that doesnt mean I know how to use it.
Chris found a way to program the FPGA using a raspberry pi. Something he then added to his repository to help anyone thinking of building one of these. A proper programmer will be a simpler process, but to help keep costs down you can use just about any pi you have laying around. He actually did the testing on the original Pi 1. I had a few pi’s to choose from but thought having a keyboard already attached would be helpful so I opted for my pi400. 

Using the guides from Chris’ repository I attached the pi to the programming connectors on the ULA board. As I didn’t have the right gendered wires I ran them through a breadboard to the GPIO pins on the back of the pi400.  Then I double checked those connections. Then I checked them again. I installed Raspberry Pi OS and started following the guide Chris had provided. Then I got immediately lost and, close to fake tears, I messaged Chris asking for help. Chris is a brilliant bloke and spent a couple of hours guiding me through the process one command line at a time. And in the end we did it! 

It was finally complete!

Excited, I plugged it carefully into the test board and switched it on. 

My bench power supply immediately complained and went into voltage limiting protection. 

Oh no!

Was it something I did? I switched the FPGA board over to my own issue 4 Electron in which I’d already fitted some pin header strips for the original ULA. And this time it didn’t current limit. But it also didn’t work.

Some hours were spent pouring over both the now broken Electron motherboard, and the sadly non working ULA replacement.

On the issue 6 motherboard it took an embarrassingly long time to work out that a tantalum cap had given up and was shorting out the 5v rail directly to ground. A bit of measuring the relative resistance with a multimeter and finding out which side of the board was more shorted than the other pointed to this cap here. Removing it removed the short, and replacing it brought the electron back to life once more. 

But the ULA was still not working. 

During a very busy few days I went back and forth with Chris during snatched moments of time, with him feeding me clues on what to look for and where. Eventually, after a few red herrings, we found that two of the data lines were missing altogether, and using his excellent schematics I followed these lines from the FPGA, through the level shifter next to it, and into these resistor arrays. That’s not connected. Yep. Those pesky resistor arrays. Checking for continuity with the nearby pins I found one of them was not actually connected. I gave it a careful reflow and checked again. It still didn’t work. Well, chances are if one of them was not connected then others could be the same. I checked every connection from all of the resistor arrays around the board and found that quite a few of the connections were not making it through. There’s probably a better way to make these flow but in the end I got there with my chisel tip iron and hot air station. 

And then?

It’s working!

The case is beautiful it’s such a lovely little machine so I’m really hopeful that some of those can kind of come back to life and give people enjoyment. Secondly I’m also hoping that if an idiot like me can build one of these things then you know there’s hope other folks that might be inspired to give it a go too

So now what?

Well before I get to testing this I want to look at what I have here. This is my Acorn Electron I’ve had for a while now. It works fine, has an original ULA inside, and I don’t need to do anything with it. This Electron I recently bought from Julian from my Discord. It has a lovely case, in good condition, and the best thing about it is it doesnt work. This is going in the repair pile, and Im hoping it wont need a new ULA but if it does, well we know how to fix that now!
These four boards are a problem. I’ve already brought this issue 6 back to life, and the issue 4 should be fixable with a few bodge wires around the CPU area, but what about these other two? This one (number 4) is in pretty decent condition, just missing a load of decoupling capacitors. The board itself is pretty good. But this one…the aptly labelled number 2, has some heavy damage around the ULA area.. Its had a hard life. 

It’s all fixable. But there’s quite a lot of work here and in the end I would need a ULA, a CPU, a ROM, all the RAM, all these caps, and I would still only have a working board without a case to put it into. The case contains the most important part you need when using a computer, which is, of course, the keyboard. But is there another way? 

Well yes, there is! And as a bonus there’s something I can do about that destroyed motherboard too…

This is a PS2 keyboard adapter for the Acorn Electron. Kindly sent over by its creator Ian, who goes by the name GrandOldIan and is one of the brilliant group known as the Board Folk. This turns a bare board without a case into a pretty much fully functioning Acorn Electron. Albeit a bit nude and without a proper power supply. You can run an Electron just using a simple 5v power supply, but for tape functions you need the -5v that the original supply, er, supplies.
Ian also included a bare board so I can make up another one of these. It’s super clever, just slotting over the keyboard pins here. And you can still have an original keyboard connected with this set of pins here. The modulator, which is much less useful than it used to be, needs to be removed and the PS2 connector sits in the space where your RF cable used to plug in. It’s a very neat and clever device.

As well as the PS2 keyboard connector Ian sent this. 

This is an issue 4 recreated motherboard. The Elk. Again, from the marvellous Board Folk. I believe credit is due to Rob Peepo Taylor, who has been involved with many amazing board recreations. This one is an early version they’ve tested and works. It doesn’t include any credits to its creators on the silkscreen, but they kindly allowed me to give it a look over.
I intend on taking the worst board, that last issue 6 we looked at, and transplanting all of its parts over into this board. But that will be for a future video.

Right. Now I have a working ULA replacement in my rescued Acorn Electron, and a clever PS2 keyboard.  What can I actually do with it? Well pretty much everything you can do with a standard Acorn, plus a little bit more!

I don’t have a fancy SD card loading device for the electron, but I can load games via the tape port using my TZXDuino. Here is one of my favourites – Chuckie Egg. You might have seen Adrian playing this classic on his recent Electron video. 

And here is a very interesting one. Zalaga, which might be a clone of a game with a similar name… is a really good looking game by Nick Pelling and I really got into the blastemup action. But there’s something going on here that isn’t quite right. When things get really busy it looks like there are frames being skipped. It’s not really hurting the fun but Chris has come up with a clever fix for this. 

FPGA chips come with something called BRAM, or block ram. Only a tiny amount in modern terms, 8k in fact, on this particular chip. Which happens to be a rather useful amount in the context of a machine with just 32k of usable RAM. So when you press a combination of keys, in this case Ctrl Capslock and 2, turbo mode is activated.
Turbo mode uses that 8k of BRAM on the FPGA and maps it to the first 8k of address space on the Electron. This duplicates the effect of a retro hack from back in the day called the Slogger Turbo. That one did clever trickery to shadow the lower 8k of memory, allowing the CPU to access it at its full 2MHz speed. On top of this the 8k inside the FPGA is a full 8bits wide, unlike the 4bits of the real ram on the motherboard, so even more performance is gained. There are other things involving the way the ULA accesses RAM for display purposes that I really don’t fully understand, but these also give performance boosts. If you really want to know more about this stuff you should watch RetroBytes John’s excellent video on the Electron in which he explains everything about the Elk in his usual brilliant way. “Remember when I said I’d come back to Ram well this is the moment where we’re going to come back to Ram” Or go ask Chris. He will pretend it’s all very simple and be all modest but the man is basically a raving genius. His explanation for my simple brain was “It’s like fast cache ram on PC”

The results of pressing the turbo mode combination keys is quite startling. The game runs slightly faster in general, but when the action starts to get really busy the dropped frames become far less of a problem. They’re still there, but it doesn’t affect the gameplay now. And what a great game! This had me laughing like a loon! It’s made a fun but slightly glitchy game into an insanely fun and still a bit glitchy game.

I’ve tried a bunch of games on this replacement ULA and, for me, it has performed flawlessly. There are bound to be some edge cases that make it fall over but this is a brand new thing and I’m sure others will take it even further. 

It’s been a fantastic project to work on. Thank you Chris for letting me loose with your amazing widget. I had great fun building it and the satisfaction of bringing a scrap computer fully back to life just can’t be beaten. 

I hope you enjoyed the ride as much as I did! Thank you for watching. I’ll see you in the next one! (you are subscribed right?) Bye!

Leave a Reply

Your email address will not be published. Required fields are marked *