Sunday 30 June 2019

BBC Micro Issue 3 Model B Repair

Continuing my look through the series of BBC Computers from Acorn, we have the big brother of last week's BBC Model A, the BBC Model B. The one in the picture below is not the one we are repairing today (I couldn't find the 'before' photo of that), but you can see it's got most of the chips and connectors that were missing in the model A, a full compliment of RAM and the normal arrangement of ROMs. This is essentially the same machine as the model A, but with more of the board populated.
The first thing to say is that apart from those early machines with the black linear power supplies, all the BBCs up to the B+ have the same power supply, and as these are all getting on for nearly 40 years old, they are all suffering the same problem. That is the Rifa brand X class mains filter capacitors. These things dry up over time and have a tendency to go bang shortly after being powered on for the first time after 30 years in the loft.
There are more details in a previous blog post on BBC Micro Power supply repair, but I will just show a few photos from this one, as it must have put on quite a show when it went.
You can just see the X class capacitor in front of the transistor on the heatsink.
I've not seen one this graphic before, lovely splatter pattern on the transistor.
There are two X class capacitors, a 100nF and a 10nF. The smaller 10nF capacitor here is cracked if you look closely. So far it remains intact, but it is ready to go at any time. Do not trust them, they will eventually go. They all go in the end, get them changed before you even plug it in. Do not wait until the Grim Rifa visits your BBC (do you see what I did there?)
I don't normally need to remove the common mode choke, but in this case, the capacitor was wedged in place where it had exploded.
Ooh, Nasty!
That's those two replaced with modern X2 class capacitors (X2 is a higher voltage rating that the original X class ones), and the transistor cleared up, but whatever came out of the caps seems to have corroded the can.
I usually replace C9 as well, as this has can cause problems with the power supply starting up. These units are a pain to take apart, so may as well change that at the same time for a good quality 105°C rated low ESR one.
With the PSU back together, it's safe to plug in the board. This one is doing the usual black screen, constant tone and not booting. The reset pulse was there, the clock was there, but the NMI line was stuck low. This will stop the CPU doing anything useful. I had thought it might have been caused by faulty 6522 VIAs (forgetting they were wired to IRQ rather than NMI).
To test this, I removed those and it was still stuck low (since they don't use the NMI pin - doh!). As with machines like that, the board under the chips is often cleaner than the exposed areas, but I noticed the section under the disk drive controller was clear, even though that had been empty when I started. (this is a photo of a different board, the ones from the actual board were clear to the eye, but the photos didn't come out very well. This is a much dirtier board, so you can see the clean space under the 40 pin sockets, and the dust around and under the 28 pin sockets to the left).
It appears that someone has removed a disk drive controller upgrade in the not too distant past. But it hasn't been full removed, there are still some chips in sockets that would have been part of the upgrade. I think the NMI is being held low as part of this, the interrupt pin on the disk controller is floating now that the chip (or more likely a 1770 board) has been removed.
IC27 controls the NMI line, it is a quad 2 input NAND gate with open collector outputs, two of the gates drive the NMI, one from the disk controller, one from the econet, with the outputs in parallel as they are also open collector, and a pullup resistor to pull it high when nothing is pulling it low. I checked the chip, and all the outputs were low, even those with some inputs low, so it was faulty and I installed a replacement. Running with floating inputs may be the cause of it's failure, or it may have failed earlier. It's other outputs form part of the disk controller, so that wouldn't have been working, so may be why it was removed?
With the replacement fitted, there was still a problem. Checking the schematic, link S9 should be fitted when there is no disk controller installed. This pulls the input of the gate high, so it shouldn't trigger NMI. However, it looks like there was a mistake on the early boards that wasn't fixed until issue 4. Rather than pulling the input to the NAND gate low (which would make the output high as desired), it is connected to 5V, so actually activates the gate and pulls NMI on all the time.
There are instructions in the service manual which gives an option to cut the track and wire this to a different ground point, but for simplicity, I decided to just lift the output pin, so it would never pull NMI low. It was now progressing. The first beep stopped, but the screen didn't show anything and the second beep didn't come.
With a ROM/RAM board installed, I was able to get it to boot. Mode 7 looked clear, but changing to mode 0 showed some RAM faults.
The ROM/RAM board was providing the CPU with it's own RAM for zero page and stack etc., so it could boot, but the onboard RAM was still being used to drive the display. This is quite handy for finding RAM faults, as it would normally not be able to boot. But with the ROM/RAM board running, any faults in the top 20K or so of RAM that the bitmapped mode 0 uses will be visible. There is a line about quarter of the way down the screen where it switches from the lower 16K to the upper 16K, so you often see a clear transition from good RAM to bad or vice versa.
You can make a little widget that plugs into the pins for jumper S25. This normally selects 16K or 32K mode, but by inverting the signal from the top pad and feeding it to the middle, you end up swapping the RAM banks around, which is quite handy in those situations. For reference, the bottom pin of S25 is ground, so that lines up nicely with pins 5,6 and 7 of a 74LS04, and just needs a wire from pin 14 to any convenient 5V pickup point. The other pins are bent up out of the way.
Here, both halves were reading bad. Checking with the scope confirmed that bit 7 was the problem. There are two chips on bit 7, IC60 and IC68, one on each bank. Swapping around the banks pointed to IC60 being the problem, as it's output was about 2V (always a bad sign) when enabled. Replacing that got us a clear mode 0 screen, but it didn't last long.
I typed in a simple RAM test program that should detect problems. That ran, but didn't detect any errors. It's difficult to describe, but it was testing writing a value to address A and then reading it back. That normally picks up errors. But what was happening here was writing to address A was also causing the value at address B to change.
Here the white block is progressing across the screen writing 0xFF to each byte. I have stopped it at the point where it has started to affect RAM further down the screen.
Through a bit of trial and error, I found the point this started, and modified the program to just write to a short section of RAM, and then test the rest to see which bits were not zero. That came out with 128 as the bad value, so it was bit 7 again, but this time the other chip on D7, IC68.
With both chips replaced, the system was booting and I was able to remove the ROM/RAM board and get it back to a fully working system.
There was no disk controller installed, so an ideal opportunity to fit one of the new SD2BBC SD card drives from The Future Was 8 bit. There are many SD card drive options for the BBC micro, most of which stem back to MMBeeb, which was a very simple implementation with a few components to connect a MMC card to the user port. The MMC card was an SPI controlled memory card that SD is sort of backwardly compatible with. SD adds more and more high speeds modes and is less and less concerned with this backward compatibility, particularly with micro SD cards, which is why we stick with full size SD cards where possible.
The design has been refined over the years by many people, this is my take on the idea, using experience from the SD2IEC drives that TFW8b produces. The design of the power circuitry and interface to the SD card comes from that. There is a level shifter to buffer the signals to protect the BBC user port, and to ensure the SD card gets the right voltages.
That is housed in a variation of the SD2IEC case, no buttons are required, just LEDs for power and activity which are visible through the lid. You can sit it beside the BBC, or tuck it underneath the case.
All that is required inside the machine is a ROM fitted to one of the spare ROM sockets. There are a few options available to drive a user port SD card, I'm using Smart SPI by Duikkie, which is the version that will be shipping with the SD2BBC.
That machine now boots up as normal, and you can access the first disk in the BEEB,MMB archive on the SD card. Normal DFS commands can be used, *. and so on, or use shift+break if you have a bootable disk image selected.
There are various archives available online preloaded with most of the BBC software catalogue, complete with a neat menu, so all you have to do is shift+break, browse to you title of choice and it will run.
Loading is quite fast, a few brief flashes of the red LED and you're away. As usual, I go straight to Repton.
(the above screenshots are black and white as I get a better picture from the monochrome monitor output, when the colour signal is added, it's all a bit fuzzy)
The final thing to fix was the 'ash tray', the section of the keyboard that was designed to take the expansion cartridges for the speech system that hardly ever got installed. More often than not, these get pushed through.
A quick fix is to slide a piece of black card under the black plastic. Not ideal, but it makes it look less obvious.
That's all sorted, and ready to go back to it's owner.
The SD2BBC drives are available to order now from The Future Was 8 bit, and should be shipping soon are shipping now.
Next up, the BBC Model B+.

Sunday 23 June 2019

BBC Micro Issue 2 Model A Repair

I am currently in the process of going through my collection of BBC Micros, testing an upcoming project. One of the ones I dug out was still in the box it arrived in. It was donated to me by a gentleman from Cumbria who had his BBC Master serviced. He said he also had a broken model B, and would I like that for parts. So he packed off the BBC and when it arrived, I didn't have time to look at it then and there, so I added it to the pile of 'computer to look at when I get some time'.
When I am testing a product, I like to try to use a range of machines, from highly modified to barely touched, to get a representative sample of the sort of machine a customer might have. I keep an assortment of things like that around for those circumstances, time to get the box open.
When I opened the box I was surprised to see a lot of gaps on the back panel.You might have thought it had been stripped for parts, but in fact, it would have always been like that. There are also tell tale signs that this is an early unit. The large slot at the top was later closed up to reduce the chance of school children reaching insides the machine when unattended in a classroom.
The analogue port lost the rounded corners in later machines, and went rectangular, and although I don't think a reset switch was ever fitted, these early machines did have it marked out on the case. It's sort of redundant as it is wired in parallel with the break key anyway. And like most beebs, it has space for an econet socket, which isn't fitted, but is pushed through.
There are some connectors, the TV RF output, and the monochrome monitor output, but the RGB and RS423 serial are missing. The sole source of IO is the cassette port. This being the budget machine, IO is limited, and they wouldn't expect you to have a disk drive or a colour monitor, so the choice was cassette player and a black and white TV (or maybe colour one), or a monochrome monitor, usually a green screen in those days.
Underneath, an absence of IDC connectors, and a hand written serial number. The other sign of an early machine is the power supply, no power out connector for the disk drive.
Inside, you can see the black case of the linear power supply with a thinner power switch and a fuse holder on the back, rather than the bronzey colours of the usual switch mode supply in most BBCs.
The is no branding or power specification on the box (I've got an issue 3 machine with a linear supply that has the BBC TV logo on it). The label on the lid says 'disconnect the mains supply before removing the cover. Not sure if this refers to the plastic case of the BBC. You can't read that label until you have removed that cover. 
Or does it refer to the metal case of the PSU, which is riveted shut. It should maybe say 'disconnect mains supply before drilling out rivets', but hopefully no one is going to try that. I've not opened this one up, as I don't see any evidence this is anything but a simple linear supply (with a nice torriodal transformer), and no nasty Rifa brand capacitors to ruin your day.
The keyboard is also a bit more minimal, with a small speaker just stuck to the top of the board with some double sided tape.
The main board is an issue 2 (I don't think I've ever seen an issue 1). Produced by Cleartone of Abercarn, Gwent, serial number 101199, so probably a thousand or so machines produced before this, and several million after it. It's a bit manky, but I'll probably leave the patina of age in place.
You can see from the board that there are lots of bits missing, lots of unpopulated parts and empty sockets. This is how the model A would have been produced. You can see below the spaces where the Tube and 1MHz bus edge connectors would be fitted on a model B. And the massive heatsink on the video ULA. This was shrunk to half this size for the issue 3 and 4 boards, and removed altogether when they switched to a more efficient chip for issue 7 (issue 5 and 6 were skipped for some reason).
Another thing that stands out is the ROM situation. Usually, there would be a pair of 16K mask ROMs with MOS V1.2 and BASIC. Beside them would be three empty sockets for DFS, View, Wordwise etc. Instead, this has a single 16K BASIC ROM in the socket the MOS ROM normally live in, and the four sockets normally populated by language or filing system ROMs contain MOS V0.1 split across four 4K EPROMs. The BBC mainboards were very adaptable, and I think it was possible to jumper a board to accept this combination right up to the final issue 7 boards.
Over on the bottom left, there are the headers where the disk, printer and user ports would be, and a load of sockets where the speech synthesiser, disk controller and their associated circuitry could be installed.
Like most BBCs, the Econet section is not populated, not even with sockets, so that was a less common upgrade. The socket top right is for an ADC for the analogue port. They don't fit the 15 way D connector, but they still fit the IC socket, which was a presumably cheaper part.
At the top of the board, the cassette socket is fitted (along with the cassette ULA and the serial chip). The RS423 serial port and RGB connector are not fitted. Below those, the sockets for IC74 and 75 are the RS423 serial buffers, which are not installed. IC97 on the right is part of the Econet circuitry and there is no socket fitted.
IC40 has an interesting modification stuck to the top of it, a variable capacitor presumably trimming the 16MHz oscillator.
There are a couple of deviations from the model A specification. At some point, the original 8 RAM chips that give the model A 16K of RAM have been joined by another 8 chips to take it to the full 32K. This was quite common, as was fitting the RGB socket, user ports, disk controller etc., trying to bring the machines up to model B specification. It's unusual to come across a model A that's barely been changed.
The other upgrade here is the user VIA chip has been installed. That would not normally have been fitted in a model A. It is not required for normal operation, and is mainly there for the user port and the printer port. A Synertek 6522 has been installed here as an aftermarket upgrade. The only reason for this would be to make use of the timer inside the chip, which was required by some software.
The rest of the main chips are as expected, all socketed and dated late 1981. That concludes the grand tour over with, time to switch on. OK, well the owner did say it was broken. It's not showing anything on the screen and making a single continuous beep.
Voltages are all present, reset is pulsing on power on and with the break key, clocks are there, but the CPU is doing nothing. The IRQ pin on the CPU was low, which wouldn't help things. The only things connected to that would be the two 6522 chips. I first tried removing the user VIA, and that seemed to clear it up. The CPU was still not doing anything, so I tried a replacement 6502 and with that, there was activity of the address and data busses. Second casualty, the 6502. Still a continuous beep and nothing on the screen though.
Next I tried using a PET ROM/RAM board I had modified to work with the BBC memory map. That was set to replace all the ROMs and all the RAM. I removed the ROM chips for the time being and dumped their contents to check them. Unlike the PET, the BBC has the RAM shared between the video chips and the CPU. The ROM/RAM board can only replace the RAM that the CPU sees, so it is set to write to both the original and replacement RAM, but only read from the replacement. That means that the CPU has good zero page and stack page RAM to get running, but what appears on the screen depends on the system RAM on the main board
Still a blank screen, but with a cursor, and in about the right place, and I got the usual double beep. I was able to try blind and type ctrl-G to make a bell sound and *MOTOR 1 made the tape relay click. The CPU was up and running, at least, just not putting anything the screen. Typing MODE 0 brought up a screen. That is a bitmapped mode which uses something like 20K of RAM, so is very good at displaying any memory faults. Any bits stuck high will display white pixels on the screen. Thin vertical lines indicate a bit error accross the whole memory range. This is the RAM on the main board, when the CPU tries to read RAM, it gets the good stuff from the replacement RAM chip.
Given the bitmapped modes were at least doing something. I tried swapping out the SAA 5050 Teletext chip, which generates the mode 7 boot screen. With a working one of these I also got something on the boot screen, albeit a bit scrambled..
I removed the 8 upgrade chips and changed jumper 25 so it was running in the 16K only mode. That didn't make a difference, so I went through a process of elimination, swapping out the 8 remaining chips for known good ones.
Three bad chips replaced and eureka, a boot screen. Still a few flickering characters in mode 0, so some more faults in the other five chips. I switched the ROM/RAM board to use the real 16K RAM for the CPU as well, and it continued working. The ROM chips had passed a read test, so I put them back and removed the ROM/RAM board and the BBC booted up under it's own steam. Excellent, we're nearly there.
All eight of the upgrade RAM chips were working, so I decided to install those as the base 16K instead.
They were not the originals, but have probably been in the machine for nearly 40 years as well, so that's good enough for me. They are also brown ceramic chips, so sort of matched the ceramic EPROMs.
MOS version 0.1 doesn't display a version number, but also, doesn't support the *HELP command you would use to display it. I could upgrade to the usual version 1.2, but I'd like to keep this machine as an issue 2 model A. That also means: no disk interface, no userport, no econet, no serial, no spare ROM sockets. Not much choice for loading games then, tape it is.
I tried loading a few tapes but nothing was working. I was using the same Acorn ANF-03 I normally used with BBCs, so that shouldn't be a problem.
I tried writing a simple test program and saving it, and I could hear data being saved, but it also failed to load that back.
Checking around with the 'scope, a signal was getting to the machine and through the first stage of the LM324 Op Amp, but there was no output from the second stage.
A new LM324 made all the difference, data was now getting through.
There's not much software that is going to run on the model A. 16K RAM is limiting for program code, but more so for video RAM.
Several of the programs I tried overwrite screen memory before they finished loading. Modes 0-3 are not available as they need too much RAM, so even when games load, you get 'BAD MODE'.
OK Jet Pac was optimistic, but I don't have much BBC software on tape, and it does work on a 16K Spectrum.
I found a model A specific version of Invaders. That at least worked.
Even a simple type in program from your favourite magazine needs the mode changing to work.
Note, it's black and white because I'm capturing via the BNC monitor jack (read about why I've had so much trouble taking screenshots). The BNC monitor output is luminance only - later Beeb's had a jumper to merge in chrominance data, but that reduced the quality on monochrome monitors as you would see the chroma dots, so it was optional.
When enabled, you can see bits of blue and yellow fringing around what should be just white characters. (this is normally unwanted, but handy if you were shooting 16mm film of the black and white the monitor and at some point in the future want to recover the colour image - I would insert a link here to some articles about recovering colour Dr Who episodes from black and white film prints using the chroma dots, but from what I remember they were all illustrated with samples from early 70s episodes of Top of the Pops, so were mainly pictures of a certain DJ who has fallen out of favour somewhat since they were written so rather ironically, the articles have now also been wiped)
The machine is now all back together, back to stock, without the extra 16K of RAM or second VIA, and with more chips replaced that I would have liked. I went back through and retested all the ones that had been removed in a different machine, and they all tested bad, so the replacements will stay.
A nice thing to have, an unexpanded issue 2 model A BBC, but not a particularly useful machine due to the memory and IO limitations. Next week, we will look at it's big brother, the BBC Model B. A far more usable machine, especially with one of these by it's side, but more about those later.