I was recently gifted an old 8-bit computer, an unloved BBC Micro that had gone up in a puff of smoke. As it turns out, the fault was a common problem with the X capacitors in the PSU, and easily fixed. Four keys also needed to have their switches dismantled and repaired, but after a good clean it was literally looking and working as new.
This was a well designed and well built computer, in fact I’m really quite blown away by just how impressive this computer is. The modern enhancements that people have come up with is, I think, testimony to just how well thought-out the design was. I suppose that, given many of the designers were also the people behind the ARM CPU, I shouldn’t be so surprised.
The hardware I was gifted included a dual 5.25″ floppy disk unit. This thing is heavy! A metal case, two PSUs, two drives, and all the magnetics that they required back in time. Surprisingly, all the disks in the two boxes I was given still work. My first instinct was to back them up somehow, so I bought a Turbo MMFS card, which drives a MicroSD card by bit-banging SPI on the BBC’s User Port. It comes with a custom filing system EPROM that contains MMFS. This is all pretty much enthusiast-developed stuff, and it works flawlessly.
The Turbo MMFS card came with lots of docs, one of which describes how to fit an 32K SRAM chip to an EPROM socket to provide two banks of ‘sideways’ ROM that can be loaded from disk files. This is handy for things like language ROMs, assemblers, monitors, word processors, etc. where you typically need the machine’s main RAM to work with.
I wanted to fit this chip, and while it’s a simple modification, all the docs I could find simply described what has to be done, but no explanations of ‘why’. So I decided to get my multimeter out and probe about, with the help of the original schematics.
I have since found more detailed documentation that I will link at the end – it was written by people more knowledgable than me, so it should be taken as canonical over what I have written here.
Making SRAM look like ROM
So, an SRAM can be written to by the CPU, while a ROM can not. The EPROM chip supplied with the TurboMMC card was of type 27256, and the SRAM chip suggested in the docs is a 62256. Both are 32K devices, and differ only at pins 1 and 27. The docs tell us to simply connect Pin 1 to IC76 Pin 11 or 12, and connect Pin 27 to IC77 Pin 8. So here’s why.
Compare the pinouts below. Pin 1 is Vpp on the EPROM, but A14 on the SRAM. Also, on SRAM, we have Write-Enable on pin 27, which is A14 on the SRAM.
These chips are very similar in terms of their pin arrangements. The SRAM has no need for a programming voltage (i.e. 12.5V on Vpp), and the EPROM has no need for a Write-Enable, since in operation it’s a read-only device.
Provide Write Enable (WE#)
The most important thing we need to do is provide the SRAM chip with a Write-Enable signal, otherwise there would be no way to get data onto the chip. We can see that the SRAM has an active-low write-enable (Pin 27), so this pin should be high when reading, low when writing. The suggested place to pick up R/W seems to be IC77 Pin 8, which is the NAND of R/W and the 2MHz clock. There are two other suggested points for a suitable signal, IC78 Pin 10 and IC73 Pin 24.
I think that the reason the WE# signal isn’t taken directly from R/W is because OE# is synchronised to toggle on the rising edge of the 2MHz clock, and the suggested pins give the synchronised inversion of this signal for WE#. Therefore, read and write are never activated simultaneously, because they can never both be pulled low at the same time.
We could simply patch SRAM Pin 1 to the EPROM socket’s A14; this would pull it high directly from Vcc. However, since the SRAM chip is actually 32K, and not 16K, instead of simply pulling A14 high, it can be connected to the chip that determines bank-selection (IC20, below) so that A14 is high or low depending on which bank is selected. Two banks from one chip.
IC76 is a 74LS163 (TTL Synchronous binary counter with preset). Although it is described as a counter, it’s configured to be used only as a register. It can hold four bits. Two of these bits (Q0 and Q1) are connected to IC20, which is a 74LS139 (TTL dual 2-to-4 decoder/latch) which takes a 2-bit input (A0b and A1b), and sets one of four output bits accordingly (e.g. 01 -> 0100). Each of these IC20 outputs (O0b to O3b) is connected to the chip-enable pin on each of the ROM sockets.
The 74LS139 is split into (a) and (b), each having 2 A-inputs, and 4 O-outputs. The (b) side is used for decoding the ROM socket. Each O output is connected to CE/E on the SRAM/EPROM (Pin 20).
So, only two bits of the four bit register are used to select the ROM socket (since there are only four sockets). Therefore to switch between the upper and lower 16K of our 32K SRAM, we can wire A14 to either of Pin 11 or Pin 12 (Q2 or Q3), and set the ROM selection value (0x0 – 0xf) such that our Q2 or Q3 value will determine A14.
As a side note, the four ‘sideways ROM’ sockets hold chips that can address 32K of memory, but because pin A14 is normally always pulled high (continuity with Vcc), any chip inserted without any of these modifications will only be able to address 16K (A0-A13 – 14 useable address bits, 2^14 == 16384).
My One Last Mod
I mentioned that the EPROM supplied with the TurboMMC is a 32K chip, and the MMFS filing-system ROM image is written to the upper 16K. The vendor (Steve Picton) was kind enough to write the BASIC 2 ROM image to the lower 16K. This is normally ignored, but using a similar technique to the one above, I bent out and wired the EPROM A14 (Pin 27) to IC76, rather than having it pulled high. This meant that the lower 16K was made addressable as a BASIC 2 ROM, and so I could free up the ROM socket that contained the original ROM (and lower power consumption too!).
I see no reason why all ROM sockets can’t share the same Q output (i.e. Q2 or Q3) of IC76, but for simplicity I chose to wire one to Q2 and one to Q3. This just affects which ROM number the chip banks respond to.
No Really, the Very Last Mod
It’s hard to know when to stop. What I want to finally do (and a big part of why I wanted to understand how this wiring worked) is to add a battery-backup to the SRAM chips. This is provided by some of the dedicated ROM expansion boards, but I reckon that a few AA batteries and judicious use of diodes and resistors should be enough to keep the chip going in standby while the BBC is powered off.
I might describe that here, or link to source material if I find a guide on the Internet.
So all mods have worked perfectly so far. My BBC Micro setup is leaner, yet more functional, that it was before. All credit goes to the enthusiasts who figured out and produced all these great mods. This article was simply about satisfying my curiosity about what these folks came up with.
Most of these links were discovered after this article was written. If there are discrepancies between what I have written and the content of the links below, consider the the articles below as authoritative, rather than mine! Not all links relate directly to this post, some are just a place for my future reference.
Inside the BBC B Issue 7 – lists all the chips and their functions.
Sideways RAM 101 – stardot.org forum thread with lots of details.
http://beebwiki.mdfs.net/Paged_ROM – Wiki entry on Paged ROMS on BeebWiki.
Schematics for BBC Micro as a JPEG – there are also schematics available in at least PDF format, probably lots more.
DIY 32K Sideways RAM – detailed retroclinic.com article on sideways RAM.
Michelle Knight’s article on sideways RAM – lots of details including commands to load ROMS.
Another good stardot.org forum thread – posted by forum member ‘holmes’.
A Hardware Guide For The BBC Microcomputer – a great book from 1983, in HTML format. Chapter 3 summarises the main circuits in the BBC.
https://www.stairwaytohell.com/articles/cr-BBCMicro-CToday.html – a review of the BBC Micro, as reviews should be done. Informative!
Acornsoft Graphics Extension ROM Manual – This ROM looks fun!
http://www.bbcmicro.co.uk/ – Complete BBC Micro Games Archive
http://www.flaxcottage.com/ – Educational Software Archive (an awesome collection, thanks!)
https://stardot.org.uk/forums/ an active community of all things Acorn.
http://archive.retro-kit.co.uk/bbc.nvg.org/software.php3.html Archive of a now obsolete website (bbc.nvg.org).
MMFS Command Reference on GitHub also MMB Utils for manipulating disk images from GNU/Linux/Unix systems
https://github.com/stardot/beebasm BeebAsm, a portable 6502 assembler with BBC assembly syntax.