Tag Archives: bbc micro

Sideways RAM for BBC Micro Model B+

There’s an excellent article by Mark at RetroClinic on adding 32K of Sideways RAM to a BBC Micro with just a couple of track cuts and wires. I’ve performed it on a BBC Model B, in order to replace a Solidisk SWR which never worked reliably even when it was new, and the modification works well. However, I wanted to do it on the BBC B+ I use in the office, and the details are slightly different.

The first thing to note is that the B+’s sideways ROM sockets are conveniently already wired to support 32K chips (27256 EPROMs). There is a row of links to the left of the ROM sockets which select whether each socket is configured for a 16K chip or 32K chip. Each link just selects whether pin 27 (A14 on 27256, /PGM on 2764 and 27128) is tied to +5V or connected to the bottom bit of the ROMSEL register IC45. If the link is to the left, pin 27 is tied high, and if it’s to the right, it’s an address bit. To be honest I can’t see any reason not to leave them all to the right all the time, since pulling /PGM low on 2764 and 27128 chips seems to have no effect other than disabling the chip. However, on my B+ they were all set to the left by default.

The layout of the parts on the board is:

    +------+ +------+ +------+
S19 |      | |      | |      |
S18 | IC62 | | IC68 | | IC71 |
S15 | ROM  | | ROM  | | OS & |
S12 | banks| | banks| | bank |
S11 | 8/9  | | A/B  | | 1/F  |
S9  |      | |      | | BASIC|
    | (S15)| | (S18)| | (S19)|
    +------+ +------+ +------+
    +------+ +------+ +------+
    |      | |      | |      |
    | IC35 | | IC44 | | IC57 |
    | ROM  | | ROM  | | ROM  |
    | banks| | banks| | banks|
    | 2/3  | | 4/5  | | 6/7  |
    |      | |      | |      |
    | (S9) | | (S11)| | (S12)|
    +------+ +------+ +------+

Note that S19 (for IC71) behaves a bit differently. IC71 is always the OS ROM, which is not a sideways ROM, but can be a sideways ROM (in bank 1 or bank F) as well. If S19 is placed to the right, IC71 should have the OS in the top 16K and a sideways ROM image, conventionally BASIC, in the bottom 16K. Which bank this ROM image ends up in depends on the setting of S13. If S13 is set ‘north’, the lower half of IC71 appears in bank 1. If it’s ‘south’, it appears in bank F. Normally bank F is convenient for BASIC.

The key ingredient of the sideways RAM upgrade is to provide a write enable signal to the RAM chip. This isn’t normally present on ROMs because it makes no sense to write to a ROM. The RetroClinic upgrade takes a write signal from IC77 pin 8. This is the write strobe for the uPD7002 ADC and the 8271 floppy disc controller. The corresponding signal still exists in the B+, and is used by the ADC and the 1770 floppy disc controller. It comes from IC27 pin 6, however, which is conveniently close to the ROM sockets.

However, there’s an annoying difference between a 27256 32K EPROM and a 62256 32K RAM. The EPROM has A14 on pin 27, but the RAM has A14 on pin 1 and /WE, the write enable signal, on pin 27.

On the Model B, it’s not hard to cut the tracks to pins 1 and 27 and solder wires on the bottom of the board. However on the B+, the tracks to those pins are on the top of the board, mostly concealed by the socket, and are a royal pain to get to. I could have desoldered the socket, done the modifications and put it back, but that was relatively risky and a lot of effort. I decided to just take pins 1 and 27 of my RAM chip outside the socket and run a wire from pin 27 to IC27 pin 6, and pin 1 to IC45 pin 14 (the source of the address line), on the top of the board. Here’s what it looked like.

DSC_1094

My final discovery was that the Sideways RAM utilities are provided by the 1770 DFS ROM. My B+, however, only had DFS version 2.10, which doesn’t include them. I programmed a ROM with DFS version 2.26, and took the opportunity to shuffle the existing ROMs into 32K chips to save sockets.

This done, the SRAM commands were now available, but the Sideways RAM wouldn’t work. I’d put my RAM chip in socket IC57, which is banks 6 and 7. It seems that the B+ and DFS SRAM utilities only understand about Sideways RAM in the banks which the B+128 would have it: banks 0, 1, C and D, exactly the banks which are not covered by the ROM sockets. Doh!

I needed to move my RAM chip to appear in banks 0 and 1. This was easily accomplished by moving pin 20 outside the socket and soldering a wire from it to IC46 pin 15. IC46 is the address decoder for the ROM sockets, and pin 15 is its /0 output.

Now, when switched on, the machine shows ‘Acorn OS 96K’ (cute!) instead of its previous ‘Acorn OS 64K’, and the *SRLOAD command works to load images into banks 0 and 1.

Img_8121s

In summary, to add 32K of Sideways RAM to a BBC B+ 64K:

  • Move S12 into its right-hand position
  • Bend pins 1, 20 and 27 of a 62256 RAM chip so they fall outside the socket
  • Put the chip with bent pins into socket IC57
  • Solder a wire from pin 1 to IC45 pin 14
  • Solder a wire from pin 20 to IC46 pin 15
  • Solder a wire from pin 27 to IC27 pin 6
  • Make sure your DFS is version 2.26

Now you have Sideways RAM in banks 0 and 1. Job done.

IMG_8120

Repairing a floppy disc drive

Why on earth would anyone want to repair a floppy disc drive? It’s quite a while since most of us bade them good riddance and started using USB sticks and Flash memory cards. However, I still use floppies from time to time, mostly with my trusty BBC Micro which still sits in the corner of the workshop.

Recently I was asked to recover some documents from some old 5.25″ BBC Micro floppy discs. The documents themselves were in an unusual format, about which more another time, but the first step was to simply get the data off the discs. The discs were 80-track ones, and I have a pair of Chinon FZ-506 80-track drives for the Beeb.

Img_6556

Out of all the various Beeb drives I’ve had over the years, I’ve kept these two because they’re housed in a compact casing with a mains power supply, and they have handy 40/80 track switches on the front, not hidden round the back. One drive has always been a bit reluctant to start spinning, but for occasional workshop use that wasn’t a problem. I’d got in to the habit of just opening and shutting the door a little which would kick the motor into action. However, when it came to intensive use backing up these old discs, which needed both drives, the failure to start became a real pain. I didn’t have a spare drive, and finding another one (especially in Poland) isn’t easy these days.

My curiosity got the better of me and I decided to open up the drive and find out what was wrong with it. It wasn’t hard to take apart and I soon had the motor revealed. Here’s a photo of it sliced into its component parts.

Img_6340

It’s a ‘pancake’ motor, so called because it’s (nearly) flat. The shiny silver bit on the left is the turntable which drives the disc, and it sits in a bearing. The next layer is the circuit board containing the windings and controller circuitry, and below that is the rotor which is a multi-pole magnet on a steel disc.

The motor is controlled by a Mitsubishi M51785P motor controller chip. The chip’s data sheet revealed that the motor has three phases, each of which has a coil to drive the rotor round and a hall effect sensor for feedback. This particular one is arranged with two coils per phase, but occupying 6/7 of a revolution, so the motor goes more slowly than the chip is driving it. At least, I think that’s what’s going on. Here’s a closeup of the circuit board. You can see the six coils, and the coloured wires I soldered on to measure things while the motor was running. Because of the way it’s built, it’s impossible to access most of the circuit board while the motor is assembled.

Img_6338

The controller chip seemed to be doing all the right things: its oscillator was running, and the outputs to the coils were doing sensible things. The coils themselves were all undamaged and measured the same resistance as each other. But I noticed something odd about the hall effect sensors. There are three of them, HG1, HG2 and HG3. I noticed accidentally that if I shorted together the two wires taking the output of HG1 to the controller, the motor still ran but sounded very rough. Not surprising. The same happened if I shorted the output from HG3. But shorting the output from HG2 had no effect at all. Aha! Only HG1 and HG3 seemed to be having any effect on the motor. I swapped HG1 and HG2 just to see what would happen, and the fault moved to HG1. That proved to me that I had a faulty sensor, not a faulty chip.

Where to get a replacement sensor, though? This drive was made some time in the late 1980s, and I couldn’t find hall effect sensors in today’s electronics catalogues which would fit mechanically and electrically. I had a rummage around the workshop and found a scrap 3.5″ floppy drive. A squint at the circuit board revealed a suspiciously hall-effect-looking device of the right shape and size nestled next to the spindle rotor, used for index sensing. Well, it had to be worth a try. I extracted it and fitted it to the 5.25″ drive in place of the faulty one.

Success! The motor now ran more smoothly, and shorting each of the hall sensors in turn had roughly equal effects, so they were now all working. Best of all, the motor started reliably every time. Interestingly it wasn’t as quiet as the other drive, but I suspect the scavenged hall sensor is optimised for magnetic fields from the side rather than the front, given how it was mounted, so it’s probably not perfect.

The last job was to realign the head slightly, because this drive was a bit fussy about reading some discs. I found a disc that it struggled with but that the other drive would read every time, and tweaked the position of the head stepper motor each way a little until this drive read that disc reliably. You can see in this photo that the stepper motor has elongated mounting holes, so it’s possible to loosen its screws (there’s another one just out of shot to the right) and turn the motor a few degrees to adjust the position of the head.

Img_6344

After all this work, the drive read all the discs I asked of it without any problems. I hope it’ll be OK for the next decade or two.

The BBC Micro linear power supply

The BBC Micro is the machine that really got me into computing. It was designed by Acorn in a tearing hurry for the BBC Computer Literacy Project in 1981 – see the film Micro Men for a great dramatization of the story. Because it was done in such a rush, some things weren’t quite finished for the early machines. One of those things was the power supply.

Why is the power supply interesting? Well, later BBC Micros had a perfectly normal, reliable switch-mode power supply, not dissimilar to the one in a modern PC. But early ones had a linear power supply, which gained a fearsome reputation for overheating, exploding, and being incompatible with nearly everything. I recently dragged an early, Issue 2, BBC Micro out of the loft and realised it contained this elusive beast, the linear power supply. I thought I’d see what all the fuss was about.

DSCN8929

First things first: does it work? Well, yes. Despite not having been switched on for probably 20 years, it powered up absolutely fine. Boop-beep. No smoke or flames. Good. Time to see what’s inside.

DSCN8933

This particular machine started life as a model A, with just 16K of RAM and very little else. However, it got upgraded at some point into a model B, with the full complement of RAM, and has an unusual Opus double-density disc interface in it as well as a couple of extra ROMs including Wordwise, the word processor. That’s the sort of thing that’s supposed to be impossible with a linear power supply. You can see the black box on the left – later power supplies are a gold colour. Here are a couple of closeups of its labels:

DSCN8939  DSCN8931

I took it out and examined it. The first thing I noticed was that it doesn’t really fit very well: there are some odd washers sandwiched between the power supply and the case, and they’ve used nylon screws to fit it, for some reason.

DSCN8942 DSCN8943

You can probably see from the side view that it’s riveted together. The rivets were quickly dealt with, revealing the insides:

DSCN8948

Pretty straightforward stuff: a toroidal transformer, rectifier and smoothing, and a row of regulators. Here are closeups of the circuit board and regulators. Note the little orange tantalum capacitors. I suspect that’s where the reputation for explosions has come from: when used like this, they do tend to fail short-circuit and go off like little fireworks from time to time. These ones, however, are rated at 35V, so with only 5V or 12V across them they should be fairly reliable.

DSCN8950 DSCN8949

It didn’t take long to trace out the circuit.

DSCN8952

What is interesting is the way the 2.25A output at 5V is achieved. Rather than use one big regulator, they’ve chosen to use three 7805s, rated at 1A each. Three sets of wires leave the power supply and are delivered to three places on the Beeb’s motherboard. There is no connection between the three 5V rails on the motherboard according to my meter. They’re entirely independent. This is good, because it means that the three 7805s won’t end up fighting each other if their output voltages are slightly different.

I took a few measurements while the machine was running. The voltage on the 4700uF smoothing capacitors was 10.5V. The currents delivered by each output were:

VCC1: 0.49A
VCC2: 0.75A
VCC3: 0.84A
-5V: 15mA

I tried removing the disc interface to see what difference that made to the power consumption. It reduced VCC1 to 0.35A and had no other effect.

The total current flowing at 5V is just over 2A, which is sailing fairly close to the wind given that the power supply is only rated at 2.25A. However, nothing in the power supply is under great stress, and I see no reason why it should fail unexpectedly. Unlike a switch-mode supply, it would also be easy to repair. If it was going to be used for a long time, I’d be very tempted to replace the 1uF tantalum capacitors with modern ceramic or electrolytic ones, just because the tantalums do tend to commit suicide randomly with old age.

These machines are now becoming collectable, and early ones like this are worth preserving in their own right. If you’ve got an early Beeb, there’s no reason to fear the linear power supply and replace it. It’s part of the story, and it’s possible to keep it going more or less indefinitely.