Electron User


User Port

Author: Joe Pritchard
Publisher: Project Expansions
Machine: Acorn Electron

 
Published in Electron User 4.06

When Acorn designed the Electron, the aim was to produce a cut down BBC Micro and some of the most useful features were omitted in order to keep the cost down, including Mode 7, the serial interface, printer port and user port.

Most people don't miss the user port, but the lack of Mode 7 and printer port is a much more serious problem.

An Acorn Plus 1 adds a printer port, and software can be written to avoid Mode 7, but anyone wishing to use the Electron to control and sense the outside world is stuck - a user port is essential.

This is one of the reasons why the BBC Micro is widely used in schools and by electronics and radio enthusiasts who want to use their micros to control other electrical devices.

The Project Expansions user port is built into a ROM cartridge and fits into the Acorn Plus 1. It sets out to provide Electron users with a port to match the one on the BBC Micro.

Before I go on to look at how well it does this, let's start at the beginning: What is a user port? Simply put, it's a socket that allows you to pass electrical signals to the computer from external devices and vice versa.

The socket has 8 pins enabling 8 separate electrical signals to pass between the computer and external circuits at the same time. For this reason it's called an 8 bit port.

Both the BBC Micro user port and Project Expansions (PE) port are mapped into the main memory and are programmed by poking and peeking.

The PE port is addressed at memory locations &FCB0 to &FCBF. So the user port is treated as a byte of memory and can be written to and read from as if it were any other memory location.

The difference is that any bits that are set in a byte written to the user port will cause the relevant pin of the socket to carry a 5 volt signal.

And each zero bit written causes the relevant pin to carry a 0 volt signal. These signals can be used to control external devices.

Similarly, if we're reading a byte of data from the user port, a 5 volt input to any of the pins will be read as a 1 bit and a 0 volt signal as a 0 bit.

Once you've got a user port the world of robotics and interfacing is wide open. You can use it to control motors, monitor sensors such as switches, light sensors, temperature sensors and so on.

Radio amateurs and electronics enthusiasts can use their micros to read morse code and teletype signals providing they've got a suitable radio set - or even monitor electronic circuits to find out what's wrong with them.

If you're interested in putting your micro to this sort of work, take a look at Mike Cook's Body Building Course in The Micro User for some idea of what can be done.

The uses of such a port are only limited by your imagination - and your ability to write the programs to handle the new add-on electronic devices.

The PE user port uses the same Versatile Interface Adaptor (VIA) chip, as the BBC Micro's port. The electronic design looks good and no unusual chips have been used, which should make any repairs, however unlikely, reasonably easy.

The main chip, a 6522, is very versatile providing two ports and a variety of timing functions which can be used by machine code programmers to good effect.

Only one of the available ports is used here. And the socket in the cartridge that allows you to connect things to the user port is identical to that on the BBC Micro.

This enables PE user port owners access to at least some of the hardware produced for connection to the BBC Micro.

As already mentioned the PE port uses addresses &FCB0 to &FCBF. The BBC Micro port uses addresses &FE60 to &FE6F, so if you're using programs that were originally written for the BBC Micro you'll need to alter them before they'll work properly on the Electron.

The reason for this is that the Electron's hardware is arranged differently and addresses &FE60 onwards are used for other purposes.

As well as providing a user port the timers in the 6522 VIA can be used in programs to provide accurately timed interrupts or time delays.

A tape of software was provided with the review port, all of which was quite interesting. Especially useful to me was a short routine for decoding radio teletype signals off air and displaying them on-screen.

Another program demonstrated the use of the VIA timers and there is a simple but effective program to monitor the port if it's set up as 8 inputs.

The problem with reviewing a user port is that it either works or it doesn't; it's not like a game or educational software where you can tell how effectively it works.

Much of the value of a user port comes from how it's programmed, and of course this is up to you.

That said, overall the port and accompanying software are well worth considering by all intrepid Electron interfacers.

Joe Pritchard