21 July 2014
20 July 2014
The 5 matrix board has now been finished. And no one could be more relieved than me. There’s a LOT of soldering going on in there!
A brief overview of the circuit goes like this; There are 5 separate 8×8 LED matrix modules. All 8 lines on each of the Y axis are chained from one to another, and driven by a 74F374 latch (the chip in top right). Then every matrix has each of their X axis lines driven by their own 74F374 latch (the remaining chips in 1st and 2nd row). Every latch is connected to the 8 bit data bus that’s directly driven by the Z80. The 74LS138 (bottom right) does some address decoding and has a chip select line going to each of the latches. So, when the appropriate address is written to, the ’138 tells whichever one of the 6 ’374s to read the data bus and keep that data as its output. Next to the ’138 is a connector for the 8 data lines, as well as power, some address lines and !IRQ, !RW & M1
Bingo! It worked! And from BASIC I could select the individual rows and columns to light.
If you’ve been keeping up with the blog (then I’m highly flattered, but haven’t you got better stuff to do?), then you’ll remember I wanted to put this on to my own design of PCB but failed to fit it in to an acceptable size. To me, an acceptable size for 7 modules was 140mm x 40mm. The space used on this board, overall, is 125 x 125 for just 5 modules. I know the wires I used was a lot bigger than PCB traces, but the photo below shows just HALF of the wires that are running under the LEDs!
In other news, I’ve got a bit of Z80 assembly love going on with the ClrHome website and Fuse. I’ve got it (sort of) reading memory and writing it to other places, and I can verify that it’s writing stuff! It doesn’t crash the virtual Spectrum either! It’s getting close to the point where I will have to sit down and draw a flow chart or something though as my brain doesn’t yet work at assembler level.
And fingers crossed the PCBs will arrive in the next day or two so I can get the main Z80 machine built up and tested.
19 July 2014
18 July 2014
There has been a spate of pedal power projects in the re-innovation workshop recently.
This post shows one recently built for Nottinghamshire Healthcare. The pedal generator was designed as a challenge with a twenty second test to see the amount of energy the cyclist can generate. It also needed to be relatively potable (to fit within the boot of a car).
The systems consist of:
- a shunt regulator (rated at 400W) to dump any excess power
- a LED bar graph display as a visual read out of power generated
- an LED display which shows the actual power output in Watts
- a 20 second test display with an output in Watt-seconds
Its very difficult to explain the concepts of power and energy. People often ask me "Can I power my kettle with that?".
So to try and put the energy in a cup of tea into perspective I built the 'Cuppa-meter'.
The 'Cuppa-meter' shows a cup of tea which lights up as the energy required for a cup of tea is generated. This can be plugged into a pedal generator and people can 'feel' the energy required to make a cup of tea.
They can either pedal slowly (and hence low power) for a long time, or they can pedal hard (high power) for a shorter time. The end result (the energy) is the same - a nice hot cup of tea (or rather a lit up image of one).
This post gives a few images of the cup of tea and also the calculations used.
The mounting of the LED matrix has probably caused me the biggest turmoil so far on the Retro Challenge. First, I was going to design a custom PCB for them, but I missed the window of opportunity to get it manufactured at a reasonable price. So, for simplicity, I decided to use breadboard until I realised this wasn’t simple with that amount of wires. So, I went back to PCB design preparing to take the financial hit. However, it proved impossible to get the tracks to fit, so this idea went in the bin again. Back to breadboard, I bought a load of jumper cables, and started expanding on what I started earlier. For the driver chips it was ok. For the matrices themselves though, I came across a show stopper; The width of it is so wide that in the breadboard there are 2 free tie points on one side but just 1 on the other. Getting a data bus down all of them was not going to be possible :-(
So, I had a rummage through some vintage Veroboard and found a Euro-card sized board with chip layout tracks. It would only fit 5 modules side by side, but I was prepared to make that sacrifice. I also had some 40 pin female sockets, so that made life even easier!
All the Y axis data bus cables went in fine. I was running out of solder though, but had just enough left for the chip sockets
I didn’t have the appropriately sized 20 pin sockets, but I did have plenty of 14 pins ones… so I’ll just have to be careful in marking where one chip ends and the next one starts.
There’s still a lot more wires (25 actually) to connect under the LEDs, but the headers are quite tall so there should be enough room to hide them away.
Hopefully I’ll be able to complete this at the weekend, in time for the other PCBs to arrive.
17 July 2014
16 July 2014
just a quick update about my Z80 development environment.
If you look down a couple of blogs, you’ll see that I found an online Z80 emulator and I’d written a couple of bits that executed in it, so I was going to do my Z80 learning and development on that. However, there were two issues. The first being that it didn’t run on Chrome on my Linux PC at home (but did on Chrome on Windows at work). The second issue is that it isn’t a Z80 emulator, it’s a 8080 emulator. I didn’t think this would be a problem as they pretty much run the same instruction set, although the 8080 has a sub-set of the Z80 (well, technically, as the 8080 came first, the Z80 has an expanded instruction set), and I quite quickly came across an instruction that wasn’t supported. Bugger! That’s messed up that plan.
Then I remembered I have Fuse which is a ZX Spectrum emulator running on my Linux PC. There are oodles of menus and options which I’ve never looked at, but thought it worth a poke (no pun intended) about with.
Sure enough, there’s a debugger that shows all the registers and instructions being executed and stuff, and also a memory browser.
The native Spectrum file format is .tap, which is an output option for the online compiler at clrhome
So far I’ve not managed to successfully execute a program, but by changing my code I can get the virtual Spectrum to freeze up or reset itself, so I know it’s having an effect! Also, with the memory browser I can actually see where my code is being loaded in to; 0x5CD3 – which seems like an odd location to me
It still needs some playing around with before I know what I’m doing, but at least now I feel like I have got a plan!
We’re at the halfway mark of the Retro Challenge, and there’s a slight lull in activity, so this seems like a good chance to catch up on what’s been done so far, and what’s still to come.
Firstly, a quick review of the challenge I set myself; write my name in LED lights. These must, however, be controlled by a Z80 computer, which I’ve got to design and build myself, and written in assembly language which I need to learn.
Well, the start of the challenge saw me dive headlong in to KiCad, learning some of the intricacies of printed circuit board layout. I’d used KiCad for a couple of little projects before, but certainly wouldn’t have described myself as competent. I’m still not a master of it, but I’m a lot more familiar with it than I was.
I split my breadboard based Z80 down in to several modules, each of which will plug in to a Veroboard backplane. 6 of these have been designed and sent off for manufacture which will give me a basic Z80 computer that I can use via a terminal emulator. The boards are;
- Eprom (for BASIC eprom)
- Eprom (for my Z80 code)
- Serial I/O
I put a lot of energy in to getting these done early on as they take about 2-3 weeks to get manufactured. I did actually get notification today that they’ve been made, and are currently being shipped from the United States. Hopefully they’ll be here early next week.
I left the ‘LED’ part of my challenge fairly vague as I didn’t have any particular display in mind when I started this. Maybe 7-segment display? Maybe a bunch of individual lights? Maybe even LCD display with LED backlight? Well, I found a huge amount of mini 8×8 dot matrix LED displays at the local Hackspace. I tracked down the datasheets and got one tested out with the breadboard Z80 and BASIC.
This works fine, so I’ve now worked out a circuit to drive 7 of them. 7 is an ideal number, not just because there’s 7 letters in SPENCER but 7 * 8 X-axis plus 1 * 8 Y-axis maps really well on to the 8-bit Z80 data bus! I missed the window to get this manufactured as a PCB by OSHPark, so decided to build it up on breadboard. This proved too time consuming, so I decided to go for a more expensive UK based PCB company, but this turns out to be really hard to fit on to the size board I want to use, so have abandoned that idea too.
I’ve started teaching myself Z80 assembly language from introduction websites and also reading the book “Programming the Z80″. It turns out that assembly language is really hard! Who’d have thought! I’ve found an on-line compiler which works pretty good, and an online emulator. I can only use the emulator by manually entering the hex code though, as I can’t get it to load programs, so although it’s great for checking very low level stuff, it won’t scale up to larger stuff.
Talking of larger stuff, I’ve been through the Sinclair ZX Spectrum ROM and extracted out the character set from that. This will mean I don’t have to worry about plotting every single dot on the matrix displays myself, and will also mean I can easily write things other than my name!
Wow, that sounds like a lot so far! Well, there’s still plenty more to do.
Firstly, I’ve got to learn a LOT more assembly language. Then come up with a flow chart for a program, and actually write the program. I also have to wire up the LED displays (currently wondering about Veroboard) and their driver chips. Plus, the PCBs should be here soon, so I have a lot of soldering to do. Of course, all of these steps will need to be tested at each stage, which, inevitably will mean fixing stuff, redesigning bits or even having a total rethink.
Then, all I need to do is put everything together and write my name in LEDs. Simples!
This isn’t meant to be one of my full Hackspace visit posts so sorry for the lack of pictures and Continue reading
15 July 2014
I knew there would be some stumbling blocks with this Retro Challenge, but, hey, it wouldn’t be a challenge if everything was just nice and simple. However, I seem to be beset by little stupid technical issues that aren’t necessarily retro in nature.
However, the fact that you’re reading this does at least mean that my blog is working again! I ran some updates last week, and it caused some issues with a plugin meaning I had no way of adding, editing or modifying any posts. I’ve now got that tracked down to the Poll plugin and disabled it. So, yay, I’m back!
So, part of this challenge is to use LEDs, and the little 8×8 matrix modules I found seem ideal. I had initially intended to design a PCB to mount a bunch of these on, but due to time constraints, it was looking very unlikely I’d get them designed, ordered, manufactured and delivered by the end of the month, let alone time for testing. So I decided to go Old Skool, and do this part on a breadboard. Well, 2 breadboards, as they each need a driver chip. Although, it’s actually 3 breadboards, as 2 aren’t quite big enough. Not to mention the other breadboard with the supporting circuitry on. I made a start on this last night;
After an hour or so, the enormity of this began to dawn on me. There’s 7 matrix modules. Each with 8 pins on X and 8 pins on Y axis. All the X pins need to connect between them, and then to a 20 pin latch chip. All the Y axis pins go to a latch chip themselves. All the latches have a 8 bit data bus that connected them all together. Plus the controller. And power rails. That’s over 450 wires I’ve got to trim and push in!
At which point I decided to abandon that idea, and go back to a PCB plan. It would mean using a UK company in order to get it manufactured in time, and that would cost a small fortune for a one-off. But I gave it a go. 4 hours later I realised that trying to minimise the amount of space the board took up by mounting the display and driver chips on opposite sides made the routing impossible. I tried a couple more ideas, and then gave up on the PCB plan. I have, however, ordered a load more jumper wires from eBay this morning!
When I first started to investigate Z80 CPUs a few months ago, this book was widely held as the difinitive guide. It is out of print, but there are scanned PDF versions out there if you know where to look. For better or worse, they are not OCRd PDFs, and despite nearly finishing reading this, I’ve never really got on so well with books on a tablet, so I managed to pick this up cheap from eBay. For a reference book to skip backwards and forwards, or flick through looking for something I think it’s better than the electronic equivalent.
How is the Z80 assembler side of the project going I hear you ask? Well, yeah, it’s coming along. Slowly. With such a limited amount of commands even the simplest of things really has to be broken down to a very basic level. What do you mean I can’t just multiply by 7? Well, I had some little test-lets that I was going to try out last night before I ended up breadboarding, however, due to some other glitch, the Z80 Emulator website does not run on my Linux machine at home. This could be quite inconvenient. But I’m sure I’ll find a way around it sooner or later. Isn’t that part of what a challenge is?
12 July 2014
11 July 2014
Ever since I saw this project (http://digitalfantastico.blogspot.co.uk/2013/01/a-big-bite-of-raspberry-pi-having.html) by Gareth James at Brighton Hackspace, I’ve wanted to make my own display like it. It’s a display that shows when the next trains are from his local station to get into Brighton. … Continue reading
10 July 2014
So, after a flurry of activity, blog posts and updates at the start of the month, things have got a bit quiet.
That’s not to say I haven’t been doing anything. I have. Lots. But nothing really specific or bloggable.
Until the batch of PCBs arrive, I am kind of in limbo land. However, I’ve been looking in to the LED matrix boards a bit more, and working out how I’m going to connect them up (short answer – use breadboards to complete the challenge, but get PCBs made up for long term mounting.).
As the breadboard Z80 runs Microsoft Basic, I have been using that to test out a few bits in terms of orientation of the matrices and the best way to drive them.
I have also run my first ever Z80 assembly language program!
I used http://clrhome.org/asm/ to compile it in to
which I then programmed in to and run on http://www.tramm.li/i8080/emu8080.html
Basically, it loads register A with 23, loads register B with 100, loads C with 35. It then adds 23 and 100 and takes away 35. The result (70) is left in register A
Sure, it may not be the most sophisticated program out there, but it demonstrates to me that the tools work!
I’ve got hold of a copy of How To Program The Z80 by Rodnay Zaks, which is supposed to be one of the best books of its time. So I’ll be reading as much of that as I can before the PCBs arrive and soldering starts.
09 July 2014
There are blogs of other makers that I really enjoy reading. Chris Holden of Nerdclub (http://nerdclub-uk.blogspot.co.uk/) is well worth reading while he endeavours to make futuristic interactive style board games using war gaming models. I can't wait to see a working prototype in person.
Anyway, this evening he was working on some roof shingles for a building that he was going to laser cut. His usual laser cutter is currently out of order so I stepped in and surprised him by doing the cuts for him tonight in several different materials. My favourite is the bottom row using 0.8mm spruce veneer and bit more delicate but the thickness is more appropriate for the scale.
08 July 2014
So, if I’m going to write my name on a bunch of 8×8 LED matrix displays, I have a couple of options; Write my name on grid paper, colour in the squares, convert it to binary and transpose it to hexadecimal. Or… I could use a font that’s already out there. Like the one that Sinclair used in the ZX Spectrum.
I’ve already got a copy of the Spectrum ROM, and, handily enough, all the characters are right at the very last part of the ROM address space (from 0x3D00 to 03FF), in consecutive blocks of 8 bytes.
I can see this coming in handy later!
00 00 00 00 00 00 00 00 00 10 10 10 10 00 10 00 00 24 24 00 00 00 00 00 00 24 7E 24 24 7E 24 00 00 08 3E 28 3E 0A 3E 08 00 62 64 08 10 26 46 00 00 10 28 10 2A 44 3A 00 00 08 10 00 00 00 00 00 00 04 08 08 08 08 04 00 00 20 10 10 10 10 20 00 00 00 14 08 3E 08 14 00 00 00 08 08 3E 08 08 00 00 00 00 00 00 08 08 10 00 00 00 00 3E 00 00 00 00 00 00 00 00 18 18 00 00 00 02 04 08 10 20 00 00 3C 46 4A 52 62 3C 00 00 18 28 08 08 08 3E 00 00 3C 42 02 3C 40 7E 00 00 3C 42 0C 02 42 3C 00 00 08 18 28 48 7E 08 00 00 7E 40 7C 02 42 3C 00 00 3C 40 7C 42 42 3C 00 00 7E 02 04 08 10 10 00 00 3C 42 3C 42 42 3C 00 00 3C 42 42 3E 02 3C 00 00 00 00 10 00 00 10 00 00 00 10 00 00 10 10 20 00 00 04 08 10 08 04 00 00 00 00 3E 00 3E 00 00 00 00 10 08 04 08 10 00 00 3C 42 04 08 00 08 00 00 3C 4A 56 5E 40 3C 00 00 3C 42 42 7E 42 42 00 00 7C 42 7C 42 42 7C 00 00 3C 42 40 40 42 3C 00 00 78 44 42 42 44 78 00 00 7E 40 7C 40 40 7E 00 00 7E 40 7C 40 40 40 00 00 3C 42 40 4E 42 3C 00 00 42 42 7E 42 42 42 00 00 3E 08 08 08 08 3E 00 00 02 02 02 42 42 3C 00 00 44 48 70 48 44 42 00 00 40 40 40 40 40 7E 00 00 42 66 5A 42 42 42 00 00 42 62 52 4A 46 42 00 00 3C 42 42 42 42 3C 00 00 7C 42 42 7C 40 40 00 00 3C 42 42 52 4A 3C 00 00 7C 42 42 7C 44 42 00 00 3C 40 3C 02 42 3C 00 00 FE 10 10 10 10 10 00 00 42 42 42 42 42 3C 00 00 42 42 42 42 24 18 00 00 42 42 42 42 5A 24 00 00 42 24 18 18 24 42 00 00 82 44 28 10 10 10 00 00 7E 04 08 10 20 7E 00 00 0E 08 08 08 08 0E 00 00 00 40 20 10 08 04 00 00 70 10 10 10 10 70 00 00 10 38 54 10 10 10 00 00 00 00 00 00 00 00 FF 00 1C 22 78 20 20 7E 00 00 00 38 04 3C 44 3C 00 00 20 20 3C 22 22 3C 00 00 00 1C 20 20 20 1C 00 00 04 04 3C 44 44 3C 00 00 00 38 44 78 40 3C 00 00 0C 10 18 10 10 10 00 00 00 3C 44 44 3C 04 38 00 40 40 78 44 44 44 00 00 10 00 30 10 10 38 00 00 04 00 04 04 04 24 18 00 20 28 30 30 28 24 00 00 10 10 10 10 10 0C 00 00 00 68 54 54 54 54 00 00 00 78 44 44 44 44 00 00 00 38 44 44 44 38 00 00 00 78 44 44 78 40 40 00 00 3C 44 44 3C 04 06 00 00 1C 20 20 20 20 00 00 00 38 40 38 04 78 00 00 10 38 10 10 10 0C 00 00 00 44 44 44 44 38 00 00 00 44 44 28 28 10 00 00 00 44 54 54 54 28 00 00 00 44 28 10 28 44 00 00 00 44 44 44 3C 04 38 00 00 7C 08 10 20 7C 00 00 0E 08 30 08 08 0E 00 00 08 08 08 08 08 08 00 00 70 10 0C 10 10 70 00 00 14 28 00 00 00 00 00 3C 42 99 A1 A1 99 42 3C
I won’t spoil the surprise for you, but see if you can take a line, convert each pair of digits from hex to binary, and work out what character it is!
I cut a handful more castles for the Nissed Pewt Tavern. I believe these will be details added to chairs but I'll update when the finished pics come through.
Not sure if I ever followed up the finished signs so here it is again, apologies if you've seen it before.
07 July 2014
So, today I finally did some hands-on retro wires and programming stuff instead of sitting at a PC doing CAD stuff.
I thought I knew how the LED matrix modules would work, in theory, but before I commit anything to copper and fibreglass, I’d like to test things out a bit. So I dug out my breadboard Z80 and fired it up to check it still worked (it did), and refreshed my memory on how the BASIC “OUT” command works with the ’374 latches. Finding a bit of space on a breadboard, I plugged one of the modules in and wired it up in place of the bar graph and 7-seg displays I’d previously used as channel 0 and 1
I wanted to get a single dot on the display, so that meant turning the various pins high or low. One channel needed a single pin high with the other channel all high except for one pin. Or the other way around. Or just one pin on both channels. Or, maybe all high except for one on both channels. I could have gone through and calculated exactly which combination to use, but it was quicker to try everything. But I got very weird results
Something wasn’t right. I was scratching my head for a while until it dawned on me that the pin-out diagram on the datasheet was ambiguous (to me at least) and I’d taken it the wrong way. So, after rewiring pins 1-8 to 8-1 and 9-16 to 16-9 I tried again. BINGO!
So, using the best of my artistic and BASIC programming skills, I set about creating a little 8×8 icon
If you squint your eyes, and turn your head 90 degrees… no, 90 degrees the other way! you can kind of see a grinning smilie face!
So, using MS BASIC I’ve proved the LED matrix displays work with the Z80 hardware. I’m happy that a few of these together will give a big enough display to have something more meaningful than a grimace on it. I think I’ve lost the window of opportunity for getting PCBs made up for these though, so it’ll have to be a breadboard or veroboard build to complete the challenge.
It now comes down to the PCB fab house to make and deliver the Z80 circuit boards, and my ability to learn programming in Z80 assembly language. The latter is my biggest worry.
06 July 2014
So, having had a few fairly intensive days working on PCB design for my RC2014 computer, today was pretty much a day off. Apart from daily household chores, all I got done today was this;
Now, to the untrained eye, that may look like a schematic layout for 4 8×8 LED matrix displayed connected to a Z80 bus via some 74LS374s.
But it’s not.
It’s me tinkering on my day off. Ok, so I looked up the spec on the CSM-88041 LED matrix displays (which were manufactured in January 1998, so technically qualify for Retro Challenge) and worked out how I’d connect a bunch of them up. And, yes, I may have checked if KiCad had a 8×8 component already in it’s library that I could use – it didn’t. So maybe I might have practised my skill of component design.
But, other than that, I didn’t do anything else except for sit back and watch YouTube videos. Sure, they were videos on running data buses in KiCad, which I knew nothing of before. And, sure, I tried my hand at this data bus lark to see if it would help in linking up a whole bunch of matrix displays and tri-state flip-flops (it would!). But, really, it was just for fun.
But it does give me food for thought as to how I’m going to connect all the matrix displays up. To keep PCB costs down, it would be nice if each 8×8 matrix was on it’s own individual board that daisy chained to the next. But each matrix needs 1 ’374 and an extra ’374 for the whole bank. Plus a 74LS138 is needed for every 8 ’374.
7 displays could be enough to achieve what I want. But the tub at the hackspace has a surplus of around 200, so using 7 is hardly making a dent, so maybe 15 or 23 might be more appropriate.
I’ve just got to come up with an efficient scheme for the PCBs. And soon. Or else I’ll miss out on the Retro Challenge deadline of the end of July. And if I’m able to make a good generic PCB for these displays, maybe others at the hackspace can make use of them too and build something useful from them!
Most likely, though, is I’ll end up doing this part on a breadboard with hundreds of jumper wires. Watch this space…
05 July 2014
A bunch of letters made as a custom request. They make up 4-5 names and will be used on the top of cakes to indicated who gets which cake.
Hokey cokey, that’s the first 4 printed circuit boards for the RC2014 (Oh, did tell you I’ve named my homebrew Z80 computer “RC2014″? Pretty catchy name, eh?) ordered with OSHPark. If they arrive as quick as other boards I’ve had from there before, then I should have 11 days to get everything put together and working!
All 4 boards look fairly similar, being a CPU board, RAM and 2 variation on ROM, but here’s the 32k RAM board;
3D Artistic Render
Still need to crack on with the rest of the boards
Oh, and remember the actual challenge I set myself? It was to light up my name in LED lights. Well, last night I got another step closer with the discovery of a whole bunch of 8 x 8 LED matrix boards at Nottingham Hackspace. They’re so cute at 20mm x 20mm.
Just need to dig out the spec on these and see how I go about interfacing them with the Z80
04 July 2014
Ok, it the 4th day of the Retro Challenge, and this is just a quick blog update about what I did yesterday, which was my 2nd day of doing Retro Challenge stuff. So, yeah, it’s Day Something.
Due to life getting in the way, I didn’t get an early start last night, but I did have time to do 3 schematic and 2 PCB layouts for my Z80 that I’m building.
The first board will be for a 2764 EPROM that’s programmed with Microsoft BASIC. Technically this is not part of RC for me, but I know MS BASIC works on my breadboard Z80 so it’ll be an easy and convenient way to test out the hardware.
The next board is for a 27C512 64k EEPROM (Electrically Erasable instead of UV light). This will be what I load my raw machine code stuff up from. Why such a big size? Simple answer is that I bought a bunch of them cheap from eBay! I’ve designed it with 3 of the address lines going to jumpers, so effectively segmenting it in to 8 different 8k ROMS. If I end up writing assembly language programs bigger than 8K I might have to revaluate!
Lastly is the RAM. I’ve got 62256 chips that I found at Nottingham Hackspace, which give 32k of memory to play with. Plenty!
The schematics for these 3 boards are all very very similar. In fact, the pinouts of the chips are almost identical. I pondered over designing one single board that could be jumper-configured to match any of these requirement, and as the PCB fab house I’m going to use (OSHPark) do boards in multiples of 3, it would save quite a bit of money. However, it will add a bit more complexity than I really want right now, so quickest thing is to do 3 individual boards.
Tonight I hope to get the clock circuit, Blinkenlights and serial I/O boards done, so I can send off all 7 to be manufactured this weekend.
03 July 2014
Late in March 2014, I did a short presentation at Nottinghack‘s open night hoping to get a few like minded hackers to join me in making a BarBot – a cocktail making bar robot. Since then , a group has been meeting at the space every Thursday night and working on various parts of the machine. I’ve been documenting our progress in the form of videos of component prototypes, which I present here for your enjoyment.
02 July 2014
So, this is Day 2 of the Retro Challenge. In case you’re wondering what happened to Day 1, well, Day 1 happened to fall on Pub Night, therefore I was better off giving everyone else one day head start than having a go and probably putting myself back at least a week!
If you’ve read my posts on Retro Challenge so far, you’ll know my first priority is to get about half a dozen or so Printed Circuit Boards designed and sent off to the fabricators. The tool I am using to do this is KiCad, and the basic workflow is lay out the electrical circuit schematic, create a list of component, match the components up to footprints, lay the footprints out on a board, join up the various pads then create gerber (manufacturing) files.
I have decided to build my Z80 computer in a modular format, with lots of fairly basic PCBs to make up the whole thing. This should give me flexibility in how I use it and what I do with it going forward. It also makes the boards easy to design and lay out, and, if necessary, easy to troubleshoot too. So, with that in mind, I set out this evening with the goal of making the electrical schematic for at least 5 boards. Starting with the CPU board, which comprises of 1 chip, 1 connector and 1 resistor. Simples!
KiCad uses libraries of components, so when you lay out a circuit you can pick a resistor, a capacitor, voltage regulator etc. It’s got loads of chips in the default library that comes with it, but, as I discovered this evening, no Z80! I tried finding a library on line that had one, but couldn’t get anything that worked. So I had to design my own component – a 40 pin IC! Then, the connector I was going to use was for my Z80 bus, and that had my own designed layout, so that’s another 40 pin component I had to design! Luckily, a regular resistor was already available! So, join the appropriate pins up, and voila! A schematic!
Already that was half the evening gone! So, just to make sure I was on the right track, and things actually worked as they should, I thought I’d put the first one on a board. So, I created a net list (list of all 3 components) and went to assign them footprints. The Z80 needs a 40 pin wide DIL footprint, and that’s included in the library. Great. I had a choice of a dozen or so layouts for the resistor, so that was easy. The connector though… well, although it’s only a single row of 40 holes on 0.1″ pitch (pretty standard), the largest one available was 30 pin. Ok, so I’ve got to design a footprint too. So, I create one called “40 Pin SIL” and associate it with the component. Then I lost about an hour of going around in circles, pulling my hair out, redoing stuff and swearing. Eventually, I worked out that footprint names in KiCad cannot contain spaces! Who’d have thought? So, I create another one, call it “SIL_40″, delete the old net list, and start again. Bingo!
So, off I go with laying out the PCB, and running the tracks. and end up with this;
The yellow line is the actual outline of the PCB itself. You’ll notice that there’s some of the pads which are outside the board itself. As the cost of the board is based on the overall size, I’ve not extended it to cover pins that I don’t need. I know that any silk screen printing that goes outside the edge of the board is no problem, but I’ll have to wait until I create the gerber files to see if actual pads outside are a problem or not. If so, then I’ll have to create more individual footprints for other board combinations.
And all of a sudden, my whole evening has gone! One single board with 3 components isn’t much to show for almost 4 hours work, but I feel that I’ve learned a lot, and I’m much more set up to knock out a few more boards tomorrow night!
30 June 2014
Wow, can't believe I haven't blogged for 2 weeks. I haven't died, and I haven't had any accidents in fact I haven't really done very much of anything at all. I'm working on a few larger projects, the ever fabled Donkey Kong V2.0 is well underway and I've been looking at new laser cutters and materials so there will be things to report in the near future but stuff is still a few days away yet. I'll be sure to keep you updated.
Ok, so tomorrow the Summer RetroChallenge 2014 starts, so I thought it would be a good idea to bring you up to speed with what I’ve got so far so that you know where I’m starting from. I will also outline where I’ll be taking things for the RetroChallenge as well as where this project may go in the future.
So, in December 2013 I started poking around the internets for some ZX80 info, and I stumbled upon Grant Searles website. More specifically, he had the schematics for a Z80 based computer and a ROM with Microsoft BASIC on it. So, over Christmas I got out my breadboards and built it up pretty much as per the schematic.
There was a few hiccups along the way, but on Christmas Eve I attached a serial cable to my PC, fired up a terminal session and was able to run small BASIC programs!
Over the next couple of months I added a LCD screen and an old AT keyboard so it could stand alone without a PC to communicate with. These were interfaced via an (Arduino) ATMEGA328 – and yes, the irony of this little £2 chip being more powerful than the Z80, yet only reading keyboard and writing to LCD was not lost on me! I went on to add some basic I/O for reading switch inputs and lighting LEDs.
Whilst there is an artistically crazy beauty in the breadboard approach, with 16 address lines and 8 data lines winding their way to every corner of the board, it doesn’t make for easy modification or troubleshooting. Inevitably every time I transport it, a wire comes lose so getting it going again often takes a while. So I’ve decided to transpose it to the more permanent medium of Printed Circuit Board.
Whilst all of this could easily go on to one PCB quite happily, I have decided to go with a very modular approach so individual segments can be added or modified as I go along. Individual boards will be easier to troubleshoot too. Oh, and for me, REAL computers are made up of multiple boards plugged in to a common backplane!
A couple of months ago I looked at how the backplane issue was tackled back in the day. There were a few common standards, the most popular of which was the S100, although they all shared one thing in common; expensive connectors! If I was going to split this in to many different boards, I didn’t want to be spending a fortune on each one just for the connectors. So I decided to simplify things with 0.1″ pitch header sockets on a Veroboard backplane.
The sockets are 40 way, although at the moment I am only using 34 of those. It is inevitable that there’ll be some extra data lines of some sort! I’ve already found myself a wonderfully retro box in BBC Model B beige too!
I did make up a couple of plug in cards from Veroboard too, but with the amount of delicate connections needed, this doesn’t really feel like much of a step up from the breadboard.
I have had a couple of PCBs made in recent months by OSHPark and they are excellent quality boards at a great price. Pretty quick turnaround too. I managed to grasp the basics of PCB design in KiCad so I should be able to get things done fairly efficiently. There will be components and footprints to design in KiCad, and, as OSHPark charges by the square inch, I’ll be wanting to keep the sizes down to an absolute minimum.
The individual daughter boards I’ll be wanting to make are;
- ROM (eprom MS BASIC)
- ROM (eeprom for easy programming)
- Clock (7.3728Mhz)
- Clock (debounced button for manually stepping through code)
- Clock (variable speed timer to run slowly without manually pushing a button)
- Blinkenlights (Each of the address, data and clock lines to have a LED)
- Serial I/O
- Keyboard\LCD (ATMEGA328 just like the breadboard version)
- TV Output
- Switch Input (Individually addressed input lines)
- LED Output (Individually addressed output lines)
Of course, only a few of these are needed for basic operation, and initially I will only be making what is required to meet the challenge.
Then there’s the programming. Oh, the programming! As I’ve mentioned before, I’m not a programmer, so diving in to Z80 assembler language is going to be hard going. Whilst the boards are off for fabrication I can use an online Z80 emulator to learn the fundamentals, and hopefully, but the time they’re done, I’ll be ready to run some code on the real machine. I’ve got electrically erasable programmable read only memory (eeprom) chips that I can use, then erase and program again when it doesn’t work. And as long as I’ve got the button based clock board done, I can step through the code one instruction at a time an hopefully interpret the Blinkenlights to see what’s going on.
All in all, I kow it’s going to be quite a learning experience, but I’m sure it’s going to be a fun one (and probably frustrating) too!
Wish me luck!
29 June 2014
Take one Star Wars Ship Cake Silicone Mould.
Take one Maple Bundt Cake recipe.
Eat the Death Star. EAT IT.
28 June 2014
I have always wanted to enter Retro Challenge, ever since I first heard of it nearly 24 hours ago. I followed a link that took me to http://retrochallenge.net/ and I read up on what it was all about, scrutinised the rules and checked out what others were doing. I quickly came to the conclusion that I could give this a thing a go.
All I needed to do* was come up with a suitable challenge for myself.
I have decided to make my name appear in LED lights.
So an email was sent to the competition organisers;
Hi Retro Challenge!
I’d like to enter the 2014 Summer Retro Challenge please!
The challenge that I have set myself is to make my name appear in LED lights.
Ok, so that might not sound too difficult, but I’m going to try and do it totally in Z80 assembly language. On a real Z80 computer. That I’m going to have to build. And design. And burn eproms and connect I/O chips and wires and LEDs and stuff. Oh, and I’m not a programmer, and have never done any Z80 assembly stuff.
Does that sound like fun?
I’ll be documenting my progress on my blog www.sowen.com as I go along. And probably tweeting about it from @semachthemonkey
Hope that sounds ok
This will be resurrecting the breadboard BASIC Z80 computer I built over Xmas last year, but I’ll be transferring it to printed circuit boards – I say ‘boardS’ because I’m planning on a modular arrangement with a backplane for the bus. Kind of like how old computers were built back in the day, only cheaper with less specialised connectors.
It will mean I have to do battle with KiCad again, and as I’ve only designed 3 PCBs before, this in itself is quite daunting. Then, of course, I’ve got to actually get the boards made. Given that the competition is only a month long, this will be the biggest bottleneck. I will have to rush the PCB design to get them made, however, I can’t afford to make mistakes as there’ll be no time to respin any of the boards.
Assembly and testing of the boards should be fairly straight forward, and I’ve already got the backplane and a suitable enclosure lined up
Then there’s the programming. Oh, programming. Sure, I can copy & paste & tweak Arduino sketches to do what I want, but that doesn’t mean I’m a programmer. And I’m certainly not a assembly language level programmer. So, getting to grips with that while waiting for the boards to be made up will keep me busy.
Then, of course, I’ve got to find some suitable LEDs, and connect them to the hardware I’ve made. I got my breadboard Z80 to control a 7 segment LED display and a bargraph using BASIC, so it can’t be too hard, right? I think there’s a bunch of 8×8 LED matrix boards at Nottinghack that I can borrow, so I guess I’ll try to use those.
Of course, the biggest challenge for me is blogging all of this. As regular visitors to my blog will realise, there’s not much point regularly visiting it because stuff doesn’t get blogged very often. So I’ll have to make a super big effort in July.
Wish me luck!
* Actually, just coming up with a challenge isn’t all I need to do. I still have to enter, and, more importantly, complete what I set out to do!
21 June 2014
Another project I just finished, although this one is much less complicated and more ridiculous.
It’s a Charlie Brown themed hat for a friend. It has stupid colour stranding. But it is nice and warm. Which would be great, except that it’s the summer now, so it’s not like you’re going to wear it.
Also, the background is the cover of Meco’s 15-minute Star Wars disco remix. Because I CAN.
20 June 2014
I knitted it using Regia Lace in Aventurine, which I bought at Knit Nottingham. I bought it without thinking about a pattern, but then when I saw this lovely fish-scale and wave shawl, I knew I had the perfect yarn for it.
It’s immense, it’s overly complicated looking, and it’s really way way way too femme-y for my usual daily wear, but I love having it and I love having made it.
19 June 2014
Wind speeds are very site-dependant - with topology, ground roughness and other factors affecting the local wind speed. Knowing the wind speed and frequency of the wind speed at a particular location allows us to make a more accurate resource assessment.
An accurate resource assessment is required for ensuring the wind turbines are sited correctly - in locations where they will generate the maximum energy.
This project was to develop a low-cost, low-power wind speed monitoring unit. This has mainly been developed for use in remote rural locations with a specific application to small wind turbines for international development projects.
I have been working along with Nicola Greene (in conjunction with Water for People and Engineers Without Border UK) and James Fowkes (a fellow Nottingham Hackspace member) to look at the issue of data monitoring for pit latrines.
A group of us had a hackday at Nottingham Hackspace to discuss the problem, look at solutions and hack together prototypes.
The problem is described here in a presentation by Nicola. Basically Water for People have been installing pit latrines in various different areas in Uganda. These are filling up at very different rates, but the reason for this is unknown. They need to record the usage of the latrines in a simple, low-cost, robust and non-intrusive.
17 June 2014
I’ve posted earlier about Art inspired desserts at the Blue Bottle Coffee Bar at SF MOMA. But now the full cookbook by Caitlin Freeman is out, featuring a series of modern art inspired deliciousness!!
16 June 2014
I've been messing around with some 32 x 8 LED displays - as I have been wanting to create graphics. These LED displays are from Sure Electronics are available for around $13 and use the HT1632 LED driver IC, with an SPI-like control.
I have designed a new circuit board which plugs directly onto the back of these displays and contains a ATMEGA328 with the Arduino bootloader, a real time clock, a temperature sensor and a couple of input switches.
The notes here show the device in action and how I created some bespoke graphics for the displays.
I was asked to propose a few ideas for group projects on the product design and manufacturing engineering course at Nottingham University.
I proposed a few projects and two of them were taken on by small groups. These projects have been designed and built over the course of a year and I went to see the end results at the end of year show.
There were two projects taken on: a portable pedal generator and a traveling work station.
Here are some photos and details of the final projects. A big thanks to the eight students involved in these projects.
15 June 2014
14 June 2014
13 June 2014
12 June 2014
Recently I’ve been making a lot of printed circuit boards. One of the common problems I run into is aligning holes correctly when hand drilling. This is especially troublesome on boards with large arrays of pins, such as my hexapod controller (I promise I’ll write that up soon!). A misaligned hole will prevent IC sockets from fitting correctly or cause pin headers to sit at crazy angles. This is really obvious on the first version of my hexapod controller board as shown below.
In order to work around this for the second version of the hexapod board I used my CNC machine to drill the holes. This is great for relatively large jobs, but the setup time makes it less attractive for small one off boards.
Since I was scheduled to have an induction on Nottingham Hackspace’s new laser cutter and given the option of cutting my own project during the induction, I came up with a simple mechanical solution to drilling holes at the 0.1 inch spacing required for most IC sockets and pin headers.
The concept is very simple: a zigzag line is cut through a piece of plywood with a “wavelength” of 0.1 inches. One side of the cut is clamped to the work surface of a pillar dril,l and the board to be drilled is taped to the other side. The serrated edges can be moved around, and when pushed back together they naturally align to multiples of 0.1 inch. I went with a sawtooth style wave in the end so pressure can be applied in towards the flat edge of the sawtooth without the piece slipping.
The photo above shows masking tape, but double sided tape would have worked better if I’d had any with me when taking the photos.
In order to make grid style layouts I added a second layer of serrations at 90 degrees to the first. I’ve not had chance to test this as the work area of the pillar drill I’ve been using does not have space. The intended usage is that both of the outer stages would be clamped in place and the inner piece manipulated by hand to drill columns of holes. Once a column is complete the middle stage would be un-clamped, adjusted then re-clamped. This is repeated for as many columns as necessary.
I’ve used the jig with a single stage on a few boards now, and it works well so long as the initial hole is well aligned. An easy way to ensure this is to align the drill bit with the smallest hole in the row and then clamp the jig in place.
To ensure that the board is aligned correctly in the jig, I usually find the longest run of holes on the board and put a ruler against the edge. Drawing a pencil line along the ruler provides alignment marks on the board that can be matched up with the etched lines on the jig.
In the current version, the inner section of the jig is a sacrificial piece which will eventually become full of holes. I toyed with the idea of making the inner section in an L shape into which the board would fit, but this would rely on the edges of the board being cut exactly parallel with the grid so it’s less useful in practice. Hopefully the sacrificial part of the jig will last long enough, and it’s cheap enough to just make another when it wears out.
Earlier today I used the jig to make a very simple breakout board to match the pinout from an FTDI board to an Arduino style six pin header. The 6 pin header and 32 pin (minus 4 due to the weird layout on the FTDI board) IC socket I used fitted perfectly first time.
I’ve made the CAD drawing for the jig available to download. Hopefully it will be useful to someone.
When I made my first Carcassonne Set for Project 52 I left the back of the tiles intentionally blank. Doubling up the engraving makes a hefty dent in the price tag and I figured nobody would ever want it. Well I was wrong, after a few requests I have now got round to adding engraved backs to the tiles. They look absolutely stunning.
While I still can't bring myself to release these files into the wild yet (160 hours of drawing was just too many to give away) they are now available in the store with/without engraved backs depending on your budget.
11 June 2014
10 June 2014
09 June 2014
04 June 2014
03 June 2014
Pattern: Bicycle Skirt Guard by Lorna Watt on Ravelry.
01 June 2014
That is an absolutely adorable addition to Owls, although I’m not so sure about it heading into the armpit.
Still, it just reminds me that I really really need to actually need to knit this jumper.
31 May 2014
The kit comes in a heat sealed cellophane packet which is a lovely touch. The parts have been rounded up to 4 and half panels which clearly makes them easier to pack. Leaving in all this excess material has left room for helpful assembly diagrams. The parts are cut with sprues holding the pieces in but they are easy enough to remove with a sharp knife.
In a workshop far, far away, artist Tony Larson recreates amazing Star Wars Terrariums complete with Yoda, R2D2, and Ewoks. The tiny living sci-fi worlds are available through his Etsy Store, starting at around $100.00 for each realistic miniature scene
30 May 2014
OH MY GOSH :O
Here are the build details and some photos from a DIY 'Build a Solar Phone Charger' workshop I ran at Nottingham Hackspace.
There were six participants and they all built a small phone charger which runs from solar power.
Full design details and instructions are available to download here.
28 May 2014
After the longest period of time trying to figure out what I'm going to do with this catapult design I have finally put it into production and am now listing it in the store. I decided that kickstarting it wasn't going to work and now I have access to a higher powered laser cutter there is nothing stopping me from making them already.
26 May 2014
After the mini map comes the inevitable maxi map. Prototyping an item of this size is, of course, logical and sensible but it can't iron out all the creases for you.
Each region on this map was cut as a separate section, to more clearly define each territory. Each region has a different heigh to most of it's neighbours, loosely based on whichever tile has the most mountains.
Just like a giant jigsaw puzzle the map slowly came together. Last time the region names were just etched into the plate and they disappeared into map, this time I chose to outline the letters instead (and making sure they weren't engraved) I think coloured the letters in with a sharpie pen to make sure they stood out.
Here you can see the world map in action with the war leaders being forced to make some really tough decisions like "Do I want 1 lump of sugar or 2 in my tea"