Posts in category technology

Revisiting my BBC Micro - display, speech & more

It’s been a while since I blogged about Revitalizing my BBC Micro. In that time I’ve performed a few upgrades you might find interesting…

Display requirements

As useful as the tiny Amstrad CRT was I wanted something bigger, brighter and sharper. LCD is terrible for retro systems with blurry scaling attempting to draw images designed to take advantage of CRTs. Emulator authors spend significant effort trying to mimic CRT effects for a true retro feel but the best option is just to use a CRT.

Most machines in the 80s and early 90s were designed for TV compatibility and so operated on a 15KHz horizontal refresh rate. The VGA CRT monitors people struggle to give away aren’t going to work as they start at 31.5KHz. British machines like mine also use the PAL (UK) video system rather than the NTSC (USA) system - ideally a display would handle both.

If you don’t need any VGA frequencies then a Sony PVM is the way to go. I also own an Amiga 1200 which is capable of some VGA modes so it would be nice to have one CRT for everything. Multi-sync monitors can do both but were rare back then and are even rarer now and the shipping cost on CRTs limits can be prohibitive.

Commodore 1942 CRT

Figuring out resistor levels and sync signalsLuckily for me a Commodore 1942 CRT “bi-sync” turned up on Craigslist just 15 minutes from my house for $50. It was designed for the later Amiga models so it does both 15KHz most of my machines can do and some VGA resolutions too. Perfect.

Connecting it to the BBC was a little trickier than I anticipated. That Amiga design means it expects the horizontal (HSYNC) and vertical sync (VSYNC) signals on two different pins to match the Amiga’s video port rather than the composite sync (CSYNC) all my RGB capable machines offer (Amiga excluded).

I briefly experimented with connecting the CSYNC to HSYNC, VSYNC and indeed both but failed failed to get a stable display. Digging in to the Motorola 6845 CRT controller chip that powers the Beeb reveals both VSYNC and HSYNC on pins 40 and 39 respectively. A quick snip of the RGB port’s unused 5v and sync pins let me repurpose them to HSYNC and VSYNC direct on the 6845. A stable but over-saturated picture was a welcome next step that didn’t involve me needing to create a SYNC splitting circuit (I did that later to connect with my Spectrum +3).

Running Citadel on the Commodore 1942The over-saturation is because the BBC Micro outputs either 0V or 5V - off or on - for each color. The Amiga monitor is analogue and accepts any amount of color between 0V and 0.7V. I read guides on calculating the voltage drop but it still looked saturated so I kept increasing resistor values until I found values that looked right.

The final result definitely made me smile. It looked better than the Microvitec CUB monitors our school had back in the day without losing the CRT appeal. Success!

Speech synthesis

Hearing Superior Software’s SPEECH package blurt out any phrase we cared to throw at it was a blown-away moment at school. I’ve always wondered what the official Acorn speech system was like especially as every time I open the case empty sockets IC98 and IC99 call out for the Texas Instruments TMS5220 speech processor and associated TMS6100 voice synthesis memory.

The TMS5220 chip was a successor to that in Speak & Spell, Bally/Midway pinball machines and some arcade games as is quite easy to come by. The TMS6100 was available in many variants and the BBC commissioned some of their own including one sampled by BBC news anchor Kenneth Kendall. This chip is rare now and the fact the TMS6100 is not a regular ROM means you can’t just burn a copy. Thankfully Simon Inns created an emulator which can run on an ATMega32U2 to provide a drop-in replacement!

I obtained a TMS5220 and pre-built TMS6100 emulator board from Mark Haysman at RetroClinic who I can thoroughly recommend! (My SMT soldering skills are not up to this)

After inserting the two chips and powering nothing looks different. This command sequence however provides a good test mechanism:

TMS5220 chip and TMS6100 emulator board

REPEAT : SOUND -1,GET,0,0 : UNTIL 0

Pressing any key on the keyboard will cause the machine to say aloud the letter although it has some odd ideas about what the symbols on the keyboard are.

I will be experimenting with this more as I dig through the capabilities in the manual as it isn’t as easy to use as Superior Software’s Speech! which lets you type things like:

*SPEECH
*SAY Hello there.
*SAY I've got a bad feeling about this.

ROM experiments

My school had a single copy of the Advanced User Guide so I felt privileged when the teacher would let me borrow it although on reflection I doubt anyone else wanted to. Page 395 cryptically teases:

Up to 16 paged ROMS are therefore catered for, 4 of which are on the main circuit board.

So the OS supports 16 ROMs but there are only physical sockets for 4 (IC52, IC88, IC100 and IC101). Typically BASIC and the disc filing system (DFS or ADFS) take two of them leaving just two usable ROM sockets for expansion.

The schematics reveal IC76 is the ROM Select Latch and is a 74LS163 with 4 output pins thus providing 16 possible combinations - one for each ROM you could use so both the OS and the circuitry can support what we need if we could physically get the ROMs wired in.

The Beeb supports either 8K (2764) or 16K (27128) ROMs and EPROMs. Later 64KB (27512) chips became available which are almost pin-compatible with the 27128 except:

A collection of ROMs and an EPROM

27512 Pin 27127
A15 1 Vpp
A14 27 /PGM
/OE 22 /OE, Vpp

The /PGM and Vpp lines are for writing - an EPROM programmer will care about these but our Beeb won’t.

The A14 and A15 lines are the address lines for accessing the higher memory. With them both low the chip just acts like a regular 16K (27128) chip. With A14 high it looks to the next available 16K, with A15 high the next 16K and with A14 and A15 high the final 16K.

So what we can do here is combine four 16K ROM images into a single 64K file and flash it to our 27512 which is just what I did with my Signstek TL866A Universal USB programmer.

Now by connecting A14 and A15 to the IC76 address line C and D outputs we have effectively given whatever socket we connect this two the ability to appear as four ROMs (this works only because a single ROM can be paged in at a time).

The final icing on the cake is that the Beeb sports a push-out section left of the keyboard (affectionately known as the “ash tray”) where a zero insertion force - ZIF socket - could be mounted to allow a ROM to be dropped in without needing to crack open the case (our school was definitely not wanting us to open the machines and yet only one machine had this upgrade installed).

Now I just need to figure out how to mount this ZIF socket in the ash tray hole - there aren’t really any mounts. I suspect I’m going to need to make a PCB of some sort and put legs on it.

Building your own

Parts list

  • 28-pin ZIF socket
  • 28-pin DIP socket 0.6” wide
  • length of 28-way ribbon cable
  • 2.54mm header pins (you just need two)
  • 2x female-to-female jumper wires

Creating the cable

  1. Wire all pins from ZIF to DIP except for 1 & 27
  2. Solder two header pins to 11 & 12 on IC76
  3. Jumper ZIF pin 1 to 11 on IC76
  4. Jumper ZIF pin 27 to 12 on IC76

Now insert a 27512 ROM flashed with four BBC ROMs of your choice, power up and type *HELP or *ROMS to see the images ready.

Also check out alternatives for wiring up 64K ROMs or 32K SRAM chips from J.G. Harston

Second processor via a Pi Zero

The Beeb has a bunch of expansion ports hidden underneath the machine - the most unusual one being the Tube expansion bus which allows for a 2nd processor by way of a FIFO buffers that facilitated message passing IPC for console, errors, data and system calls.

Acorn produced a number of expansions for Tube including:

  • 6502 second processor allowing well-behaved unmodified programs to run faster
  • Z80 for CP/M
  • 80286 for DOS or GEM

Raspberry Pi Zero with Level ShifterThese expansions are hard to come by as they don’t just feature the CPU but necessary additional isolation logic, memory and circuitry. David Banks developed PiTubeDirect to allow a Raspberry Pi to act as second processor plugged into the Tube port by way of a 5V to 3.3V level shifter - I got mine from Kjell Sundby

The Raspberry Pi 3 can emulate these old processors as crazy speeds - 274MHz for the 6502, 112MHz for the Z80, 63MHz for the 80286 and even a 59MHz ARM2 (Acorn were using the Beeb to work on ARM prototypes)

What piqued my interest was using the Raspberry Pi Zero though. It’s small enough to fit under the BBC Micro and remain plugged into the Tube port out of sight. Latency was a problem on the Zero given the lower ARM processor so they ported the CPU emulation core… to the GPU!

The 6502 emulation is reliable and enabled me to run the 6502 Second Processor Elite. I definitely need to try and get GEM running on it just for fun although it’s a little trickier to find suitable disk images for Z80 and 80286 co-processor stuff.

[)amien

Notes on Edward Tufte’s Presenting Data and Information

Photograph of Envisioning InformationHere are my notes from today’s event by renowned statistician Edward Tufte – author of The Visual Display of Quantitative Information and Envisaging Information primarily for my own reference but perhaps of interest to others.

A dramatic start

No announcement, no preamble. The lights went out and a visually striking video showing a representation of music started. Conversations were immediately hushed and devices put away. An effective technique to get attention and signal an absolute start.

Charts and tables

  • Sorting: Find a sort for your data that makes sense. Treat it as another axis and don’t waste it with the alphabet.
  • Sparse columns: Remove sparsely populated columns from tables. Special events should be specially annotated.
  • Linking lines: Always annotate them to describe the interaction. Prefer verbs over nouns as they are a taxonomy.

Information does not fit in a tree. The web is successful because Tim-Berners Lee understood this and made links the interconnectedness between content. “Vague, but exciting”

Data

Content is not clean. Data that shows behavior in a perfect way has likely been manipulated.

Human beings over-detect clusters and conspiracies. They find links between unrelated events especially in sequences (serial correlation). Sports commentators given any series of scores will develop a false narrative to explain it. They’ll find a reason for 7 wins in a row despite random data producing such sequences.

Self-monitoring is a farce because people can’t keep their own score. Once something is measured it becomes a target and will be subsequently gamed and fudged as needed.

You can make many models to fit any data you are given. It may work well for the past and current data but how far it will last is highly variable. This effect is referred to as shrinkage – no model lasts forever.

Big data is not a substitute for traditional data collection and analysis. Google famously thought this when they created Google Flu which tried to spot the spread of flu based on search terms. It has been seriously criticized by Forbes and the New York Times.

Conflict

Do not jump to conflict or character assassination. Your motives are likely no better (or worse).

How many nice comments wiped out a bad one? Ten… a hundred?

There is evil in the world but it probably does not exist in your day-to-day life.

A deck of slides

A deck is inefficient. It is easy for the presenter but hard for the audience who are waiting for something they can use. “A diamond in the swamp” Slow reveals further reduce the information density and people will check-out when it gets low.

Prefer spatially adjacent data (a document) over temporally stacked (slides). The often-cited limit of 7±2 items was for temporal retention so limiting a page to this number of items is actually the opposite of what that research was telling us. We can cope with much more data if it is all on-page together.

Meetings and presentations

Do not be afraid of paper.

Prepare a document in advance but do not send it and instead spend 30 minutes at the start of the meeting reading it in silence (known as a study hall). People can read faster than you can talk as well as go back and forth as needed, skipping what they already know and latecomers are less disruptive.. Amazon is famously using this with its 6-page narrative memo system.

Never go meta in your presentation – stick to the content. Respect your audience and do not presume to know them or you may find yourself pandering or having low expectations. Instead present the data to the best of your ability. Many complicated things are explained to millions of people all the time. You can’t teach if you have low expectations. Negativity and positivity are self-fulfilling.

Does your audience understand and trust you? Credibility is eroded not just by lying but by cherry picking. Evidence of cherry picking includes data too good to be true and hiding the source of the data behind excuses such as copyright, proprietary or others secrets. Why would a conclusion be open when the data needs to be secret? It’s likely a misrepresentation of the data for their own means.

Note a few words when somebody asks you a question to make sure your answer stays on topic. If you don’t know the answer be honest but suggest where you would start looking for the answer. Never heckle or waste time correcting minutiae.

Doctors trip

A trip to the Doctor’s office is a presentation. Write down your list before you go in. Make them listen because they normally interrupt after 22 seconds and consider each item individually. You’ll give up before you reach the end of your list this way and they may not see the connected pattern of the whole.

Documents

Every document needs an abstract. It should spell out as simply as possible:

  1. What the problem is
  2. Who cares
  3. What the solution is

If you can’t write this then you don’t have a document and you’re not saying anything.

Latex

Real scientists use Latex. There are thousands of templates including official ones for well-known journals. Online tools like Overleaf can reduce the barrier to entry. Latex code appears like this:

\title{My presentation matters}
 \begin{document}
 \section*{Introduction}
 Sample of Latex

R is another alternative but it’s considered hard even by people who use Latex.

Reading

We are taught to read to extract facts to pass exams at school. We need to practice reading for enjoyment, reading to spot new information, to extract what we want, to form new opinions and ideas, to loot & hack.

Immediately skip words you don’t understand: there won’t be a test – you’re not at school.

Design

Design does not belong to ‘other people’. Support thinking with analytical design and do whatever it takes to explain the data.

Why do bird books use illustrations? Because the authors want to help you spot the birds and using art they exaggerate the differences as well as produce a generic version of the bird.

Nature magazine has some of the best designed visualizations around. Openness, pride and space constraints all help. (DNA only got 1.5 pages) The New York Times also often produces interesting visualizations of data.

User interface

Use the ideas proven by large successful sites on the web. Do not be swayed by arguments that your users won’t understand. Millions of users already do.

Touch is the next-generation of user interface. It allows the chrome (interface junk) to be jettisoned. No scroll bars, no buttons, no cursor, no zoom. Pure information experiences and this came not from academia, finance or medical but from consumer space.

The future of interface design… is information design. Edward Tufte – Seattle, August 4 2015

The original UI metaphors at Xerox Parc on the Alto were around a single document. Instead we have application-owned silos of data. The elegance was lost because companies want to control the content you create with their tools. They isolate your content so they can profit.

Hierarchies are still used for web design because it mimics the organization paying the bill. They see themselves this way and do not focus on how and what their customers need. Famous examples include the Treasury Department burying tax forms 7 levels deep despite being a top user request and the XKCD strip about University web sites. People on the inside have a skewed perspective of what the outside is.

The density of user interfaces is increasing which allows for richer visualizations especially when combined with animation or video. It is hard to get right.

[)amien

Quality of SSL protection for US financial institutions

Troy Hunt put together a list of top Australian banks and their SSL rating using the Qualys SSL Server Test that reveals the somewhat depressing state of SSL security of various banks down under.

This got me wondering how US financial institutions stack up and I thought I’d share:

Update Nov 2015: Lots of great progress by many of the institutions with the exception of KeyBank still showing Poodle vulnerability, Union needing to support newer tech, Mint lacking overall considering they’re a tech company and Citibank being lame for blacklisting SSL Labs.

[)amien

Revitalizing a BBC Micro

BBC attached to Amstrad monitor and giant twin floppy drives Moving house means making possessions count so my collection of vintage computers has shrunk over the years and the bar keeps getting higher. Right now:

  1. It works – Test it, repair it or part with it. A wealth of online technical information makes this easier than ever.
  2. A small footprint – Eject unusable peripherals and accessories. Keep the essentials.
  3. Make it usable – Forget slow-loading tapes and corrupt disks, a fast loading is essential.
  4. Something special – It should either be collectible or one I have a connection with.

Recent casualties were my Apple ][e (no disks), Acorn ARM (wouldn’t boot) and Commodore VIC 20 (poor state). Next up is my Acorn BBC Micro B:

Physical inspection

My ‘Beeb’ is in good condition and works well although the case screws have long since disappeared (a common theme in my collection) and it needed a good clean. These older mechanical keyboards attract serious dust and dirt.

Schools were filled with BBCs in the 80s and I’ve written about the origins of this love affair before. I learned first BBC BASIC and then some 6502 assembly (mixing it with Basic) while at school. I later picked this machine up around 91 after seeing a local paper advertisement.

A giant twin 5.25″ drive housing system (shown above) contained my one still-functional floppy drive. I want to be able to read some physical disks but in keeping with the minimal footprint I transplanted the floppy drive into a 5.25″ externally powered CD-ROM enclosure. Big reduction.

The BBC Micro has a few video output options – UHF, composite over BNC and RGB over 6-pin DIN connector. By a staggering coincidence the pin out is identical to the Amstrad CPC so works directly my Amstrad monitor, no adapter cable required this time!

Replacement media, SD cards via GoSDC

BBC Micro with SD Card fitted

SD cards are my replacement storage of choice for vintage systems. I chose John Kortink’s GoSDC for the following reasons:

  1. Supports MMC, SD, SDHC up to 32GB
  2. Internally fits into a spare ROM socket
  3. Adds operating system commands for great integration
  4. Supports disc images, tape images and ROM images

Retro Isle comprehensively reviewed GoSDC in February (2015) and have a bunch of usage tips and tricks too.

Getting started with GoSDC

GoSDC installed inside a BBC Micro model BThe device plugs into a ROM slot but to make life easy you can give it access to a second one so it can patch the filing system. The docs are complex as they describe the many possibilities available. Here’s my setup that works well on a BBC Micro Model B (known as Option B in the docs):

  1. Remove Acorn DFS ROM
  2. Fit GoSDC in slot third from right
  3. Fit cable from GoSDC jumper (middle-left) to pin 6 up from bottom right
  4. You should be left with the Acorn OS ROMs in the ROM sockets to the left of GoSDC

Once fitted, slide in an SD card and power up your BBC and you should see the usual welcome screen. Then type *SDCINFO and see the results:


BBC Computer 32K

Acorn DFS

BASIC

>*SDCINFO

GoSDC (mbe) 1.05 (01 Sep 2014)

ROM slots : main 15, free 13

Flash ROM : S25FL007, 1024 KiB

Flash card : SDHC, 7580 MiB

Available areas
---------------
X :     416256 bytes
1 : 4294966784 bytes
2 : 3653238784 bytes

>

If you see ROM slots main and free with numbers your device is correctly controlling two slots and can patch the DFS for you. If not, check the adapter and cable.

If you see “GoSDC : No flash card inserted” check the card is securely in and power cycle the machine. If it still doesn’t recognize it try another card. Note: When switching card you will need to press CtrlBreak for the machine to recognize it.

The first time you use a card you’ll need to format it. The command and subsequent output should look like this:

>*SDCTOOL SDCFO
Formatting area ... done
Verifying format ... ok
Please hard-reset your machine now
>

If you have a card greater than 4GB then it will create 4GB areas which can be switched between with *SDCAREA number. I’d recommend switching to the additional areas, formatting and CtrlBreak after each before you put any software on it as this command will wipe it out again.

Finally you’ll need to tell GoSDC to provide a patched filing system like this:

*SDCCONFIG FSNR 1
*SDCCONFIG FSRM 13
*SDCRESET
  • 1 sets Acorn DFS on my machine although the docs says it should be 2
  • 13 should match the free ROM slot shown in *SDCINFO

If you mess up your ROM selection and are unable to type because of ‘No drive’ do not fear! Press caps-lock and break twice to get the prompt back and choose another.

Finding old software

One option is to image all your floppy discs to SD card but you are probably going to find that those discs are corrupted. Thirty year old floppy disks are not reliable.

Another option is to download old software online. This can be a grey area as the software is copyrighted but no longer sold and many authors are okay with allowing it (e.g. Ian Bell and David Braben of Elite fame). A great site that honors the wishes of authors can be found at the weirdly named Stairway to Hell.

The author of GoSDC supplies Windows scripts to download, unpack and write the files to disc which I took the liberty of porting to Bash so they could be used on Mac OS X and Linux.

Purely based on subjective childhood experiences…

  • Elite a 3D space trading game so good they recently Kickstarted Elite 4
  • Citadel one hundred screens of arcade adventure madness
  • Chuckie Egg quick platform dash with birds, ducks, eggs and platforms
  • Repton Boulderdash to the next level, try 1 or 3, Repton 2 is insanely hard
  • Granny’s Garden educational fun alas distribution is denied as they sell an iPad version

Using GoSDC

Once the card is loaded up with software the actual commands are simple:

*SDCLIST

Will list the contents although you’ll probably want to put a wildcard after it to limit it down. Remember CtrlShift pauses the screen on the BBC!

Then, to mount a disc you use *SDCDISC and provide the name to mount. You can also use wildcards here and it will pick up the first match. e.g.

*SDCDISC *Chuckie*

Once mounted hold down Shift and tap Break to boot the game (or educational title, right?)

A few other useful commands are:

*. List contents of a disc
*EXEC !BOOT What ShiftBreak actually does
CHAIN "filename" To LOAD and RUN a BASIC program from disc
*filename To execute machine code programs from disc

I put some BBC Micro tips and tricks together or you can can grab PDFs of pretty much every book created for the BBC Micro .

You can also see which discs are currently selected using *SDCDISC with no arguments. You’ll note you can mount a second disc and the command to do that is *SDCEXTRA with usage otherwise exactly like *SDCDISC.

GoSDC can do much more including imaging your real floppy discs and writing them back out so be sure to check out the comprehensive documentation which also includes how to upgrade the firmware (use another memory card as that process uses FAT no the GoSDC file system)

Out for Pi Day!

Pi Day (3/14/15 = 3.1415) was last weekend and my work put on a session for kids about how to program the Raspberry Pi using Scratch and a bread board (using CanaKits so we had a bread board, LEDs, switches, wires, resistors etc.).

The original Raspberry Pi was heavily inspired by the BBC Micro and even the name “Model B” took cues from the original. Few people also seem to realize that the manufacturer of the BBC Micro – Acorn – went on to create a processor for its sequel the Acorn RISC Machine or ARM for short. That’s right, the Pi is powered by an Acorn processor design (like most smartphones) so it made sense to bring it in.

Alas it was a hectic event with little time to show the machine. In fact just sitting there it popped a capacitor in a puff of smoke!

Power supply repair

Despite the noise and smoke the dying capacitor didn’t actually stop the machine working as it is part of the electromagnetic interference suppression not the power circuitry itself. Still, it should be repaired and I thought I may as well replace the other X2 film capacitor as they have been failing over the last 30 years.

BBC power supply with blown X2 capacitor BBC power supply with new X2 capacitors

I picked up a couple of RIFA PME 271 M capacitors – 100nf and 10nf – (with a matching pitch so they would fit correctly) from Mouser for less than $2 each plus shipping. Five minutes of de-soldering and soldering later and it was good as new!

[)amien