<< BACK | NEXT >>

PC to BBC Micro serial cable

28th May 2015

As part of my RAM upgrade procedure for my BBC Micro model B+, I wanted to run my sideways RAM bank detection program. The trouble is that this program, although not lengthy, is still too long to type each time I want to run it after making a hardware change. The options to resolve this was to:

1) Save to traditional local storage such as cassette or disc.
2) Save to MMC card local storage
3) Transfer the program via serial cable

I opted for option 3 as it was a little more interesting, although the MMC card was as good an option as well.

Serial ports

The serial standard that I used was RS232C (despite the BBC having an RS423 - it's compatible). This standard is implemented on PCs as either a male DB9 (9 pin D shaped socket) or DB25 socket (25 pin D shaped socket). These sockets are generally speaking not provided on many PCs these days and almost never on laptops with the 25 pin one especially is no longer used. However, you can purchase PCI or PCIe cards for your PC or use simply use a USB to serial adapter cable. Both are usually priced under £10.
Here's what the 9 pin port looks like in the form of a PCIe card:


(click image to enlarge)

Older PCs which have the port either one or two ports fitted as standard will have them further up the back of the PC and the ports orientated by 90 degrees so (on a standard tower) they will be aligned vertically.

The BBC Micro implements a 5 pin DIN port to connect to the RS423. This is not a standard 5 pin DIN, but a "domino" one. Here's the port on the rear of the beeb:

(click image to enlarge)


Connectors

The connectors differ between the PC and BBC Micro. The PC one (as previously advised) uses a DB9 connector shown below. I've pictured it without the outer plastic casing as I don't have any (some are on order):

(click image to enlarge)

For the BBC Micro, it uses an old-style 5 pin DIN connector, but one of the domino variety- a central pin with 4 pins surrounding it as opposed to the standard type which using an arc of 5 pins. Out of the pictures below the one on the left is the one used by the BBC Micro and the one on the right is the standard one.
In truth, Acorn really should have gone with a different connector altogether as it's quite possible to insert the plug in the wrong way around with the domino version (doesn't cause harm - just doesn't work). I understand why they avoided the standard one, though, as it would be possible to insert it into the cassette interface port (7 pin "arc" DIN socket) by mistake and probably cause damage.

(click an image to enlarge)


Soldering the cable

The cable needs to be connected up in the following way. Note that the diagram shows the connectors from the solder/rear end looking into the connectors.


Method-wise, you should notice that the pins are hollow on the solder end. This means that you can heat each pin up and melt a little solder into each so that you can see the solder, but not so much that protrudes. To do this simply heat the outside of the pin with your soldering iron and then poke your solder into the hollow pin. The solder should then melt.
A small caveat is that if you leave the soldering iron there for too long you may find that the plastic off the connector begins to melt and the pins will end up jutting of at odd angles. This happens more quickly if you have a temperature controlled iron which is set too high. I tend to use 350 degrees (which is high-ish), but I don't leave it against a surface for too long.
With regard to the cable, you can use anything you like. Just keep the following in mind:

1) Ensure that you have enough cable length. It can be quite aggravating to find out afterwards that it's too short! Been there, done that :).
2) The cable needs to be multi-strand and not single core. Single core ones break easily with multiple use/flexing.
3) Remember to thread the cable through the outer plastic case of the 5 pin DIN connector before you solder it at both ends.

And here's the cable:

(click image to enlarge)


Software & Settings - PC

With the serial cable plugged in both to the BBC Micro and the PC, you need to configure the both to get things to work. First off, you need to check which COM port that you're using.
COM ports can range between 1 and 256 with each representing either a physical or virtual serial interface. Typically, COM ports are assigned to physical interfaces first which means that the number is likely to be low and normally COM1, COM2, COM3 or COM4.
You can download software from the internet which will give you a list of ports, although a little investigation of Device Manager will reveal what you need to know. Also, you can set the default settings of the ports, although this is really necessary. To get to device manager:

- Windows Vista/7 : Click the START button, right-click COMPUTER, click MANAGE, click DEVICE MANAGER in the left pane.
- Windows 8/8.1/10 : Move the mouse cursor into the far bottom left corner of your screen. Right-click and click on DEVICE MANAGER.

In the list of devices locate the Ports (COM & LPT) category. Click on the small white arrow to the left of it to open the category up.
You should see a list of ports, at least one of which should mention the word Serial or COM. if you don't see one there then either the COM port is disabled in the BIOS/UEFI (for built in ports), the drivers are not installed (for PCI/PCIe cards) or not plugged in (in the case of a USB to serial cable). Here's what my PC reports:


These are the possible COM ports that Windows is seeing. As I have a PCI to serial card fitted which has two serial ports on it, device manager is reporting two COM ports: COM3 and COM4
Next, we need to choose a Terminal Emulator program as Windows hasn't shipped with one since windows Vista. My favourite is PuTTY as it can do Telnet and SSH as well (not that we're going to use those protocols for this).
Once PuTTY is downloaded, you need to set up a few options. First of all, open PuTTY and select Serial at the bottom of the list on the left next to Serial line to connect to enter the COM port which you're using. In my case it's COM3 For the rest of the settings the following should be used:
Speed (baud) 9600
Data bits 8
Stop bits 1
Parity None
Flow Control None
Once done, click on Session in the list on the left. Under Connection type select Serial and then under Saved Sessions enter a name for your settings (can be anything). Click Save.

Software & Settings - BBC Micro

The BBC Micro simply needs to be told what speed to communicate at and to use the RS423 port instead of the keyboard. Enter the following commands:

*FX7,7 (sets the receive speed to 9600 baud)
*FX8,7 (sets the transmit speed to 9600 baud)
*FX2,1 (sets the RS423 port for input)

If you now click on Open in PuTTY on your PC and start typing, the output should appear on the BBC Micro display as if you're typing on the BBC Micro's keyboard. On the face of it, this isn't hugely useful. However, you can paste text from the windows clipboard into PuTTY and it'll appear on the BBC Micro as if you typed it. This means if you have a large program of text document which you need to xfer you can simply copy & paste it.

BBC RS423-related command guide

Setting the receive speed
This sets the speed that the RS423 port on the BBC Micro receives data, rated in baud (bits per second).
The number appearing after the *FX7, command denotes that speed:

Command Speed (baud) Notes
*FX7,1
75
 
*FX7,2
150
 
*FX7,3
300
 
*FX7,4
1200
 
*FX7,5
2400
 
*FX7,6
4800
 
*FX7,7
9600
Recommended
*FX7,8
19200
Not guaranteed

Setting the transit (send) speed
This sets the speed that the RS423 port on the BBC Micro transmits data, rated in baud (bits per second).
The number appearing after the *FX8, command denotes that speed:

Command Speed (baud) Notes
*FX8,1
75
 
*FX8,2
150
 
*FX8,3
300
 
*FX8,4
1200
 
*FX8,5
2400
 
*FX8,6
4800
 
*FX8,7
9600
Recommended
*FX8,8
19200
Not guaranteed


Setting the input device
This sets main user input device (usually the keyboard) on the BBC Micro. This can be one or more of the following: Keyboard (default) or RS423 serial.
The number appearing after the *FX2, command denotes which device is set to be the main input device, which one is enabled and which one is disabled:

Command Keyboard RS423
*FX2,0 Main Input Disabled
*FX2,1 Disabled Main Input
*FX2,2 Main Input Enabled


Setting the output device
This sets main user output display device (usually the screen) on the BBC Micro. This can be one or more of the following: Printer, Screen (default), and RS423 serial.
The number appearing after the *FX3, command denotes which devices are enabled and which ones disabled:

Command Printer Screen RS423
*FX3,0 Enabled Enabled Disabled
*FX3,1 Enabled Enabled Enabled
*FX3,2 Enabled Disabled Disabled
*FX3,3 Enabled Disabled Enabled
*FX3,4 Disabled Enabled Disabled
*FX3,5 Disabled Enabled Enabled
*FX3,6 Disabled Disabled Disabled
*FX3,7 Disabled Disabled Enabled







<< BACK | NEXT >>



Site Map | CSS Hover Menus by Css3Menu.com