Planet Nottinghack

03 June 2017

Spencer Owen hackergotchi for Spencer Owen

Decoding ROM labels

Back in the earliest days of the RC2014, it came with a pre-programmed 64k ROM, with Microsoft BASIC on it in the first 8k, and it would work with 32k of RAM and a 68B50 ACIA.  One set up, one ROM, life was simple!

As time has gone on, and more options have become available, other ROM images, such as Microsoft BASIC for 56k RAM, or CP/M Monitor have been introduced.

Future possibilities, such as other UARTs, different CPUs or other variations will inevitably lead to more ROM images being needed.  So, in order to keep track of what is programmed where, ROMs are now being shipped out with a label on them.

Every ROM now has an 8 digit code on it.  Each digit, from left to right, refers to an 8k bank from 0x0000 to 0xD000.  This bank can be selected with the A13, A14, A15 jumpers;

Address A15 A14 A13 ROM Label
0000 0 0 0  Xooooooo
2000 0 0 1  oXoooooo
4000 0 1 0  ooXooooo
6000 0 1 1  oooXoooo
8000 1 0 0  ooooXooo
A000 1 0 1  oooooXoo
C000 1 1 0  ooooooXo
E000 1 1 1  oooooooX


The value of the digit represents the ROM image that sits in that particular 8k bank.  Currently, it will be one of the following;

0 – Empty bank, available for user to program

R – Microsoft BASIC, for 32k RAM, 68B50 ACIA, with origin 0x0000

K – Microsoft BASIC, for 56k RAM, 68B50 ACIA, with origin 0x0000

3 – CP/M Monitor, for pageable ROM, 64k RAM, 68B50 ACIA, CF Module at 0x10, with origin at 0x0000

5 Microsoft BASIC, for CP/M installation, as per 3, with origin at 0x2000


As more ROM images are added, this list will be updated.

by Spencer at 03 June 2017 12:25 PM

01 June 2017

Spencer Owen hackergotchi for Spencer Owen

Peripheral Addressing

The RC2014 currently uses a very simple, although inefficient method of addressing peripherals.  Most of the expansion modules feature a 74HCT138 used to provide up to 8 enable lines from 3 address signals.  For the purposes of this document, I will mainly refer to the Digital I/O Module, but the principals apply to all modules with a 74HCT138 (generally referred to simply as ‘138)

It is worth noting that the Z80 CPU can address up to 255 Input or 155 output addresses.  These are selected by the first 8 address lines (A0 – A7), IORQ going low and either WR or RD going low.

The ’138 has 3 enable pins, G1, G2B, G2A, all of which need to be true (G1 needs to be high, and both G2B and G2A need to be low) for the ‘138 to be enabled.  When it is enabled, the 3 address lines, A0, A1, A2 are read.  These 3 addresses have 8 possible combinations (000, 001, 010, 011, 100, 101, 110, 111), which will activate one of the 8 outputs Y0 to Y7.

In the Digital I/O Module, the ‘138 is activated when M1 is high, IORQ is low and A7 is low.  This corresponds to any port from 0 to 127 (IORQ being low indicates the address bus represents port, and A7 being low indicates the address bus is lower than 127).  [Side note – Serial I/O Module uses addresses 128 and 129, which are indicated by A7 being high].

The Z80 address pins A0 and A1, along with WR are connected to the address pins A0, A1, A2 on the ‘138.  This gives 4 addresses (00, 01, 10, 11) with the write bit high, and 4 with it low.

In normal use, the ports are addressed as 0 (In 0 or Out 0) on the Digital I/O Module.  (Or port 0, 1, 2 on the Digital Input module, for example).  However, any address that has A0, A1 and A7 low will work; 0—–00.  So echoes of this will appear on 4, 8, 12… 124.  So, whilst this works, and is fine for a small system without much I/O requirements, it quickly becomes inefficient as you need more ports.  In particular, it will clash with the Compact Flash Storage Module, which can have an impact on running CP/M.

In an ideal world, every peripheral should have a unique address, and with a lot of digital logic, this is certainly possible to do.  However, it will add both complexity and cost as well as needing more board space.

The easy solution, however, involves just 6 diodes and a resistor.  By connecting address lines A2 – A7 to the anode of each diode and the cathode of each diode to the G2A enable pin on the ‘138, any address above 00000011 will prevent the ‘138 from being enabled.  Effectively all the diodes are acting as a very simple OR gate.  A 10k resistor will bias the output low.

So with this set up, it will give just 4 unique addresses; 00000000, 00000001, 00000010, 00000011 (ie 0, 1, 2, 3) which for the Digital I/O Module, or the Digital Input or Digital Output is ideal.

Other addresses can be selected by changing which address pin the diodes are connected to.  So, for example, if A1 was connected to a diode instead of A3, and A3 went to the ‘138, the addresses would be 00000000, 00000001, 00001000, 00001001 (ie 0, 1, 8, 9).  Whilst it cuts down on the echoes at higher addresses, it’s still not perfect – but much better and still very cheap with minimal extra board space needed.

The Digital I/O Module has now been updated to reflect this change.  As PCB stocks run low on other modules, they too will have similar updates.  If you already have a non-diode selectable module, and wish to implement this, it is actually very simple to do as shown below.

by Spencer at 01 June 2017 02:21 PM

04 May 2017

Martin Raynsford hackergotchi for Martin Raynsford

Customised Bird Box

One of the great things about laser cutters is mass customisation, you can make lots of the same thing but customise them all to be personalised. This was just a standard bird box we bought from a store (because I didn't have time to make a whole one) but we were able to engrave names and dates on it quickly for a diamond anniversary present. The Z axis on the laser cutter drops down low enough to get the whole box under the cutting head so the process was relatively simple.

by (Martin Raynsford) at 04 May 2017 08:00 PM

02 May 2017

Spencer Owen hackergotchi for Spencer Owen

Retro Challenge 2017/4 – Rack Teardown and Wrap Up

Ok, firstly, apologies for the lateness of this post.  The stuff below was actually done a couple of weeks ago, but time has just got away from me.  Hence this is being written up 2 days past the closing date for RC2017/4.  Sorry

Anyway, this part of my challenge involves investigating a rack that came as part of the old stuff that I picked up.  Looks like a 3 bay x 12 slot Eurocard rack.  Lets take a closer look…

At the back of the rack there’s 3 big power supplies.  Very big!  One for each of the 3 bays supplying 12v and 5v.

There were no cards in the rack when I got it, so the obvious thing to do is check they fit… well, no, not quite.  The guides take the cards in at quite an angle.  I assumed that there’s some adjustment and it just needs a bit of tweaking to get everything straight.  Lets start taking things apart to do that…

The top and bottom panels slide out without too much trouble after removing a couple of screws…

The 3 power supplies need to be removed to get at the back of the bays

Can’t see any adjustment yet.  However, we can see where the power rails are connected

Looks like the power rails are very very beefy!

On closer inspection, the PCBs are trippled up!  3 layers of PCB! Why?  The sockets are, I assume, wire-wrap sockets, hence having leads long enough to get through 3 boards.

And, not only that, but everything apart from the power has been disconnected between sockets.  Judging by the straightness, it’s been cut by hand!

And, looking at all the support rails and hardware, they have all been cut to length by hand too… but not with any consistency – hence the wonkyness of the cards.

Further investigation shows that nothing is likely to line up, the backplane is, well, just odd, but that the new backplane boards (which would feature in a later part of this Retro Challenge) would fit.

In all honesty, I really don’t know what to do with this.  I suspect that it was probably built as some kind of test rig, but I doubt that it’s actually been put to any use otherwise cards would slide in and out.  Apart from a lot of dust, there’s not really any signs of use.  However, I’ve got some 10 slot and 12 slot backplane PCBs that are new and unused, so it is tempting to re-cut all the hardware to accommodate 3 of those.  But, that would still beg the question about what I would do with it.  Hmmm… maybe this will reappear in another Retro Challenge some time in the future.  Who knows?

by Spencer at 02 May 2017 09:30 PM

01 May 2017

Iain Sharp

A DSONano tile for my LushOne system

Portable oscilloscopes seems to be a product category where nobody ever gets things quite right. There are some signs that the new generation of tablet-based scopes will finally fix that, but for now we make do as best we can. My portable scope is a DSO-Nano v2 which was a present from my wife. I use third-party software on it which has a lot of improvements compared to the official load but it’s still klunky. Having said that, if you just what to quickly check an audio frequency waveform it really is something you can take anywhere.

I’ve also found the DSO-Nano useful as something I can quickly fire-up to check signals in my LushOne modular synthesizer system. So, having given my synth a permanent home it seemed natural to fill the one empty tile with a mounting for the DSO-Nano.

The tile was made from scrap items and parts-box contents. For the board I used an old prototype LushOne PCB which I covered in black tape to make it look tidy. The DSO-Nano is just held on with velcro so it can easily be detached for other uses. An old USB-mini lead was cut-up and connected to a 5V regulator to provide power to the scope. An old 3.5mm jack lead (broken at one end) was “upcycled” to provide a break-out to the 2mm sockets used in the LushOne.

I like the result – it gives the system a nice feeling of completeness and adds a valuable tool.

by Iain at 01 May 2017 04:06 PM

30 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

vanillabox unsuccessful crowdfunding

It’s our sad news to announce that we did not successfully attract enough backers to go forward with further development and production of the vanillabox laser cutter. We’d like to thank all those who did back us (you’ve been emailed separately) and to everyone who has supported us through emails, tweets and interest during this project. As of right now, we are unsure what future the vanillabox has.

Team vanillabox

Dominic Morrow, Martin Raynsford , Ian Dickinson

by (Martin Raynsford) at 30 April 2017 01:39 PM

26 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

1000 Sharks need a new home

To celebrate making 1000 different things on my blog, I made 1000 sharks in a big shark tank, we took it to Derby Maker Faire and now we're not sure what to to with it. If you would like to own the project it can now be yours, you will need to come and collect it from Nottingham and you will need a transit van to put it in (or you could just take the sharks). Please email me if you would like it,

by (Martin Raynsford) at 26 April 2017 11:27 AM

23 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

Parquet Flooring

There are a lot of interesting floor tiling patterns that I thought it would be fun to recreate for model makers. This parquet flooring pattern is neat and efficient. All the 'planks' can be lined up and cut together from a single sheet of material ensuring all the grain runs the same way before being cut and that just adds to the effect once they have been placed. I drew the pattern on the base plate to ensure everything was lined up squarely as it was glued in to place.

by (Martin Raynsford) at 23 April 2017 09:29 PM

22 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

Fancy Box

Another vanillabox sample, this time a fancy box. I wanted it to be different to all the other boxes I've made, I didn't want any visible finger joints and I wanted a fancy pattern on the sides. It's effectively a two skin box, the inner holds the finger joints and the out has the decorative panels, the lid overlaps the inner to make it stay in place. The inside of the hex pattern was engraved to make it appear to be cut from a different material (although with the two skins it could actually have been cut on the inner layer). Low power lines complete the knot work appearance. I'd be tempted to make it again as a hexagonal box so I'm going to hold the files back for the time being.

by (Martin Raynsford) at 22 April 2017 02:15 PM

19 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

Metal Inlay

Another vanillabox sample piece, this time I wanted to demonstrate what could be done with a little bit of imagination. The large block of oak was cut by hand and the pattern cut into the top surface. Each ring was made by putting multiple low power cuts next to each other, this left a gap that was large/deep enough to accept a strip of metal which was hammered into place. The whole thing was sanded, varnished and polished within an inch of its life.

I was intending to write an instructable about how to do this but somebody else beat me to it so if you want to make your own inlays I would suggest you read this instead.

by (Martin Raynsford) at 19 April 2017 10:57 PM

17 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

Lasercut Vase and Flowers

While making samples for the vanillabox I was keen to experiment with new/cheap materials. I modelled this vase in 3D and sliced it with 123D make (which now appears to have gone), I cut each layer in corrugated card. I actually started life as a lampshade but it didn't let enough light through so when it was flipped upside down I realised it would make a nice vase. The petals for the flowers were all cut from crepe paper using a very low power so as to minimise the burning around the edges. The petals were wrapped with floral tape and wire to create the flower shapes. At the maker faire we had to label the item because people didn't realise the flowers were laser cut.

by (Martin Raynsford) at 17 April 2017 01:22 PM

12 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

Infill Acrylic

A lot of work has been done to use a wax infill on engraved items to provide a high colour contrast. For this cat image I achieved the same effect using acrylic paint instead. The process is relatively simple, the acrylic was engraved and cut with the protective layer still on the sheet. The engraving was done through the cover which left some texture in the dent. The whole thing was painted black afterwards and when the paint had dried I peeled off the protective layer, essentially making my own stencil for the item I had just cut. It's a rather effective technique I'm sure you'll agree. (svg here)

by (Martin Raynsford) at 12 April 2017 07:59 PM

Spencer Owen hackergotchi for Spencer Owen

Retro Challenge 2017/4 – Keyboard Investigations

After a visual check of the keyboards (see this post), I had a couple of questions, which were do the keyboards work? and how do the keyboards work?

On the basis that neither of the Alphameric had their EPROM windows covered, and that one of the Cherry keyboards had already been modified, I chose the other Cherry one as the most likely to work.  After opening it up (again), I checked the 20 pin header.  It was quite easy to find out what the 5v and Ground pins were (traceable to the power pins on the logic chips and corresponds to red and black wires on pin 1 & 2!), but the others were going to need something more to diagnose

Time to break out the oscilloscope!  It didn’t take long to discover that the pins 3-9 changed upon pressing a key.  Curiously, they didn’t didn’t change when releasing the key though.  Also, depending on which key was pressed, they might not change at all.  Pin 9 was most likely to change and pin 3 was least likely to change.

So, there we have a 7 bit ASCII pattern!  The value was being latched, and pin 11 was a pulse to indicate that a valid signal was ready to be read.

For last years Retro Challenge Andy Collins had done pretty much the same but opposite thing, where he had a faulty Alphameric keyboard that he replaced with an Arduino & USB keyboard.  The timing diagram was particularly useful, so thanks Andy!

If an Arduino can be used to simulate being a keyboard, then it can also be used to read one!  So I plugged in a cheap Uno that I had lying around and wrote a quick sketch to read the data pins D0 – D6 every time the strobe pin goes high, then convert this in to an ASCII number and print the character on the serial port.  I also got it to print out the ASCII code itself, which was handy for working out what keys had non-printable characters

The regular keys A-Z were affected by the two modifier keys to give 3 different characters (a, A and ASCII 1, or b, B and ASCII 2 etc.).  The Del key was the only other one to have 2 modified outputs, but most of the others had just one output regardless of the shift or control key being pushed.

I had a spare Arduino Mini Pro clone lying around and also a 25 pin D socket, so I figured it might be handy to make up a slightly more permanent adaptor that will plug in to the keyboard.  Some of the soldering is a bit dodgy here, but it’s all solid enough :-)

Also, the important thing is that it all fits inside the 25 pin D shell!

The Cherry keyboard worked exactly as expected, and allows me to use it with my RC2014!  However, I wanted to know if the other, Alphameric keyboards would work too.

They had the same connection, although I hadn’t done any of the diagnostic work that I did with the Cherry one – but it was worth taking a chance.  And it turns out that yes, they work too!  Well, the regular Alphameric keyboard works exactly as the Cherry one does!

The one with the hex keyboard, though, only partially works.  The main keyboard section works as expected, however, the hex keypad sends out odd key codes.  Some of them output several characters, and can even put the RC2014 or the Arduino adaptor in to a weird mode that means the main keyboard types weird stuff until it is reset.  Not sure if this is something to do with bit corruption in the EPROM, or some other kind of error, or if it’s actually by design – however, that’s for diagnosis another time.  There’s still lots more stuff I need to go through yet and time is ticking away…

Arduino Code

#define Strobe 9
#define DATA0 8
#define DATA1 7
#define DATA2 6
#define DATA3 5
#define DATA4 4
#define DATA5 3
#define DATA6 2

int DATABYTE = 0;

void setup() {
  pinMode(DATA0, INPUT);
  pinMode(DATA1, INPUT);
  pinMode(DATA2, INPUT);
  pinMode(DATA3, INPUT);
  pinMode(DATA4, INPUT);
  pinMode(DATA5, INPUT);
  pinMode(DATA6, INPUT);
  pinMode(Strobe, INPUT);
  digitalWrite (Strobe, HIGH);
  //Serial.println ("Started");

void loop() {
int pulse = digitalRead(Strobe);
  if (pulse == 0 ) {

void printASCII() {
  delay (1);
  DATABYTE = ((digitalRead(DATA0)) + (digitalRead(DATA1) * 2) + (digitalRead(DATA2) * 4) + (digitalRead(DATA3) * 8) + (digitalRead(DATA4) * 16) + (digitalRead(DATA5) * 32) + (digitalRead(DATA6) * 64));
  //Serial.print(" ");


by Spencer at 12 April 2017 02:44 PM

10 April 2017

Spencer Owen hackergotchi for Spencer Owen

Retro Challenge 2017/4 – The Key(board) to Happiness

Next up on the things to investigate is the 4 keyboards

Judging by the connectors, it was obvious that these aren’t modern (PS2, USB or even 5 pin DIN) keyboards.  Likely either a raw matrix or maybe parallel ASCII.  Lets open them up and have a poke around!

First off the block was this dusty looking thing.

Initially I didn’t take much notice of the sticker on the bottom, so when I opened it up, I was surprised to see it was a Cherry keyboard.  Of course this was before the days before colour, so the Cherry Green or Cherry Red key switches weren’t an option – These were just generic black.

The use of an EPROM in a keyboard came as a bit of a surprise to me too.  However, it makes sense.  There is a Philips MAB8035HL microprocessor onboard, which does all the row and column scanning, then, presumably , looks up the character that this key corresponds to on the EPROM, and puts the ASCII value of that character on the parallel connector.  Using an EPROM for this would allow for different locales.

This particular one had the original connector cable replaced with a 20 pin ribbon cable socket.  This may be of some relevance later in this Retro Challenge!

Next up was another one virtually the same.  The only difference of note though is the original cable, terminated with a 25 pin D plug, was still in place.

The third keyboard was a bit more solid construction, and was branded as Alphameric.  It had a similar design with an 8035 microprocessor and a 2k EPROM.  Interestingly, they had stuck an identifying sticker on the EPROM, but not over the window!  I’ve no idea how UV-proof the keyboard case is, or if it’s been stored in a dark location for most of it’s life, but I’d assume that at least some of the bits would have leaked out over time and got carried away on a sunbeam.

The external connector was a 25 pin D, although internally it was fed from a 16 way ribbon cable.

Of the 4 keyboards, this last one was my favourite.  Really, who doesn’t like a keyboard with a hexadecimal number pad!  Maybe the designers were very forward-looking and anticipated the rise of IPv6! ;-)

This was obviously from the same range as the previous Alphameric keyboard as everything about the PCB and layout was the same, with the obvious additional keys on the number pad.  Curiously, not only did this have all the numbers from 0-F, but 10 function keys and also 5 unmarked keys.  One of these keys had an extra heavy duty spring under it, so possibly this is a reset button or something else important that you don’t want to push by accident.  Again, the EPROM window had been missed by the sticker!

The case itself is a combination of moulded plastic and some kind of compressed moulded heavy fibreboard type stuff for the base/sides.

Connection was via the same kind of ribbon cable to 25 pin D plug.  I traced a few of the connections through and have identified the power & ground pins and 9 data pins (8 data and 1 strobe? or 7 data and 2 control lines?).

Next step is to feed them some power and see what data comes out.  I’m hopeful that the EPROMs with non-covered windows are still intact, but will start with one of the Cherry ones, just to get an idea of what to expect.  It will also be worth pulling the EPROMs and sticking them in a reader – partly to archive them, partly to see the code they run, and partly to play around with the character map.  That might not happen during this Retro Challenge time frame though.

Alphameric was disolved in 2007, however, the keyboard side of the business was sold off in 2004 to Devlin, who make commercial input devices.

by Spencer at 10 April 2017 03:34 PM

07 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

New Product: Caverna Building Trays

My web stores have been down for some time while I've been working on other projects but I'm finally bringing out some new products (and old ones back up to speed). I've been working on a lot of game trays for the different board games we play. These Caverna trays hold all the buildings in their appropriate places making it quick and easy to set up the game. Next step is to rejig my older meeple trays to better fit the box.

by (Martin Raynsford) at 07 April 2017 09:52 PM

Spencer Owen hackergotchi for Spencer Owen

Retro Challenge 2017/4 – ICE ICE Maybe

I decided the easiest thing to tackle first would be the three ICE (In-Circuit Emulators) as they’re quite bulky things to get out of the way early.  There are two non-identical versions of the same model Adtek ICE Engine BX and a Zax ICD278 – all with manuals!

Although they all have PAT stickers on to indicate they were tested safe in 2001/2002, before plugging anything in I wanted to check inside for bulging capacitors, leaky batteries or any metal debris that might be floating around inside.  Also, I wanted to know what was actually in these machines!

Inside the ICE Engine Bx is quite full.  This unit is not only an ICE but also an EPROM programmer and a UV EPROM eraser too!  The bulk of it is made up of 3 boards with off the shelf logic, all connected to a backplane.  One of them had a 3 slot backplane the other had a 4 slot one, with one empty slot

Everything looked in order on both machines.  Even the rechargable battery on one of the boards was fine and showed no signs of leakage and all the caps were visually ok.

According to the manual, these could be connected to a CP/M machine running their software (which I did not have) or used with a dumb terminal.  The terminal options looked like the easy option, so I figured I’d give it a go with PuTTY running my Linux desktop

Sadly, no combination of serial cables, baud rates, ports, with or without the probe* gave any joy.  The units both powered up and the lights came on, but I just couldn’t get anything coming out of the serial port.

* The probe needs two 60 pin ribbon cables – which I don’t have.  The unit should work without (and should report ‘No probe connected’ if used for debugging.)  If I used 40 way cables, though, the lights came on – but still nothing on the serial port.

I wondered if all of the cables and adapters I had were faulty, but figured that plugging in the Zax ICD278 couldn’t make things any worse


But it turns out that this sprang in to life with some console messages straight away!  I hadn’t opened this one up to check the caps or battery, and I hadn’t looked through the manual at all, but it seemed to work and typing random commands seemed to do things.  Typing a R for example showed the current state of all Z80 registers.  So, it was worth reading the manual and trying things out

One of the first things I learned is that the manual isn’t for a Zax ICD278, but for a Zax ERX 64180 (well, ok, I could have just read what was written on the cover!).  Some of the instructions worked though, so, for example, DI 100,120 would show a disassembly of the code from 0x0100 to 0x0120.  However, a lot of things didn’t work, so I needed to find out what I needed to do.

Luckily, some kind soul had already scanned the manual and uploaded it to :-)

So, with a little bit of knowledge, it was time to plug this in to a Z80 machine and test it out.  By an amazing twist of fate, I happened to have a RC2014 to hand, so I whipped the CPU out and plugged in the long dangly attached to the Zax.

It turns out to work great, and in no time at all I was able to type in Z80 assembly code, list it out, and execute just that bit of code!  This is just a tiny fraction of what this machine is capable of though, and the amount of options for break points, tracing, history and register manipulation is probably beyond what I will ever need or understand, but I can already see a lot of instances where this will save me burning many many many ROMs!

However, I had already violated my initial rule – Don’t plug things in until after you’ve taken them apart.  So, time to hit it with screwdrivers to check the innards are visually ok

Apart from a bit of dust and grime, it all looked pretty good inside.  It’s nowhere nearly as complex as the ICE Engine BXs are, but there’s still a lot packed inside.  However, I’m happy that this will be a regular tool in my arsenal against Z80 programming.

As for the ICE Engine BXs – I honestly believe that they both work, but I either don’t have the right cables, or just don’t know what I am doing.  (Probably both actually).  It might even be as easy as leaving them plugged in long enough to recharge the internal battery.  I don’t know.  Yet.  I will revisit them again in the future, but for RC2017/4, I have ticked them off of the list for now.

by Spencer at 07 April 2017 05:29 PM

04 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

2 Part Parametric Flex Boxes

I made a number of OpenSCAD scripts for parametrically generating boxes using the living hinges. The scripts are capable of modelling the boxes as flat pieces or assembled items and then able to export them as 2 dimensional drawings suitable for laser cutting. You can find the scripts here on github 

These boxes were designed as sample models to coincide with the launch of our new vanillabox lasercutter, which hopefully explains why this blog has been a little empty over the last month.

by (Martin Raynsford) at 04 April 2017 08:20 PM

Spencer Owen hackergotchi for Spencer Owen

Retro Challenge 2017/4 – Getting The Excuses In Early

So, once again Retro Challenge is upon us, and, yes, the timing is offset , but an April challenge should mean that more people are able to participate.

To try and stay ahead of the curve this time, I thought I’d get in early and give my excuses for why I failed to complete the challenge this time around.  I know most people leave this part until the very end, so hopefully I can impress the judges with my efficiency!

The very first weekend in April was the UK Maker Faire in Newcastle (which was awesome, thank you for asking), so that took 3 days out of April for me. Then at Easter the Edinburgh Mini Maker Faire will also be robbing me of 3 days.  And, finally, Vintage Computer Festival Europe is on from 29th April to 1st May.  So, with travel and prep for these events, I feel like I’ll be left with about 4.5 days in which to complete the challenge.  Lets see how that works out…

So, before I get in to the Retro Challenge I’ve set myself, here’s a bit of history to bring you all up to date.  A few weeks ago I got an email from Tom de Havas saying that there was a bunch of Z80 based stuff going spare at a company that no longer needs it, and would I be interested?  There really is only one answer to that, which resulted in a 350 mile road trip and a van full of old kit.  Then came the more difficult question that I asked myself; what the hell is all of this stuff and what am I going to do with it?  With the realization that Retro Challenge was approaching I knew that I had a challenge on my hands!

The primary goal I’ve set myself is to identify and catalog just what I’ve got here.  Some of it is vaguely obvious, but I’d like to get in to details about exactly what it is/was/does.  A lot of it is new old stock, so it probably will work, but I’d like to know for sure.  Other items are certainly used, but, again, I’d like to know if it still works.  To test things, I’m really going to have to know what they are, right down to the pin out of some of the connectors, so that will all need documenting too.  And then there’s the documentation, which 5 minutes on Google makes me think these manuals aren’t online anywhere, so there’s a scanning/archiving challenge here too.

Yesterday I took a very rough inventory, which is the first step towards knowing what I’ll be doing for the rest of the month.  Here’s some photos and my first guesses about what I’ve got;

There are 3 Z80 In Circuit Emulators.  Two from Adtek and one from Zax, all with manuals.  It looks like they will either run from a CP/M machine (although no software is included) or from a dumb terminal.

There is a whole load of Euro Cards.  Some of these are Z80 single board computers, some are communication cards and some are I/O cards.  I believe they are propriety, but hopefully they’ll have standard bus pinouts so I stand a chance of working out what they do.

Along with the cards is a lot of backplanes.  Mainly passive 2, 10 or 12 slot boards, but also some active (?) 2 slot boards and a coupld of rack power supplies.

This is a CP/M machine, with a few cards and a couple of 5 1/4″ drives with discs (one is labelled CP/M).  It looks pretty complete, although very dirty. Certainly needs a thorough inspection before powering it up.  25 pin D socket labelled video might prove challenging to get anything out of it.

Large rack with 3 backplanes and a lot of power supply stuff at the back.  The backplanes look prototype-ish, but it might be a good case to use the new backplanes as shown above.

4 parallel keyboards.  Very very dusty. A couple with hex input number pads.  At least one of these should work with the CP/M machine shown above.

Lots of power supplies and power regulators, including a PSU kit from Farnell.  All new.

More power supplies and enclosures.  Also new.  Looks really high quality (expensive)

Parallel port EPROM programmer.

PIC development board and a couple of newish looking communication boards?  One has Tx on the EPROM, the other has RX.

A couple of new 240 x 64 LCD displays


by Spencer at 04 April 2017 01:39 PM

01 April 2017

Martin Raynsford hackergotchi for Martin Raynsford

vanillabox laser cutter now available

The vanillabox laser cutter is finally ready and we've opened up for ordering, 
It's a project we've been working on for a very long time and it's consumed pretty much all of the last month but we're proud to have a full metal vanillabox laser cutter and we're currently demonstrating it at the UK Maker Faire this weekend.

If you would like more information then head over to the website and check it out.

by (Martin Raynsford) at 01 April 2017 08:11 AM

28 March 2017

Iain Sharp

JavaScript Objects – some key examples

Some of the JavaScript handling of objects is pretty wacky IMHO. Here is some code that illustrates some key points:

  • Global, private and instance variables
  • Privileged and private functions
  • How “this” is assigned and how to work around that

See also:

Some may point out that my application of OOP terminology to JavaScript isn’t correct. Strictly, what I am showing here are properties of the way JavaScript implements closures, but for people coming from an OOP perspective it’s helpful to be able to understand how to achieve some common OOish goals.

// This is a constructor Test
function Test() { 
  // Assign the private instance variable "self" to the value of this in the constructor. 
  // More later on why we want to do this
    var self=this; 
  // Assign a global variable g (probably not what you want to do in a real object!)
  // Assign a private instance variable p
  var p = "private";
  // Assign an instance variable i
  self.i = "instance";

  // Create a private function pp (can't be accessed form outside the object)
    function pp () { console.log("pp"); }
  // Another way of assigning a private function
  var ppp = function () { console.log("ppp"); }
  // Create a 'privileged' function (public function that can access private info)
  this.p = function() {
i="global i"; // assign i as a global 
o1 = new Test();

// o1.pp(); - would be an error - pp is private "o1.pp is not a function"
// o1.ppp(); - would be an error - ppp is private.
o1.p(); // Outputs 'pp', 'ppp', 'p=private', 'this.i=instance' and 'self.i=instance'

console.log("Now with a call-back");
setTimeout(o1.p, 1000); // outputs 'pp', 'ppp', 'p=private', 'this.i=global i' and 'self.i=instance'

// What's going on - 
// In the callback case the "this" is set to the current context which in this case is 
// the global document - hence getting the global "i" instead of the instance variable "i". 
// To get the instance variable i we want the value of "this" which was used during the 
// constructor which is stored in "self".


by Iain at 28 March 2017 02:16 PM

01 March 2017

Martin Raynsford hackergotchi for Martin Raynsford

Wireframe Dinosaur Lamp

I've seen a couple of wireframe lamp designs recently, they all cleverly fit into an illuminated base so you can easily change the artwork over. This was just a simple case of finding a wireframe render of a dinosaur and engraving it onto perspex. With a bit more effort I could have rendered my own wireframe from any 3D model giving this style of light lots of possibilities. (svg here)

by (Martin Raynsford) at 01 March 2017 10:21 PM

19 February 2017

Martin Raynsford hackergotchi for Martin Raynsford

Tigris and Euphrates counters

The digital version of Tigris and Euphrates keeps track of how much power each token has connected to it. I wanted to make similar counters for the physical version of the game, they needed to be the same size as the existing tokens but able to display the numbers 0-19.I've made gaming counters previously and I didn't really like the deep recess down to the numbers so I went back to the drawing board when designing these. 

The top layer has to be as thin as possible so it's made from 0.8mm birch. The magnet has to be stuck into a layer underneath and the numbers have to be drawn on a ring attached to a third layer to bring it back up to the same height. The tokens were painted in the appropriate colour and then engraved lightly which left the wood slightly stained in the right colours. (svg here)

by (Martin Raynsford) at 19 February 2017 09:22 PM

18 February 2017

Martin Raynsford hackergotchi for Martin Raynsford

Tigris and Euphrates Monument 2

While looking up the original monuments for the Tigris & Euphrates game I discovered the game is due to be released again with slightly different monuments. I made a series of Aztec style monuments for the game instead. The walls for the steps were made using 0.8mm birch and the steps from 6mm poplar (svg here)

by (Martin Raynsford) at 18 February 2017 08:58 PM

16 February 2017

Martin Raynsford hackergotchi for Martin Raynsford

Tigris and Euphrates Game play

With a range of new pieces all that was left to do was play a game. The counter tokens work surprisingly well you just have to remember to modify them each time you lay a new tile but it quickly becomes habbit. The aztec temples go well on top of the existing tiles and quite literally add a new dimension to the board.

by (Martin Raynsford) at 16 February 2017 02:16 PM

15 February 2017

Martin Raynsford hackergotchi for Martin Raynsford

Tigris and Euphrates Monuments

We bought the Tigris and Euphrates board game for a friend but it was missing the monuments, move forward 14 months and I finally got round to laser cutting a replacement set that look like the originals. These were cut from 12mm ply and painted to the right colours, they're functional but I should have done a better job on painting. (svg here)

by (Martin Raynsford) at 15 February 2017 09:12 PM

Lampshade Adaptor Ring

The laser is useful even for silly little things like this lampshade adaptor. It's an ikea lampshade and I've totally failed to buy an adaptor on my last two visits, this time I finally got one and it disappeared in the car on the way home. 2 minutes of drawing and cutting later and I've solved the problem. Should have done this ages ago :)

by (Martin Raynsford) at 15 February 2017 08:30 PM

14 February 2017

Iain Sharp

LushOne Synth – Briefcase Install

Just a short video about the installation of my LushOne synth system in a briefcase to make a really neat, and unique, portable modular.

by Iain at 14 February 2017 03:01 PM

06 February 2017

Steve Barnett hackergotchi for Steve Barnett

New Site With Pelican Static Site Generator

You may noticee that this site now looks completely different.

I decided that I was bored of paying for an AWS instance to host WordPress, and restarting PHP when it crashed, and so on. I also got tired of the massive stall when my tiny AWS instance struggled to create a new post.

I've been thinking about writing my own static site generator for a while, but I didn't want to commit the time to it when there are more interesting projects and it's something that's been done before.

After a bit of research I decided I'd try out Pelican. I'm a fan of Python anyway so I'm right at home editing the config files and I know what I'm doing if I need to make any tweaks. I've played with reStructuredText when writing documentation at work so I know the appropriate syntax for writing content too.

Even better it supports importing from WordPress. I did have to make a few tweaks to remove some markup that didn't convert correctly. Fortunately that was a one off job and it became trivial with the aid of some simple vim macros.

There are probably a few more issues I need to sort out but I'm happy enough with the current state of the site that I've switched it over to the Pelican version.

There's no commenting supported yet. I might bring over the archived comments at some point by appending them to the appropriate posts. If I decide to enable comments again I'll probably try out Disqus unless I find a better alternative.

I'm currently hosting this on GitHub pages. We'll see how that pans out, but I like git and it's free, so seems like a winner so far!

I realise that I've namechecked a bunch of marmite software that will make some developers howl with joy and others with rage. Maybe it's for the best that there is no comment system yet!

by moop at 06 February 2017 08:57 PM

05 February 2017

Martin Raynsford hackergotchi for Martin Raynsford

Hex Terrain Fulfilment

I have alluded to being pretty busy recently but I have now finished and here are the fruits of my labour. I have done the fulfilment for the Hex Terrain Toolkit for the very successful kickstarter campaign. 260 sheets of Poplar plywood cut into toolkits ready for shipping to backers. Changing the wood over every 15 minutes for the last 3 weeks has been long and tedious but there is quite a sense of accomplishment when you complete something like this.

by (Martin Raynsford) at 05 February 2017 05:14 PM

01 February 2017

Martin Raynsford hackergotchi for Martin Raynsford

DIY Heng Lamp

I was quite taken by this Heng Balance lamp I saw on kickstarter so I decided to make myself one. I wrote an instructable about the process and sharing the files. It's pretty straight forward and now it sits happily on my wife's desk.

by (Martin Raynsford) at 01 February 2017 08:39 PM

21 January 2017

Martin Raynsford hackergotchi for Martin Raynsford

Pi Case Take 2

Here is my first shot at a Raspberry Pi case, I took the mechanical drawings from the Pi website and used it to calculate the positions of the mounting holes and overlapping items. The Pi is held into the case with some screws (that aren't really necessary) I put some nice rounded corners onto the top and the whole top cover just clips into place so no screws.

The HDMI holes could be smaller and the power connector hole could be smaller too. It doesn't have GPIO slots yet but I'll add those as and when I need them. Now to get playing with RetroPie

by (Martin Raynsford) at 21 January 2017 02:44 PM

20 January 2017

Martin Raynsford hackergotchi for Martin Raynsford

Rasp Pi Case

I'm slowly catching up with the cyber and I now own a Raspberry Pi 3. I knocked up this case and put it into my machine to see what I liked/disliked about it. It's taken from a thingiverse case and it feels like it scaled wrongly but it's functional.

I've been cutting a lot of parts for someone else recently, running the machine for 12 hour days. Eventually I shall have photos of the massive stack of material building up in the garage but for now I keep squeezing these little projects in between other cuts. Now I'm off to make my own case.

by (Martin Raynsford) at 20 January 2017 09:37 PM

16 January 2017

Martin Raynsford hackergotchi for Martin Raynsford

Christmas Light winder

I've got a couple of strings of WS2811 LEDs that I use for Christmas lights. They've been floating around the garage since I took them down at Christmas and they keep getting tangled up so I thought it would be handy to cut a couple of winders that I can wrap them round. There are definite improvements that could be made but I only had one shot in a busy week of laser cutting so they came out pretty well.

by (Martin Raynsford) at 16 January 2017 08:39 PM

01 January 2017

Martin Raynsford hackergotchi for Martin Raynsford

Carcassonne Cults with drawing

I always said I wouldn't do any Carcassonne expansions after the main set took me 200 hours to draw, but I always wanted to try the Cult expansion tiles and I had a few hours free while waiting for the new year. For those that know Carcassonne cloisters have an unfortunate habit of clustering together. The cult acts exactly the same as a cloisters but if you place it next to a cloisters the first person to complete gets all the points and the other person gets nothing.

It was just a manual trace and draw operation which I did with all the other tiles but I thought it might be interesting to screen cap the process so here is the video of me drawing the tile in inkscape and you can see exactly what goes into it. It's 90 minutes of drawing compressed down into 5 minutes of video. If this is interesting for anyone then please let me know and I'll happily do some more drawing videos like it.

by (Martin Raynsford) at 01 January 2017 07:32 PM

30 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Seed Packet with Print Alignment

The kids grew some pretty epic sunflowers over the summer and we harvested the seeds to grow some more next year (third year running actually). We decided to share the seeds with people for Christmas and I laser cut a load of packets to go with them. The details were printed onto the paper with a standard laser printer, as you can see from the close ups the cut lines were incredibly close to the printed lines. The trick is to let the laser cut a hole to show you where to put the sheets of paper.

by (Martin Raynsford) at 30 December 2016 10:08 PM

25 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Cephalopod Dice Game

I ran across this game called Cephalopod on the Mark Steere Games website. It's a fun two player game that doesn't take too long to learn. I built the play area with indents to hold the dice in location and I build a tray underneath large enough to hold all 48 die, I put a little spacer into the tray to fill the void where the 49 die would be and to stop them rattling around. (svg here)(rules here)

by (Martin Raynsford) at 25 December 2016 10:35 PM

23 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Merry Xmas Everybody - Slate

Slate is one of the materials that I knew could be laser engraved but I just never got round to doing it (I've had some slate coasters for years but we have a functional old table and don't use coasters). So when I was asked to do a house sign I jumped at the chance. It's a simple design but it came up lovely. I even marked where the holes should drilled (but decided not to drill it myself). The best thing is that I was sent 2 pieces of slate in case of accident and I got it right first time so now I have my own piece to play with (or leave on the shelf for years with the coasters).

by (Martin Raynsford) at 23 December 2016 10:01 PM

21 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Christmas Baubles

I wanted to up my game and make some really fancy tree decorations this year. Laser cutting is very popular this year but a lot of the designs you can buy are just cut straight onto laser ply. I opted for real woods this year, 3mm thick, Spruce, Bass and Mahogany. I test these in ply and then cut them in wood and realised that the best way to make them stand out would be multiple woods in each design. With 3 base colours I could also mix and match a few designs.  (svg here)

As you'll have noticed the blog is a bit slower than it used to be while I work upon the vanillabox but there will be good things coming in the new year, so until then merry Christmas and a happy new year. 

by (Martin Raynsford) at 21 December 2016 09:20 PM

19 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Rotational Symmetry Line Drawings

I recently saw someone using the Amaziograph app for the iPad, it allows you to create drawings with rotational symmetry and people were making really fancy doily shapes by swiping their finger across the screen. I knew it would lend itself well to line art but as I investigated these apps I discovered they were all raster based and wouldn't easily give vector artwork that could be cut so I had to find another way. 
It's fairly straight forward to replicate in Inkscape. Inkscape allows you to clone an object and the clones all update when the original changes. I drew a simple line and then cloned it dozens of times, arranging them all with rotational symmetry. As I modified the base line, all the other lines updated and these interesting patterns grew in complexity. The drawing was already vectored so it was easy to get it across to the laser. The whole pattern was cut in a single laser line so I filmed the process too. (svg here)

by (Martin Raynsford) at 19 December 2016 10:15 PM

11 December 2016

Matt Little hackergotchi for Matt Little

Solar Torch Workshop with EWB Nottingham

IMG 20161026 152624

Here are some photos from a DIY 'Build a Solar Torch' workshop I ran for Engineers Without Borders Nottingham.

There were twenty participants and they all built a small torch which runs from solar power, hopefully learning skills including soldering and mechanical design.


by (Matthew Little) at 11 December 2016 04:52 PM

Off-Grid workshop with EWB Sheffield

IMG 20161207 141922 sm

I have run a number of solar photovoltaic and off-grid power hands-on workshops and I recently ran another solar PV workshop with EWB Sheffield.

Engineers Without Borders UK (EWB-UK) is a student run organisation trying to connect engineers with the field of international development. They do this through placements, training and outreach programs.




by (Matthew Little) at 11 December 2016 03:14 PM

Martin Raynsford hackergotchi for Martin Raynsford

Cross Box Puzzle

About a week ago I made this puzzle box as a prop for a LRP event, I've kept it back just in case someone saw it in advance. It's a great little build and a good puzzle, I won't expand on the details yet because I may be working with the creator to make more puzzle boxes via kickstarter but in the meantime you can get an idea of it from this video (and that's enough breadcrumbs if you really want to know more).

by (Martin Raynsford) at 11 December 2016 02:48 PM

07 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Knuckle Dusters

I end up making some pretty odd things with the laser and these 'Bump & Grind' knuckle dusters rate pretty highly. It's LARP related (obviously) so they're made of foam to be soft enough to wear. They still need latexing and they're probably too small for anyone with sensible sized hands but the joy of the laser is that you can scale things up easily.

by (Martin Raynsford) at 07 December 2016 10:50 PM

04 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Christmas Tree Star

Eli and I spent the week slowly making a death star model. It's largely paper mache and paint but we did laser cut some cardboard baffles to go inside the middle of the sphere. We even wrote an Instructable about it.

by (Martin Raynsford) at 04 December 2016 08:48 PM

01 December 2016

Martin Raynsford hackergotchi for Martin Raynsford

Cobbled Streets

A lot of my friends are into wargaming so I tend to get asked questions about how I would do things. In this instance somebody had engraved a section of cobbles like this for use as a road, it took 25 minutes and he was keen to do it faster (and therefore cheaper). I suggested it would be better as a low power cut with the laser out of focus, this would give you wide lines that would look like an engrave. The equivalent cut took 7.5 minutes, over 3 times faster. 

Defocusing the laser is a straight forward process, I simply put varying thicknesses of material under the height tool and set the laser up as usual. In this instance I achieved a suitable line thickness when the laser was 6mm out of focus.

I built the cobbles into a Z shape which can tessellate easily but also makes it harder to spot where the overlap pattern is, especially if you mirror and rotate the pattern as you go along. If you'd like to use this cobble pattern in your own designs, please feel free (svg here)

by (Martin Raynsford) at 01 December 2016 11:38 PM

29 November 2016

Martin Raynsford hackergotchi for Martin Raynsford

Denim Sample

Dominic and I just attended the first Kitronik Teacher Evening to help demonstrate laser cutting and laser cut stuff. I was looking for some cheap materials I could have for a sampler and I remember seeing that you can laser etch onto denim. A sacrificial pair of jeans and 10 minutes later I had etched this pattern onto the surface of the material. It's quite impressive how much colour contrast you end up getting.

by (Martin Raynsford) at 29 November 2016 09:55 PM

25 November 2016

Martin Raynsford hackergotchi for Martin Raynsford

Sliced Skull

There are a couple of laser sliced cardboard skulls online but none that seem to be sharing the files so I decided to make my own for the Kitronik teacher evening. I found a 3D model of a skull in the Autodesk library and used 123D make to slice it in the desired direction. The result was slightly lopsided because the software slices from left to right rather than the middle outwards so I took the first 14 layers and mirrored them to make sure my skull was truly symmetrical. The whole thing was cut from corrugated cardboard 5mm thick (svg here)

by (Martin Raynsford) at 25 November 2016 02:43 PM

Tim Marston hackergotchi for Tim Marston

Spaces within parenthesis in emacs

There’s lots of opinion about coding styles and which is best. I prefer one that helps you read the code. And, to that end, I prefer to have spaces inside parenthesis, like this:

for( int a = 0; a < 20; a++ ) {
    dump( data[ a ] );

Call me a heathen if you like, but it’s how I roll!

And it’s how I set out to configure emails to help me roll…

Unfortunately, emacs’s electric-pair-mode doesn’t do this sort of thing and can’t be configured to, either. There are two problems. The first is that electric-pair-mode doesn’t allow for conditions as to when it will insert a pair. So, I could add a pair of spaces, (?\s . ?\s), to electric-pair-pairs so that it would automatically insert a second space, but it would do this for every space I typed. The second problem is that electric-pair-mode does some white-space skipping internally, which I think would be problematic. :(

So I did it the old-fashioned way and added my own functions:

(defun my/c-mode-insert-space (arg)
  (interactive "*P")
  (let ((prev (char-before))
        (next (char-after)))
    (self-insert-command (prefix-numeric-value arg))
    (if (and prev next
             (string-match-p "[[({]" (string prev))
             (string-match-p "[])}]" (string next)))
        (save-excursion (self-insert-command 1)))))

(defun my/c-mode-delete-space (arg &amp;optional killp)
  (interactive "*p\nP")
  (let ((prev (char-before))
        (next (char-after))
        (pprev (char-before (- (point) 1))))
    (if (and prev next pprev
             (char-equal prev ?\s) (char-equal next ?\s)
             (string-match "[[({]" (string pprev)))
        (delete-char 1))
    (backward-delete-char-untabify arg killp)))

They can be bound in c-mode and c-mode derivatives like this:

(add-hook 'c-mode-common-hook
          (lambda ()
            (local-set-key " " 'my/c-mode-insert-space)
            (local-set-key "\177" 'my/c-mode-delete-space)))

by edam at 25 November 2016 11:33 AM

06 November 2016

Martin Raynsford hackergotchi for Martin Raynsford

Halloween Costume

Halloween feels like a long time ago, but I did make Eli a costume for the night. I copied the rocket man costume that's been floating round the internet. The rocket pack was made from 2 coke bottles and the turbines on the top were laser cut and painted. The fabric for the flames was all laser cut into flame shapes and then sewn onto a spare pair of trousers.

For further house decoration I laser cut some eyes into cardboard and rolled them into tube shapes. A glow stick inserted into the middle of the roll illuminated the eyes and I placed them in the hedge row. Finally I programmed a string of neopixels to give a few flashing effects and that really brought the clown face to life.

by (Martin Raynsford) at 06 November 2016 07:38 PM

02 November 2016

Steve Barnett hackergotchi for Steve Barnett

RetroChallenge 2016/10 - One bodge to fix them all

It's two days past the deadline, but I found an extra moment to work on my SD card interface today and I have it working!

I switched the clock output to the SD card from SH_CLK to /SH_CLK to move the rising edge of the clock to a point where the output from the shift register is stable, and now it works nicely.

It's always a one character fix!

This eliminated the critical timing that the Bus Pirate was have gotten away with but my circuit did not.


0x95 and a response

SPI Decoder

Once I had this working I checked that the 74HCT595 was clocking the data coming back from the SD correctly. Since my test program soft resets the rc2014 when it finishes I was able to check this from BASIC.

Reading back the response

Now that this is working I need to write a (less messy) program to fully initialise the SD card and switch to fast mode. Once that is done I will verify the schematic by rebuilding the circuit on stripboard from the schematic, before designing a proper PCB for the circuit including a proper SD card socket.

There are also a couple of potential minor hardware improvements to investigate:

  • As noted in my last post that it's likely that I can get rid of the second 74HCT374 and switch to just using the simple edge trigger circuit.
  • Fast mode should be pretty optimal when used with the Z80 OTIR instruction to write many bytes of data from memory straight to an IO port, however for reading data from the card I currently need to alternate writing 0xff and then read the result back with with an IN instruction. I can use the INI instruction to automatically keep track of where the read bytes should go in memory but I can't use the INIR instruction which would be faster. Some extra logic to (optionally) trigger a write after a read would allow me to use INIR to read blocks of data with the implicit write priming the input shift register with the next byte after each read.

Finally, here's the final schematic:

Final Schematic

Even though I didn't quite get it done within the deadline I can call this RetroChallenge a success (it was definitely good motivation).

For bonus points I managed to use exactly all the gates in the 7400 quad NAND and 7404 hex inverter that make up my glue logic.

Now it's probably time to start reading the CP/M BIOS Alteration Guide!

by moop at 02 November 2016 09:35 PM

01 November 2016

Steve Barnett hackergotchi for Steve Barnett

Retrochallenge 2016/10 - Tools

During Retro Challenge I needed a way to run machine code on my rc2014, as BASIC was incapable of the performance needed to initialise the SD card in bitbang mode.

I didn't (and still don't) have an EEPROM burner when I first got my rc2014, and although the version of BASIC in the stock rc2014 ROM does support the USR() function it appears to jump to a hardcoded address within the ROM so this didn't help me much.

I ended up finding the assembly language source of the BASIC interpreter (or one very similar) and noticed that the address the USR() function jumps to is not looked up directly from the ROM, but copied to a block of information kept in RAM. Once I knew the address of that block I was able to modify it so USR(0) would jump to an arbitrary address.

With this method I was able to poke in arbitrary code and execute it, but this was far from an ideal workflow.

To improve this I wrote some Python scripts which would output the BASIC code to load a binary image into the RC2014's memory at a given address or run code from a given address. Once appropriate delays were added to avoid overflowing the (1 byte) input buffer on the RC2014's serial port I was able to combine these scripts with z80asm and a makefile to make a nice toolchain for rapidly deploying and testing programs to the RC2014.

By writing the program such that the RC2014 jumps back to the reset vector at address 0x0000 programs can be developed without the need to constantly reset the RC2014 (unless something goes wrong in the program).

I set up my Makefile with additional commands to output hex dumps of the program, annotated assembly, or to run a program that is already resident in memory.

The only issue I've encountered with this system so far is that it is quite slow to load large programs. For my Retro Challenge project the load time was so long that I had to wait for it to finish before reissuing the run command. The automatically sent run program was lost because the loader was still running.

This could be improved by writing a faster loader in assembly which could be bootstrapped with a very small BASIC program. If I had an EEPROM burner a replacement boot ROM could be made which would boot straight into the fast version of the monitor program.

The scripts and Makefile I used are on my GitHub under the RC2014 Tools project. They will work on a Linux system or similar, or on Windows with some modifications.

by moop at 01 November 2016 08:00 PM

31 October 2016

Steve Barnett hackergotchi for Steve Barnett

Retrochallenge 2016/10 - Deadline

I'm at my deadline for RetroChallenge 2016/10 and unfortunately I'm tantalisingly close to having something that works, but not quite there.

I have the bitbang/slow mode working and generating pulses that match the output I get from my Bus Pirate when using it to talk to the SD card. However, the Bus Pirate gets a response and my circuit does not.

I blamed my level shifter for a while. As an experiment I tried writing to the card from the Bus Pirate and reading the response through the level shifter works fine, so that can't be the problem.

Final State Of Play

Bitbang mode was fixed by adding an additional edge trigger circuit. Instead of a synchronous edge trigger I used the simple trick of feeding a signal and an inverted copy of the signal into an AND gate. When the signal goes high the inverted version remains high for the propogation delay of the NOT gate used to invert it, so the output from the AND gate is temporarily high. Since I had a free NAND gate and second free NOT I used these to build an AND. I ended up picking the existing EDGE signal (ie. the synchronous edge trigger) as the input to the new edge trigger. This provided a signal that could be used to make the output flip flop's latch transparent for only a brief period.

I could probably at this point do away with the synchronous edge trigger and save a mostly unused 74HCT374, but there was no time to test this today. I will test this when I get chance.

With the bitbang mode working I was able to attempt to initialise the SD card at the low clock rate it requires. After some fiddling I discovered that my output pulse train was off by one relative to the clock pulse. In an effort to get things to work I bodged the values I was writing to make the output signal match what I see when using the Bus Pirate. This included adding a new bit to the CONFIG register to drive the serial input on the output shift register. This ensured the Data Out line (MOSI) to the SD card was pulled high, in order to match exactly the Bus Pirate's behaviour.

CMD0 on Bus Pirate

It was difficult to get a screenshot that captured the whole pulse train, but the above shot shows the Bus Pirate sending CMD0 (0x40, 0x00, 0x00, 0x00, 0x00, 0x95) and receiving 0xFF (no response) followed by 0x01 (OK). The shot below shows the commands sent to the Bus Pirate and the response.

Bus Pirate Commands

The next shot shows my circuit sending the same output, but recieving no response.

In both cases a large number of clock pulses were sent with the SD card's chip select deasserted, as is apparently required to initialise the card.

CMD0 From My Circuit

My suspicion is that either my timing is too fast - I'm currently running at 330kHz while the Bus Pirate is running at 33kHz - or the rising edge of my clock is very subtly off with respect to the data.

There are still hardware bugs (the off by one issue, mainly), but the final schematic and final netlist are included below for posterity.

Final Schematic

Final Netlist

I plan to continue working on this project after RetroChallenge and will and post further updates as I figure it out.

I also plan to write a post about the toolchain I have setup for running assembly programs quickly and painlessly on the RC2014. Hopefully I'll be able to post that tomorrow.

by moop at 31 October 2016 11:08 PM

Retrochallenge 2016/10 - State of Play

As it stands my RetroChallenge entry is close to working, but not quite there.

The fast mode appears to work and I was able to decode the SPI packets sent to the SD card with OpenLogicSniffer's SPI analyser module.

Decoded Messages

The picture above shows the signals and the decoded data for the SD card CMD0 (Software Reset) message which is the first step in initialising the card. The message is the 6 byte string 0x40 0x00 0x00 0x00 0x00 0x95 where 0x40 is the command (bit 6 is always set), the four 0x00s are the empty parameter section, and 0x95 is the checksum for this command. More information on the SD card SPI protocol is available on this page, which I've been referring to regularly for this project.

The eagle eyed will notice that this capture shows an 8mHz clock and therefore the device is running in fast mode. For the SD to initialise correctly it needs to be initially clocked slowly (100-400kHz).

Unfortunately, the slow mode, which I was expecting to be the easy bit is currently not working due to a hack I used to get fast mode working.

Current Schematic

The current schematic, seen above, shows that the 'Shift /Load' input of the output data shift register (U3 pin 1) is driven by the SHIFTING net. This gave the correct timings to load the register when data was written, as the register's input latch would be transparent while SHIFTING was low. SHIFTING goes high while the autoshift register (U7) is outputting a 1, so the last value seen by U3 is latched in just before the train of clock pulses is generated.

This breaks slow mode because SHIFTING is always low when /BITBANG is asserted, so the output from U3 is always a copy of whatever is on bit 7 of the data bus.

This should be fixable if I can find a better way to load this register before time runs out.

by moop at 31 October 2016 05:11 PM

30 October 2016

Steve Barnett hackergotchi for Steve Barnett

Retrochallenge 2016/10 - Breadboard Fun

Having finally found time to start breadboarding my SD card interface I first made sure that the edge trigger circuit I had tested in ModelSim would work when built with real components.

An issue I had encountered previously when breadboarding RC2014 peripherals was that if I wanted to disconnect the circuit from the RC2014 I would lose track of which wire was which. To work around this this time I took an unused RC2014 protoboard module and soldered on just the usual 90 pin header and a socket header below it. The protoboard can still be used later (minus one row of holes) and now provides something that wires can be plugged into that can be removed from the RC2014.

RC2014 Protoboard

With the edge trigger circuit built I tested it using my Open Logic Sniffer, which has been an invaluable tool for many projects. I did however notice that running on the RC2014's 8mhz clock brings the Open Logic Sniffer quite close to its limits. The 200mhz maximum sample rate provides resolution for only about 12 steps within each clock cycle, so there is limited scope for playing with gate delays.

Edge Detect

Once the edge detect circuit was proven to work I started building the rest of the circuit and things quickly got complicated.


The image above shows the almost complete circuit, but with a loopback between the input and output shift registers where the SD card would normally fit, and some blinkenlights on the outputs from the input shift register to indicate its state before it was connected to the data bus.

I spent quite a long time debugging why the signal coming into the input shift register was always off by one bit. Initially I blamed timing issues in the glue logic and spent quite a while experimenting with inserting delays to try and fix things. Eventually I realised that I was clocking both the Shift Clock Pulse input of the 74HCT595 and the Store Clock Pulse (which latches values from the shift register to the output shift register) with the same clock signal. This resulted in the output register always showing the last but one state of the shift register. Switching the Store Clock Pulse input to an inverted copy of the clock signal fixed this and I was able to send any byte from the output shift register to the input shift register with the circuit operating in autoshift mode.

Previously when breadboarding I had been building the circuit in KiCAD, planning out the breadboard layout as PCB, then building the circuit based on that design. Any changes made on the breadboard had to be updated in KiCAD or things got very confusing.

Unfortunately this mechanism got onerous once I started making changes on the breadboard. Following traces on the screen is no easier than following them in the real world and long jumper wires were hard to route in KiCAD without using many extra layers.

For the most recent attempt I decided to try a more old school approach and build a netlist representing the breadboard contents on paper. I made and printed some templates in Google Sheets, annotated the existing breadboarded design onto the sheet, then kept it up to date as things changed. This turned out to be a lot more convenient than keeping track of the design in KiCAD as it was easy to search for a signal by name and the paper was easier to reach on my desk.

Paper Netlist

by moop at 30 October 2016 11:13 PM

Retrochallenge 2016/10 - Due diligence

To avoid the work done designing my SD interface being wasted I decided to verify the concept before going any further.

I used my Bus Pirate to verify that the SD card I have would respond to the commands I expected using the protocol I expected.

The Bus Pirate supports many bus protocols including the SPI bus that the SD card supports in the mode I'm using.

I don't have an SD card breakout board so I ended up buying a micro SD card with a standard SD adapter and soldering some right angle pin headers to the pads. This gave me an SD adapter that would plug into a breadboard.

Makeshift SD Adapter

I initially used the Bus Pirate's probe cable as a quick way to connect to this adapter, but this got frustrating as the mini grabbers had a habit of letting go at inconvenient times. To get around this I made a quick adapter on some stripboard.

Bus Pirate SD Adapter

This little adapter also makes it easy to remove the SD adapter from the Bus Pirate without having to look up the pinout again. It should come in handy on future SD card related projects and maybe for writing raw data to the SD card.

Unfortunately I don't have any logs of the session, but with this adapter and the Bus Pirate I was able to initialise the SD card and read blocks of data. This gave me confidence that my project would work and would be worthwhile.

by moop at 30 October 2016 10:45 PM

29 October 2016

Martin Raynsford hackergotchi for Martin Raynsford

Halloween Decoration

It's nearly Halloween and I had an afternoon of building fun with the kids trying to make a new decoration. This scary clown will be mounted over our doorway on Monday night ready to greet the trick or treaters. It took about 2 hours all done, 45 minutes drawing, 15 mins cutting and an hour painting and assembly. The face was drawn and split into several different layers which made it easy to give the kids one part and one colour of paint plus adds to the 3D effect. It's just corrugated card and poster paint which makes it cheap and we'll hope for a dry night. (svg here)

by (Martin Raynsford) at 29 October 2016 07:15 PM

23 October 2016

Steve Barnett hackergotchi for Steve Barnett

Retrochallenge 2016/10 - Building retro computers with modern tools

I've been struggling for free time this month for poking around with breadboards and other fun things. To work around this, and still (hopefully) get my RetroChallenge entry done, I decided to use a simulator so I could work on it with my laptop whenever and wherever there was time.

LogiSim Edge Detector

For an earlier RC2014 project I used LogiSim which is simple and easy to use, but I quickly hit some limitations. The built in sequential building blocks (shift registers, latches, etc) appear to support only a limited set of variants. There is no option for asynchronous resets, or transparent latches on the shift registers. It includes combinatorial building blocks (logic gates, etc) also, but these do not appear to work correctly for building sequential circuits, as feedback is not always handled correctly. Because of this I was not able to simulate the exact characteristics for most of the 74 series ICs I was using.

To solve this problem I switched to using Altera Quartus to build a model of the circuit and ModelSim Altera Edition to simulate it. I mainly chose this because I've used it previously for FPGA projects, and because if some functionality is missing I can implement it in Verilog.

Autoshift Circuit

When redesigning the autoshifter circuit (to shift out 8 bits of data after each IO write) I built it as a Block Diagram/Schematic File (.bdf) in Quartus. This allows the design to be entered as a schematic with various logic symbols supported by default. Additional components can be created with a hardware definition language such as Verilog, or by using Quartus' "MegaWizard Plug In Manager" to configure and insert a variant of an IP core. I set my project up for the Cyclone II FPGA as I have used it for previous projects. To simulate the 74HCT165 shift register I configured a variant of the LPM_SHIFTREG IP core with 8 bits of data, parallel inputs and serial inputs, serial output, and a clock enable pin.

Unfortunately this still does not quite match the 74HCT165 exactly as it has D flip flops rather than transparent latches. I could build my own shift register in Verilog, but to save time I opted to stick with the LPM_SHIFTREG version and ensure that the timings seen in simulation were such that the transparent latches wouldn't cause a problem.


In order to test the design I set Quartus up to launch ModelSim and run Gate Level Simulation after compilation. ModelSim can be driven manually through the GUI, but this is fairly fiddly and repetitive. Fortunately it supports scripting via 'do files' which contain lists of commands for ModelSim to interpret.

I set up four do files:

  • - Reset, add graphs for appropriate signals, set default values for inputs
  • - Drive the data bus to the appropriate values to set SHIFT8 and deassert /BITBANG, then assert and deassert /CONFIGWR
  • - Simulate a write to the device by driving the data bus and /DATAWR signals, zoom graph to fit
  • - Run the previous three do files in sequence, zoom graph to fit

This allowed a fairly quick turnaround by hitting compile in Quartus, selecting the project once ModelSim launches, then typing 'do' to run the simulation.

For a different project I could have sped things up by keeping everything inside ModelSim, but this would have required me to design the circuit in a hardware definition language. Since my final target is a circuit built from discrete components and not an FPGA bitstream I decided to take advantage of the Block Diagram/Schematic feature in Quartus. This way everything could be easily translated back to a physical circuit once it was verified as working.

Now I have the autoshift circuit working, theoretically, I just need to find some time to build and test the physical version!

by moop at 23 October 2016 07:26 PM

Martin Raynsford hackergotchi for Martin Raynsford

Laser Cut Cryptex

This is my laser cut cryptex. It features 28 different characters and 9 rings, giving a total possible 10.5 Trillion different combinations. I took a bit of time developing the design so that I could add some nice features. This cryptex file is laid out so that you can have any number of rings in your own design. The best feature is that the codeword is changeable, each locking ring has an outer letter ring that can be placed in any one of the 28 different positions. Once the rings are back in place the ring locking bars can added and they prevent the rings from being modified until the box is open again. It's a bit hard to explain so I made a video showing how it all work (svg here)

It took a long time to assemble this so I lived with my initial design choices but if I were to remake it I would adjust the file to make the ring locking bars out of 6mm ply and maybe put some blind holes onto the code rings to prevent the code being brute forced.

by (Martin Raynsford) at 23 October 2016 01:20 PM

15 October 2016

Steve Barnett hackergotchi for Steve Barnett

Retrochallenge 2016/10 - Previous version and problems

In my previous post I promised to show the previous implementation of my Z80 SD interface, and to run through the problems which I intend to fix this month.

Original Z80 SD Interface Schematic

The 74138 (U1) in the top left of the schematic is used to detect and decode IO reads and writes from the Z80. Three bits of the address bus (A7, A1, A0) are decoded along with the /RD line, M1 line and /IORQ line. With this configuration the device responds to any IO address between 0x80 and 0xff. Some more gates will be used to further decode the address later. The lower two bits (ie. the address modulo 4) select a register within the device. Address 0 selects the DATA shift register (U4) for reads or writes while address 1 selects the CONFIG register (U3) for writes only.

One NAND gate from the 7400 (U2A) quad NAND is used to invert the CONFIGWR signal, as the 74138 outputs are active low while the latch input on the 74374 is active high.

In the middle row of the schematic are the 74374 register (U3) that holds configuration information and the 74299 shift register (U4) that is used to transfer data to the SD card. To the right of these is a 74165 (U7) shift register that implements the automatic shifting mechanism for high speed mode along with some more NAND logic (U2B, U2C, U2D) to generate the appropriate signals depending on the operating mode.

The automatic shifting behaviour is implemented by latching the state of the SHIFT8 bit of the config register into all 8 bits of U7's input register when /DATAWR is asserted (ie. the data register is written to). This fills the register with 1s. The serial in (Ds) pin of the register is connected to ground so with each clock pulse the train of 1s is shifted and the gap is filled with a 0. The serial output of the register (SHIFTING) is NANDed with the clock by U2B. The output from U2B is either a train of 8 inverted clock pulses or a constant logic 1 level, depending on the state of SHIFT8 at the time the DATA register was written to. NAND gate U2C will either invert this train of clock pulses if /BITBANG is high, or reflect the inverted state of the /BITBANG config bit if U2A is outputting a constant logic 1 at the time. Put together this allows either the SHIFT8 config bit or the /BITBANG config bit to control the clock depending on the desired operating mode (relying on the driver to avoid trying to do both simultaneously).

The final NAND gate of the 7400 (U2D) is used to invert the /DATAWR signal to drive U4's S1 input to select the Parallel Load operation when /DATAWR is asserted or to Shift Left otherwise. S0 of U4 is tied to ground as the Shift Right and Hold operations are never used.

Finally, a 74107 dual JK flip flop was used to divide the RC2014's clock signal (CLK) by four to produce (Q_CLK). This was initially intended to solve a timing issue, but has caused more trouble than it was worth.

The timing diagram below shows the behaviour of the device when the SHIFT8 bit is set and a write is issued to the DATA address.

Original SD Interface Timings

A couple of issues are noticeable:

  • SH_CLK is producing one partial pulse, followed by a gap, followed by 7 real clock pulses.
  • /DATAWR (and therefore SH_LOAD) is asserted for several clock pulses.
  • CLK (actually Q_CLK) behaves strangely.

Most of these issues were introduced by attempts to work around other problems.

Before the clock divider was introduced U7 was emitting a train of 11 clock pulses rather than the expected 8. This is because the 74165 has a transparent latch rather than an edge triggered latch. The Z80 asserts /IORQ for many clock cycles so the train of 1s from SHIFT8 was being reloaded, wiping out the 0 introduced through the Ds input, until /IORQ was deasserted. Introducing and resetting the clock divider was an attempt to prevent the shift registers from being clocked during this period by holding it in the reset state when /DATAWR is asserted.

Unfortunately because the Z80 instructions take a variable number of clock cycles to complete and aren't necessarily a multiple of 4 cycles the state of the divided clock when /DATAWR is asserted is not predictable. This is likely the cause of the glitchy short pulse seen on CLK as /DATAWR is asserted.

Without this unexpected pulse U4 would not be loaded, as 74299's the Parallel Load operation is synchronous with the clock, and shares a clock with the Shift operation. Extra logic would be required to create a seperate clock that is a superset of the shift clock.

Given these problems I'm going back to the drawing board slightly. I may try adding the extra logic to clock only the 74299 but if that fails I'm replacing the 74299 with a pair of shift registers - a 74165 for data moving from the Z80 to the SD card and a 74595 for data moving from the SD card to the Z80. This is probably wise anyway as the 74299 is a rare part which is many times the cost of a 74165 or 74595 and supplies are less plentiful.

I'll also be removing the 74107 clock divider circuit and replacing it with a simple edge trigger circuit to limit the /DATAWR pulse to a single clock.

Hopefully I will have a write up of this new version soon.

by moop at 15 October 2016 12:51 PM

05 October 2016

Steve Barnett hackergotchi for Steve Barnett

Retrochallenge 2016/10

I decided to join in with ` <>`__Retrochallenge 2016/10 this October. I'm also hoping this will provide some incentive to write more posts and updates about other projects once I'm back into the swing of things!

RC2014 Z80 computer

My goal for this Retrochallenge is to finish an SD card interface I started designing for Spencer Owen's ` <>`__RC2014 Z80 based computer (which was spawned by a previous Retrochallenge, hence the name). This should work with most Z80 computers that don't do anything crazy to the I/O interface, so I may also get it working on a ZX Spectrum if there is time.

I'm intending to build my SD interface from 74 series and similar discrete logic ICs. This is partly for fun and partly because the microcontroller in the SD card is likely already more powerful than the RC2014. Adding another microcontroller into the mix to interface with the one in the SD card is just a step too far.

I'll be using the SPI-like mode of the SD card protocol, not least because information on the faster SD mode is not publicly available. The SPI-like interface should allow me to use shift registers for communication with the SD card.

I was initially planning to use a 74ALS299 universal shift register to reduce chip count. Unfortunately, in addition to being somewhat hard to get, the interface on this chip is troublesome as the shift, shift direction, and output enable are all synchronous and controlled via two pins that set the operation. The extra glue logic needed to deal with this completely nullifies the benefit of using a single universal shift register. Because of this I'm planning to redesign around a pair of shift registers: a 75HCT595 serial-in-parallel-out register and a 75HTC165 parallel-in-serial-out register.

The SD card requires a slow clock pulse for initialisation (around 100khz), but once initialised supports faster clock speeds. The design is complicated by the need to run at both speeds, but I have a scheme to cope with this.

My intended interface uses a pair of registers mapped to the Z80's I/O space.

  • DATA

    • Writes to this address latch the byte from the Z80 data bus into the 74HTC165 which is used to send data to the SD card.
    • Reads from this address enable the outputs on the 74HTC595 shift register which receives data from the SD card.

    • Writes to this address update a 74HTC374 register holding a configuration byte. The following bits are currently used:

      • autoshift - Automatically shift 8 bits from the shift registers to the SD card and back after a write to the DATA address. This is used for the SD card's "normal" high speed mode and should allow fast enough I/O that the Z80 becomes the bottleneck.
      • clock - OR'd with the automatic clock signal to the shift registers and SD card, allowing communication at a speed controlled directly by the Z80 to provide a 'bitbang' mode. This mode is not efficient, but allows the slower speed required for the SD card initialisation process without much extra logic.

Original version on breadboard

An initial version similar to this design has been built on a breadboard using a 74ALS299. In addition to the issues with the synchronous control signals needed to load this shift register, there were also compatibility issues with the timing of the Z80's I/O control signals. This requires additional glue logic and a redesign of automatic shifting logic that enables the high speed mode to work.

Before I take the previous version apart to rebuild, I'll take some logic analyser captures indicating the timing issues, and write up (and remind myself of) the problems.

by moop at 05 October 2016 07:04 PM