23 September 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 portable (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.
22 September 2014
21 September 2014
Over the next few days I'll be making some changes to the blog and adding some content to the bar at the top. I'm starting with the galleries. Underneath the blog I've been storing all my images in several picasa photo albums (they tie in nicely with the blogger interface). Now that the blog has grown to 700+ posts it's hard to randomly browse it all to see all of the things. This way you can browse the galleries directly and more easily find your way to the good stuff. Happy browsing.
Oh and btw, having just browsed all the galleries myself, this Iron Man wood veneer is my current most favourite item of all time (subject to change of course)
This is the cake that dinkydoodle designs made, on top of the cake stand that I made. In a rather disappointing twist the stand worked perfectly during testing but failed when it was fully loaded up with cake. The customer was unaware of the rotating potential so nothing really hurt except a bit of pride. More photos of this wonderful cakey creation can be found on their FB page.
20 September 2014
I just wish it wasn’t just for Mac, because OMFG let me virtually knit!
16 September 2014
When Google first launched the Chromecast, I wanted one as it seemed like it would solve a lot of viewing problems for me. The trouble was, my “TV” (technically, it’s a 42″ monitor as it has no tuner) doesn’t have any HDMI sockets, so it would cause more issues than it would solve, and I figured it would be £30 wasted.
When the price was dropped to £18 recently though, I figured that was within the realms of wasteable money I was prepared to spend. My TV didn’t have HDMI, but it did have composite, RGB, SCART and VGA connections. Surely something would work…
I remembered that I had got hold of a HDMI to VGA adapter for the Raspberry Pi which worked quite well (both times I tried it!), and although I couldn’t find any definitive answers on line, I thought I’d give it a go.
These are plentiful on eBay for under £5, although there are several variations, and I can only vouch for the ones that look the same as the ones shown above. eBay listings update more often than this blog post will, so I won’t link to a specific one, but search for “HDMI VGA Raspberry” and you should find some that looks like the photo above. Some of them do not have audio out though, so watch out for those as they’ll be a problem.
The first problem I found, however, was that the Chromecast had a male HDMI plug. So did the VGA adapter. I had my doubts, but a female to female HDMI adapter (£2 from eBay) worked a treat! Add in a 3.5mm jack to twin phono adapter (your audio set up might be ok with the 3.5mm lead that comes with the adapter – alternatively, you might need to buy an amp and speakers!) and I was good to go
It might look a bit gangly, but the point is, it works! Google Chromecast to VGA TV for under £27! (And most of the ganglyness is hidden in normal use anyway)
Generally, this works perfectly streaming 720P to my TV. The only slight niggles I have is that I lose about an inch of picture down the left hand side (but not really noticable), and when the power is removed from the Chromecast the speakers make a funny popping sound (probably the caps in the VGA discharging). But otherwise, all is good.
So, if you want a Chromecast but don’t think you can use it, think again.
15 September 2014
So, the RC2014 is great. I can run Microsoft BASIC and program it from there, and as long as I am using a terminal emulator, I can copy & paste to save and load programs. Alternatively, I can write Z80 code using an online compiler then download it, copy it to USB stick, move it to my old Windows 2000 laptop (which has a parallel port) so I can burn it on to EPROM to see if it works, make adjustments and repeat with another EPROM.
I will be the first to admit, however, that this is probably not the most efficient workflow. Not to mention the time and effort involved in wiping the limited stock of aged EPROMS.
So, I am in the process of designing an SD Card based bootloader.
Interfacing a Z80 to an SD card isn’t totally straightforward though. For starters, the Z80 runs on an 8 bit parallel data bus, but SD cards use a Serial Peripheral Interface (SPI). The Z80 is 5v, the SD card us 3v3. And as for using the Z80 to address a particular memory location on the card… well, forget it!
[Sometimes I seriously wonder just how Zilog expected their Z80 to address things like 512GB of SD card when they designed it back in 1975!]
So I’ve decided to use a modern ‘cludge’ to provide the glue to stick the two parts together.. An Atmel ATMEGA328 (Arduino) speaks SPI and has enough pins to provide an 8 bit signal. I will use the same interfacing technique as I used with the LED Matrix displays so that there’s a buffer between the Z80 and ‘328
I hooked up a rough and ready breadboard & Arduino test to prove the concept, but initially I had lots of Odd Things™ happening, and all but came to giving up.
At the last moment, I spotted the school boy error. The power rails of my breadboards are divided in to two halves, and despite having things connected to both sides I didn’t have anything to connect the two. So the decoder chip was being back-fed through the SD card adapter. Ooops! In my defence though, it really is bloody stupid for breadboard manufacturers to not join up the power rails all the way through. It is bad enough that the two sides aren’t linked – although I can appreciate you might want maybe a 5v and a 3v3 volt rail… but splitting it down each side too, well, this has now become a more of a rant than a blog.
So, with the Arduino able to put characters on the Z80 data bus that I could read with BASIC, I decided it was time to take it to PCB level. I’ve got 8 bytes of data input from the ‘328 to the Z80 via a 74HC245 and 3 bits of output from the Z80 to the ‘328 via a 74LS374 selected from a 74LS138. (There is also 3 output lines going to LEDs for status monitoring). The hardware should be easy enough, so I’ve laid out the PCB and sent it off to OSHPark to be manufactured. It is, however, the largest and most complex board on the RC2014 so far.
The software will be the tricky bit for me. Firstly, I need to write a boot loader in assembly language and burn it to an EPROM (wasn’t this what I was trying to avoid???). Secondly, I need to write an Arduino sketch that will read an SD card and write it out to the 8 bit parallel bus. From a timing perspective, I have assumed that the Z80 will write to it’s output so the ‘328 will know to put the first byte of the SD card on the bus. The Z80 will then read this, write it to RAM and signal to the ‘328 it wants the next byte. And repeat until done then set the Program Counter to the address in RAM to execute the code.
I have deliberately chosen a request/send model so that timing issues are avoided – partly because I don’t know if there would be timing issues, and partly because one of the things I would like to do is run the Z80 very very slow (so I can see what is going on), and this should still work.
Initially, I will gloss over the issue of file size and memory location by assuming a file size of 1k (with the ‘328 padding with FF to make up the balance) and that all programs are run from 0x8000. I can, if needed, add in a file on the SD card that defines these parameters that the ‘328 can send as a preamble… but we’ll cross that bridge when we get there!
I thought I was at the end of the 'things made at EMF camp' but then I remembered I actually cut some stuff for myself while I was at EMF camp. It's probably because I prepared most of the things in advance but they were cut and assembled at EMF camp so that counts right?
I've made flavoured vodkas before by dissolving boiled sweets into vodka and coming up with some pretty tasty flavours. This year I thought I would go one step further, I made 5 sweety flavoured vodkas and 1 nasty flavoured vodka and being a field full of tech geeks I figured they would appreciate a mechanism to automatically select a flavour for them. In brief, an arduino uses the random function to pick the appropriate bottle. A row of surface mount LED's illuminates the bottle selected and these are driven simply with a ULN2008 driver chip. The LED's spin round in a circle and fade in and out as they are selected. The rotation slows down and picks one bottle to end upon.
I'm not sure the random seeding from the A->D is particularly effective and I was basically resetting the power each time to make it spin again so it had this weird habit of picking the nasty, Horse Radish, flavour every time but that just all adds to the fun.
14 September 2014
My original plan had never been to design and build my own computer. I had, however, planned to build a clone of the Sinclair ZX80, which has been on my bucket list of things to own for year, and which I had found plans for online. Whilst collecting the parts and reading up on simple Z80 computers I got kind of sidetracked and ended up with the RC2014.
The heart of the RC2014 is a Zilog Z80 CPU, which is the same one that Sinclair used in the ZX80, ZX81, ZX Spectrum and Z88. If the ZX81 and ZX Spectrum can run a ZX Printer, then surely it follows that the RC2014 will be able to too?
The RC2014 backplane brings out nearly every signal that the ZX Spectrum has on it’s edge connector, so a simple adapter from the 0.1″ pin header to an appropriately laid out edge connector should suffice. The only signal the RC2014 doesn’t have is 9V which is used to drive the original ZX Printer, so I added a connector for that to be injected in. (For my use it isn’t strictly needed as I’ve got the Timex/Sinclair 2040 (also sold as Alphacom 32) which takes it’s power from a mains adapter, not the edge connector, but is otherwise totally compatible)
So, I soldered the connector on, plugged it in and expected things to work. But, no. I had Odd Things™ happening, and couldn’t get much sense out of the serial interface.
It turns out that the ZX Printer uses very very minimal address decoding. Basically, if the IO address line A6 is low, then it has the data bus. The only thing I had connected to the IO of the RC2014 was the serial interface, which although it only had a small amount of address decoding, it did use A6 in a low state.
So, a little bit of thinking later, I realised that the easiest solution was to put some decoding on to the ZX Printer adapter so that it would only respond to a more specific address. Luckily the design of the RC2014 backplane meant that cards can be easily extended with a bit of Verobaord.
Here’s the modified board with a 74LS10 that brings A6 low only when A0, A1, A3, A6, A7 are high. Therefore I can address the printer from port 203 (0xCB)
The control of the printer is very low level indeed (ie ever so simple, thus complicated to do!). Early tests have shown that I can print lines of different lengths though! I consider that a #WIN but will see if I can get a dedicated print driver written for this.
"Alex Bailey requested a laser cut gift voucher for his dad, Adrian" ;)
So that was basically it, but I realised it was a good idea and agreed to make him a little laser cut item to represent a gift card. This all happened weeks ago but given the recent spate of catapult fiddling you can see how the two get connected. You get some instant gratification in the form of a mini catapult which you can assemble while you wait for me to ship the item you pick from my blog (this includes customised items).
If you would like a giftcard
Both giftcards and catapults are available from the same listing
13 September 2014
Having had the ShapeOko for over a year now I’ve used it for quite a few projects, but nowhere near as many as I intended. Part of the reason for this is that the controller for the machine was still rather jury rigged so setting it up was a hassle. To solve this problem I’ve been working on integrating together a permanent version of the controller.
I started by designing a pair of custom PCBs with a bus to connect them together while allowing for expansion. The first board is essentially an Arduino with custom pin out. The second board mounts the stepper controllers. At some point I may add a breakout board for limit switches and a board to interface with a pendant for manually controlling the machine.
Having built the boards, they all work fine, but there are things I’d do differently if I made another. First off I’d probably stick with a standard Arduino pinout, both for reusability and because the 24 pin DIL socket I used turned out to be expensive. Additionally, the layout for the (single sided) boards would have been much simpler without the DIL socket to consider.
With the boards made I decided on using an FTDI module I had lying around for USB to serial conversion, replacing the Minimus that I was using previously. I designed a very simple breakout for this module to expose the Power, Reset, Ground and Serial Tx/Rx signals in a way that matches the Arduino’s FTDI header. The main benefit of the breakout board, however, was that I could give it appropriate dimensions for mounting in a case.
With all of the boards made and (a few months later, once a burst of motivation turned up) assembled, I needed to build a case to keep the parts together. I decided to laser cut the case from perspex in order to get it made quickly—and because I thought a clear perspex case would look cool.
Due to my earlier experiences with fried Stepper Controllers I decided to use locking connectors to prevent accidental disconnection while the machine was powered up. After some searching I found that 4 pin gx16 aviation connectors seemed to do what I want. I ended up ordering some from China through Amazon as it was the cheapest source, though thanks to the seller incorrectly filling in the customs form I paid more than expected for them. Regardless, they work nicely and look good. I also used one of these connectors for power, with two pins acting as 12v and ground and spare pins for signalling. Should I choose to power the machine from a PC power supply at a later date, one of these lines will be used for the PSU’s power on line.
With the connectors and some switches chosen and measured, I began work on designing the case. I settled on a fairly simple tabbed box design. The box is split into two sections to match the two widths of board: narrow USB to serial breakout and wide Arduino and Stepper Controller boards. The sides of the box have slots into which various mounting plates can be bolted. The boards locate into slots in the mounting plates, allowing for quite flexible arrangement of the boards.
With the case parts cut, I found it fairly fiddly to assemble, but once together it was quite sturdy. Some of the wires to the connectors had to be soldered with parts of the case in place. This makes maintenance slightly trickier, but will reduce the chance of intermittent connections to the steppers which could exist if I’d used a second set of connectors on the board.
The layout of the connectors and switches was mostly determined by the shape of the case and the space taken up by the boards. I ended up with the stepper connectors on the top of the case in the same section as the USB to serial adapter. The connectors are quite deep, so they required a lot of space behind their mounting plate.
On one end of the case there is a cutout for the USB to serial board and a reset switch for the Arduino in the form of a big red button. It’s not exactly an emergency stop button but should have a similar effect.
On the other end is an extra gx16 connector for power and a switch that will act as a power switch if a PC PSU is used. The switch is designed to connect or disconnect the ATX PS_ON line instead of being directly in line with the 12 volt input, which would require a sturdier switch. There is space for mounting a much smaller alternative switch, but I went with a large toggle in the end.
Each end of the case has a grille and mounting holes for a 45mm fan should extra cooling be required.
In order to keep the cables for the steppers tidy, I slipped on two pieces of heat shrink over the paracord sheaths I added. These keep the ends of the paracord neat at each end of the cable and provide a bit more bulk so the strain relief in the connectors has something to grip.
Parametric Design is the generation of files from an initial series of variables. The pattern is described in terms of these variables and when the values are changed the whole design is adjusted. These variables can typically be used to store things like the material thickness and object size. Something like this tabbed box maker offers true parametric design but it's an extension that is written in python so you require some programming skills before you can write your own. For something like this mini catapult design where we only want to change one variable a full blown extension would be overkill so there is an easier way.
I spent a lot of time working on the variants of this catapult so forgive another post centred around it. When I scaled it down to half size a lot of the press fit joints no longer fitted together because the material was a little bit more than 3mm so I realised there was a quick and easy solution to changing thickness.
When the design consists of entirely laser cut parts you can cheat the parametric design process. When the catapult is scaled all the parts stay sized relative each other, so I created a version of the file where the material width is considered to be 1 unit. Any tab or slot that relates to the material width is 1 unit wide (in my case mm's). When I want to cut the item in a new material I take this base file and scale it by the material width. When I have 3mm ply I scale it up by 300% and I'll save that file and run with it, but if I get some thinner stock, say 2.9mm, I can go back to the base file and quickly scale it by 290%.
This trick only works for items where most of the parts are laser cut. It wouldn't work with something like my marble machines because the marbles are a fixed size and the holes to mount the motor need to have the right spacing, but it will work for some designs and it is a lot quicker than recreating the whole thing parametrically.
Here is the catapult file scaled and ready for conversion to your own material thickness if you would like to give it a try. I recommend something like 0.5mm nylon chord for the string to go with it, you can work out exactly the right length of the string by wrapping it around the notches in the edge of the board. (svg here)
Catapults, large and small can be bought from my shop
12 September 2014
08 September 2014
Matt Brailsford wanted to cut some keyfobs for Barnsley IO. AFAIK he had some assistance cutting a sample wooden one and then came back to cut a bunch of plastic fobs. After we left him hanging round the village for an age waiting for assistance I let him play on the machine on his own, with a few little hints he came up with these nice green key fobs.
07 September 2014
06 September 2014
Ciaran O'Connell, on behalf of the radio station at EMF Camp, EMFM, wanted a sign that would distinguish their marquee from the ones on either side of it. Queue the laser cutter. Cut from 3mm perspex and backed with 3mm of fluorescent perspex, this made the text really stand out.
05 September 2014
Dan Nixon spent a fair bit of time on the laser cutter trying to cut a first draft version of his google cardboard design, made from wood. The unit spent most of the weekend on the bench full of laser cut items and was a definite favourite with visitors to the village. I think there is a bit of market for these if he could be persuaded to sell them.
04 September 2014
03 September 2014
02 September 2014
|Images Stolen from Dominic :)|
Lots of the kits sold here require a programming cable to program the ATMEGA328 micrcontroller.
These kits use a bare microcontroller and do not incorporate a USB-Serial IC on them (unlike the actual Arduino UNO and others).
This reduces the cost of the circuit as, once the project is complete, you do not need to reprogram the IC and having the USB-serial IC is a waste.
Here are some reporgramming cables which work with our kits.
They are available for £9 (inlcuding P&P within the UK)
28 August 2014
Take some Avatar: The Last Airbender iconography.
Take some fluorescent perspex.
Take a laser cutter.
Create your own phone charms to show your Air Nomad or Water Tribe affiliations.
26 August 2014
This is an utterly ridiculous knitting project.
I bought an LED plant pot from Lidl. And I knew I wouldn’t put an actual plant in it, because that just seemed pointless - I’m rarely outside at night, it would never be on.
So I knew I was going to EMF Camp this year, and I knew that having little random lights is always a lot of fun, and I had a small collection of fibre optic hair clips from The Glow Company because of my Teddy Lupin doll project, so I started goofing around and here you go, a cactus with fibre optics in the flowers.
I did think about putting the fibre optics throughout the cactus so that it would have “spines”, but I knitted them in the round, and it would’ve been impossible to properly get it all sorted.
I think that I might do it again, with one knitted flat, so that I can fit the fibre optics into the spines.
25 August 2014
24 August 2014
23 August 2014
22 August 2014
As a child growing up in the 1970s, I had no idea of what the future held. I didn’t know if Mr Benn would be able to get back from his adventures, or if Scooby Doo could catch the Evil Swamp Monster, or even if we were going through the round or square window in PlaySchool. But there were some things about the future that was pretty certain. We would all have robot butlers, go on holiday to the moon and drive electric cars!
So, as I drove to work this morning in my electric car, wondering when my moon tickets would drop through the letterbox, I realised that maybe, just maybe, I am already in the future
The car itself is a 2013 Chevrolet Volt Extended Range Electric Vehicle (E-REV). There is quite a large choice of electric vehicle on the roads in the UK right now, and, just like petrol cars, come in a range of sizes, styles and prices to suit different people. They don’t all work the same way, or use the same technology, and what may be perfect for one person might not work at all well for someone else. For example, a Nissan Leaf is battery only, quick to charge but only has a range of 80 miles or so. Hybrids like the Toyota Prius, have a engine and a motor and can run on either and will charge the battery when running on petrol.
I have covered almost 2500 miles in just over 2 months, and most people I talk to seem interested in how it works both technically and practically for me, and why I went for this kind of car. It is an excellent car that suits me well, but it does have limitations and downsides that mean it might not be for everyone.
Firstly, it is an Extended Range Electric Vehicle. That is, it runs on an electric motor from battery power, but it also has a petrol engine that can run a generator to keep the battery from running flat. Unlike a hybrid, the petrol engine does not drive the car. Normally, the battery is charged up from home which gives me range of about 40-50 miles before the engine needs to kick in. As my daily commute is around 18 miles each way, and I’ve not been on any long journeys since getting the car, the engine has not been needed, or even started.
(Except once. I got in the car and a message on the dashboard informed me that due to the infrequent use of the engine it needs to be run for a 10 minute maintenance schedule. I guess that makes sense to ensure nothing seizes and all the fluids are pumped around a bit. And 10 mins of petrol use over 2500 miles (so far) still seems very low!)
Charging the car is very easy. It comes with an adapter that will plug in to any UK 13A plug socket. This runs at 6A by default and will fully charge the battery from flat in around 8 hours. It can be overridden to run at 10A, or 6 hours to charge. Thanks to a government scheme though, I have had a dedicated charge point fitted free, and this runs at 16A, taking about 4 hours to fully charge.
There are electric charge points dotted around all over the place, most of which are free, some are cheap and others less so. These range from most IKEA branches, some supermarkets, city car parks, motorway services, hotels and other places. They are often run by different companies and have one or more of the common 4 charging sockets and charge at different rates of power. Although I have free access cards for a couple of companies charging posts, so far I have not used (or needed) any.
Some other electric vehicles, particularly the battery only ones have much more powerful charges built in to them, so can charge at 32A, 63A or 125A. This makes sense for en-route charging if you need to drive somewhere beyond the limit of your battery. The Chevrolet Volt, though, takes too long to charge for this to be practical. Effectively, you get a maximum of about 12 miles range per hour of charge, which makes it suitable for destination charging. Unless, of course, I wanted to stop for 4 hours every 40-50 miles!
As I said earlier, though, my daily commute is about 36 miles round trip, so that has been covered on battery only since getting the car. Some evenings I pop out, and some weekends I take much longer trips. So far, plugging in when I get home for an hour or so has covered all the evening trips, but sooner or later I will be heading down to Essex or further afield. For a trip like this, the first 40+ miles will be purely electric, with the remainder of the journey having the engine running.
As you can imagine, the engine is a small efficient unit. Because it is not driving the car, the speed it runs at is controlled for efficiency of charging, and I can expect to get over 50mpg from it. Still not too shabby for a big car like this.
So, how much does it cost to run then? Well, I’m glad you asked. It has worked out around 3.4p per mile based on the cost of electricity to charge it up. That is around £1.25 per day to commute to work and back. By comparison, the same journey in my LPG PT Cruiser (which wasn’t too efficient, but the fuel was cheap) cost around £7 per day. If I’d been running that car on petrol, it would have been over £13. Then, of course, there’s the car tax which is zero! And, because of less engine wear and less break usage (regenerative breaking used whenever possible) services costs are lower too.
But I bet it is slow. What is it like to drive? Actually, it’s quick. Amazingly quick. I mean, really quick. Even in “normal” mode, it takes off from the lights quicker than most cars out there, and in “sport” mode, it can outpace a rocket! And, unlike a convention engine that has a gearbox to make use of its sweet spot of power, an electric motor has torque available to it whatever the speed. And with the exception of a little bit of tyre noise and wind noise at higher speed, it is completely silent! It is so quiet actually, that I am beginning to listen to the background noises and interference in most of the pod casts I listen to!
Oh, and don’t get me started on gadgets. Well, ok, yes, it has gadgets. Lots of them. Sure, regular stuff like CD \ DVD player, electrically heated seats, sat nav, Bluetooth etc. But also touch screen display, DAB radio, rear view reversing camera, hard drive for MP3s. My favourite one, however, is preconditioning; Before you leave in the morning, whilst the car is still plugged in, the heaters and window demist can be triggered. So, not only do you come out of the house to a nice warm car (or a cool car in the summer), but it doesn’t affect the electric range as this was done from the mains supply! Genius!
Despite the fact that electric cars have been around for years (If the Toyota Prius was human, it would be getting its GCSE results next year!), things have still got a long way to go before everyone drives an electric vehicle. The infrastructure isn’t yet as commonplace as it needs to be. The range of all cars except the Tesla S will mean compromises for most people. Initial purchase price is still too high compared to a dinosaur fuelled equivalent.
But, one by one, we will all get to the future. For me personally, I am really pleased that I am living in the future already, although just a little bit sad that my robot butler must have hidden my moon tickets!
17 August 2014
Recently I’ve read a few posts about other peoples working environments, office setups, man caves or work benches. I’ve also had a couple of people ask about mine, since I tweeted about the redecoration and overhaul of my old “spare room” as it transformed in to “Man Cave 2.0″. I had intended to write it up when it was finished anyway, although, even now, 9 months later, it is still not finished, I am begining to realise that it will never actually be finished but will evolve and morph over time.
So, this is a look at the overall design and some of the finer detail in to my Man Cave 2.0 as it stands in August 2014
So, obviously the PC is at the heart of things in here. Well, actually, the PC itself is tucked right away in the furthest corner under the desk as I hardly ever touch it. Instead, though, I have the power switch mounted just below the monitor screen shelf and have a selection of USB ports wired in to convenient locations.
Under the monitor shelf is some LED lighting – nothing too fancy, just white, along with an 8-way extension socket. I’ve not filled them all up simutaneously just yet… but I’m sure I will do one day! Under the desk itself is the same set up of LEDs and power sockets.
Above the shelf is the cable modem, router, external hard drive, speakers. That corner of the desk is just far enough out of reach that I wouldn’t want to use it for anything I need to get to regularly, but just close enough to reset a router or plug in a new cable on the occasions I need to.
The desk itself is HUGE! 2.4m by 1.2m at its widest, although most of it is 800mm deep due to the shaped cut-out that was flipped over to make the shelf. The key to it though is versatility. The centre section is multi-use, depending if I just need space to spread out, or add an Ikea breadboard for soldering or messy stuff, or add a cutting mat for more delicate things.
No good workbench is without a power supply. This one is a converted ATX PSU for 3v3, 5v, 12v, -12v, and USB power output too. Thanks to re-innovation for that.
Storage solutions help me fill this small room with just soooo much crap. Of course, Really Useful Boxes help with this storage!
A couple of Ikea units, a shelf, and what appears to be randomly placed drawers, boxes, cupboards and display booths are all within handy reach behind me. I’ve tried to keep similar things together and labelled, and so far that seems to be working well. Can you see the little HP Micro Server lurking there?
This is where new electronic projects are born. And old ones go to die. And unfinished ones go to sleep. There’s a good selection of components, PCBs, prototyping stuff
Every couple of years I need to update my Cisco certifications, and over the years I have managed to get myself quite a reasonable collection of hardware for building my own labs. Before the renovation I was limited to only a few devices per lab.
The old Toshiba Satellite laptop is about 15 years old, but still great for connecting in to the Cisco colsole ports and running a few basic applications. It is also the only machine I still have with a parallel port, so it’s still needed for my eprom programmer. I have a 12U floor standing rack on casters which holds all the heavier Cisco equipment…
And another 14U of rack framework built in to two support legs. When the wiring is complete there will be a 24 port patch panel in each one as well as one under the monitors so I will be able to connect anything to anything. It will also come in handy for keeping me warm in winter :-)
Oh, and no Man Cave would be complete without a Leggy Lampshade for providing optimal lighting just where it’s required!
For bigger, more mechinical stuff, there is still my garage, and that might feature in a blog post at a later date. Surfice to say, there’s most of the tools I need in there, but for anything else, Nottingham Hackspace is open 24/7!
15 August 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.
Some of you may remember that last year , after a regretful decision to ‘upgrade’ from Windows 7 to Windows 8 I decided to jump ship and switch over to Linux. Ubuntu 13.04 to be precise. I blogged about the install process here, and my first thoughts after a week here, with the intention of regular posts whenever something goes really good or really bad.
So, it’s 14 months later, and basically things have gone pretty good. Sure, there’s some things that aren’t just how I like them with Windows, but other bits that just seem to work really well. In defence of my lax blogging, I’d just say that I got on and used the computer as I expected I would. I got tripped up a couple of times, but Google and AskUbuntu.com always seem to put me back on the right track.
I have expanded my Linux network too. I was donated an old netbook last year that now runs Ubuntu 13.04 for an hourly Twitter job. The plan had been to test it on the netbook then set up a Raspberry Pi to run it, but the netbook is surplus, capable, cheap to run and it works – so why change. I have also bought myself a little HP server which I put Ubuntu Server 13.10 on, along with OwnCloud. This works like DropBox, and synchronises files between my main PC, phone, tablet, work computer and is available to me (albeit slowly) anywhere on the internet.
All in all, things have been ticking over quite nicely. Life has been happy in Linux land… until recently!
I’ve been off work this week recovering from an operation. This has given me more spare time than I normally have, although it also limits how long I’ve been able to concentrate on things. I know that’s probably a bad combination, but, hey, lets go with what I’ve got!
So, a few days ago I thought it would be cool to “upgrade” to a retro looking terminal like this nice Swordfish90 one. Seems fairly straight forward, but I quickly came in to troubles when some of the required packages were unavailable or were untrusted. Lots of 404 errors. Oh well, just one of those things that looks easy on the internet but is actually more involved. Never mind, it would have been nice, but isn’t really required.
Later, I SSH’d on to the netbook and noticed that it said there were security updates to be applied and a new distro was available. I didn’t really want to upgrade the whole distro, but would feel happier knowing the security stuff has been applied. Sadly, I was unable to install the security patches as the same 404 errors were occurring. Ok, maybe it’s time to upgrade the distro then. This actually went very smoothly. “do-release-upgrade” quite happily took me from Ubuntu 13.04 to 13.10, and after a reboot, it tells me there is another new distro – 14.04 – that I can upgrade to. Yeah, well, in for a penny, in for a pound. I run that and all seems good.
Well, it seemed good. The hourly task was still running. For a while. A reboot got it going again. The following day I woke up to find that my broadband was down, so it had missed a few more of these tasks. Can’t blame the upgrade for that though. A restart got it back online, and in the last couple of days it has only missed a couple or so tasks – compared to missing none for the previous 4 months. Seems like too much of a coincidence, but I suspect there’s something in the upgrade that didn’t go too smoothly.
I guess the OwnCloud server should really be running the latest release of Ubuntu too, so last night I did a “do-release-upgrade” on that machine. This was already running 13.10 so only 1 upgrade was needed and this went really well. The only problem was that afterwards OwnCloud wasn’t running. Seeing how this is the whole raison d’etre for this machine this was a bit of an issue. It seems like the upgrade overwrote the Apache config files that tell it where the OwnCloud web pages are served from. Random poking about and looking at files made me appreciate just how little I understand about what makes this box tick. My data was still there though, so eventually I decided to download and install the latest release of OwnCloud. Something clever in it realised an older version was already installed, so it asked if I wanted to upgrade, I said yes, and suddenly everything works just as it did before! Hurrah!
So, this just leaves my desktop PC running Ubuntu 13.04. When I installed this last year it was the latest release and all was good. I could have installed an older version, 12.04, at the time which had come out a year earlier, but had Long Term Support (LTS). I didn’t appreciate the difference at the time between a LTS release and a non-LTS release, but this has been hammered home to me in the last couple of days. My version, 13.04, was released in April 2013 (see how the version numbers work now?), and had 9 months support. In October, another non-LTS release, 13.10 came out, which I should have upgraded to between October and January. Then, after the LTS release 14.04 came out, I would have had 2 months to upgrade to that. This page shows the Ubuntu releases quite nicely
But I didn’t. I have missed 2 upgrade cycles, and upgrading isn’t looking like a viable option for me right now. I certainly can’t run the upgrade online as all of the repositories are unavailable. I could download and burn myself a 13.10 DVD which I think will give me the upgrade option, and then do the same for 14.04 – However, with my experiences so far on the other 2 machines (which only have 1 task each), I worry about breaking 14 months worth of getting this computer to just the way I like it.
Probably the sensible option is to back up all my stuff and do a clean install to 14.04. Copy back all my data and reinstall all the programs I’ve got used to. But I know that adjusting to a “new” computer can be a slow and painful experience, and I doubt I’ll be able to find half the stuff again.
If I’m doing a complete reinstall, there’s a strong temptation to go back to Windows 7. Life seemed simple then, and I knew what I was doing.
Alternatively, I procrastinate, put off the inevitable, and carry on with 13.04. It works, and pretty much does what I want. Ok, I would like to add a pdf printer and a cool retro looking terminal program, but without the repositories being available that isn’t something I can do. Over time this is going to become more and more of a problem.
Hmmm… to be continued
14 August 2014
Every year people build amazing things and install them all over the site. Here’s a rundown of some of the projects coming to EMF this year.
Behind the bar you’ll find a robotic barman in the form of an ex-laboratory robot arm mounted on a mobility scooter. It’ll try and serve you drinks, but we can’t promise it won’t throw them at you instead.
A Tune On A Stick
Somewhere on-site you’ll find a lighthouse-like structure making strange noises. It plays a tune while spinning around - what it plays depends on who is nearby. Find some friends and try standing around it in a circle.
Giant Pixel Sign
A giant interactive sign made up of 900 RGB LEDS controllable from your web browser, lurking somewhere in the dark. Upload your own artwork, or your favourite gif!
Desperate for some Club Mate but don’t want to move? Call the Robobutler! He’ll trundle across the site and deliver you a tasty beverage, hopefully without destroying tents in his rush to do your bidding.
A large forest of radiant “trees”. As you move through the·grid it senses your presence and initiates a ripple of light & clicks, however it will be used in several ways - expect a multiplayer maze amongst other things!
Giant Ride-on Duck
The folks from Tog in Dublin have built a giant duck you can drive around. We don’t know why, but we want a go anyway. https://vine.co/v/M0rAKu2TllX
This giant arrow will spend all weekend tirelessly pointing at the current location of the International Space Station. Unfortunately there will be no visible ISS passes during EMF, so (time permitting) an interface is planned to allow pointing at other astronomical points of interest.
The buggy that almost self-destructed hauling things around EMF in 2012 has been repaired and is better than ever, with a new trailer for hauling your equipment around and a smattering of ridiculous addons. Internet-connected golf cart anyone?
Back by popular demand the retro gaming tent has ballooned in size! Expect to find full-size arcade cabinets, pinball, and every retro console you can think of.
Adding to our list of autonomous vehicles is BigHak, a giant ridable version of the Big Trak toy you may have had as a child. Either drive it manually, or program it Big Trak-style with the accompanying phone app - we have a prize for the first person to successfully program it to navigate to the bar from their tent!
Somewhere in the Nottinghack village you’ll find a two meter long automatic bar. Choose a drink from the menu, insert a glass at one end and get a cocktail down the other - even down to the tiny umbrella and slice of lemon. https://www.youtube.com/watch?v=5t8FkHKf_Bs
Balloons floating high above the site listen for noise and tell one another how loud it is. As the pings move between them they pulse with colour, lighting up colourfully in waves across the site.
In 2012 we had a giant hammock made from fishing nets - in 2014 we’ll have an even bigger one!
24 kites mounted on a long cable - once the wind gets up the arch takes off! As the weekend progresses they’ll be being decorated as an ongoing workshop.
The LHS Bikeshed
The LHS Bikeshed is a 3 player starship disaster simulator in a caravan. Players are trained to fly the ship and then given a short scenario that inevitably ends up with them being exploded, burned, suffocated or smeared across the surface of a planet. Find three friends and set off into the galaxy!
An amazing sea of fish that respond to touch. Individual fish light up and move, before spreading colour, light and motion through the entire SHOAL. The fish tell their friends what’s happening and a motor means all the fish can swim in the same direction, or turn to face someone who has come to play!
Pacman! On a Sphere!
A version of Pacman that is played on an actual real-world sphere. The pac-man player must run around the projected sphere trying to find all the pills, whilst up to another four players play the ghosts trying to hunt him down!
The Nuclear Poker Bunker
A half-size Hexayurt Quad Dome, within which people play Nuclear Poker, a card game designed to teach Generals too young to remember the Cold War about Mutually Assured Destruction.
A chance to sit out in the night air and quietly enjoy flickering images from the past. A small antique box contains a projector filled with silent films from Archive.org - sit, be calm, and watch films for as long as you like.
Two pedal power generators powering a small sound system, a bubble machine and LED lights in the evening. Get some exercise!
Hidden in the villages is a large umbrella adorned with meteorological equipment, generating a weather-related soundscape and light show for those standing underneath.
The Marvellous Booze Fogger
A device for the turning of alcoholic spirits into the most inhalable of mists, pleasing to the tongue and satisfying to the mind. A very certain panacea for the ills of the soul and a solution for those tired of the sorrows and trials of day to day living. It is most shiny: http://imgur.com/a/kWPU4
Are you bringing an amazing project to EMF this year? Let us know! firstname.lastname@example.org
So, um, I’m doing the Kinematocinegraph. I’ve done a lot of work on the recipes for Cocktail Barbot. And I’ve been there for the Marvellous Booze Fogger.
I’m not saying that EMF Camp is going to be awesome, but it is TOTALLY GOING TO BE AWESOME.
12 August 2014
I saw these HyperQBS from Geobender.com and thought they were very cool so I decided to make one. A 3D model was made, flattened using Pepakura and Laser cut for quick assembly, then it was glued and taped to turn it into a hexaflexagon thingy, I even wrote an instructable about it if you'd like to make your own.
11 August 2014
I’d love to be a history blogger, or even just an infrastructure blogger I’m endlessly interested in the story of Continue reading
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.
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.
Here is a post about what you can do in an afternoon or two with a whole load of electronics stuff lying around.
It is designed to fit in to those 150W halogen light holders and I had managed to find one of those as well.
I wanted to do something fun with it so decided to make a wirelessly controlled LED lamp which can be used to change the room ambiance, or to signify some form of data (anything from room temperature to number of emails to read).
10 August 2014
08 August 2014
Introduction For a Nottingham Hackspace project, I was asked if I could measure the RPM of a motor. “Sure!”, I said. What was really needed was quickly bodging together a beam-break circuit and connecting it to an oscilloscope. This would … Continue reading
06 August 2014
While the main body is a breeze to work out, the border has some slight editing problems, because the written instructions don’t match up with the charted instructions which don’t match up with the chart key. But once you figure it all out, it is awfully lovely.
I’m delighted with it, but I have some weird issues with giant loops appearing on the wrong side on occasion - I can only think that I need to sort out my tension something fierce.
BarBot passed a milestone today, making its first mix drink. I define this as fluids from more than one type of dispenser: optic and pressure tap system. Garnish dispensers were also used in the recipe, stirring and adding a delicious eraser and wooden lemon slice simulation disc.
As can be seen in the video, the firmware is being operated manually – individual commands like move to dispenser 6 [G8] and dispense from tap number 2 [MD2] are typed into a serial console and interpretted by the test firmware running on an Arduino Mega 2560. In the finished system such commands will be generated by a Raspberry Pi which runs the database / admin / ordering software and sent to the Arduino by serial.
Things are on track for an interesting public debut on the 16th August when we’re doing a fundraising event at Nottinghack (18:00 – 21:00). Money raised will go towards buying ingredients for EMF Camp where we plan to give away 200 cocktails for participants.
05 August 2014
Lasercut servo arms, now nearly all made up (still waiting for delivery of one more servo). Three of the servos are connected to the optics in this video.
04 August 2014
I was recently commissioned to make a large version of my photo frame tree, and this was indeed significantly larger. This tree features 8x 6"x4" photo frames and 1x 12"x8" photo frame The backing tree was 9mm thick and cut on the large laser cutter at Nottingham Hackspace (I can't wait till my new big laser arrives, currently docking in Felixstowe). The individual leaves were made from 1.5mm thick walnut. The custom engraving on the trunk features the customers initials and the date they met, the frame was made for their 5th (wooden) wedding anniversary
The whole tree measures 900m tall and 1000mm wide, which makes it the largest thing I've ever posted and boy didn't the post office love me that day.
I guess this is kind of a follow up to my Retro Challenge posts, as it was thoughts that stemmed from teaching myself Assembly Language for my Z80 project. Essentially it is a comparison between programming in the 70’s and today against building with Lego in the 70s and today.
But before I get stuck in, can you identify this famous TV family from a few crude Lego bricks?
Yes, it is, of course The Simpsons. And whilst I take issue at the range of colours used (two shades of blue? And green? We never had green Lego bricks when I was growing up. Now get off my lawn!), this simple representation and a little bit of imagination represents the cartoon family pretty well. Although in the early days there was more of a range of brick shapes and sizes, and even generic people, this could have been built back in the day – before The Simpsons was born.
Anyway, jump forward to 2014, and what does The Simpsons look like when modelled in the medium of Lego?
Yup, they’re all there in their yellowie goodness, complete with bulging eyes, shorts, skirt, tie, bouffont hair and dummy. Pretty hard to imagine they could be anyone else!
So, I see this as basically the difference between programming in assembly language and modern languages like .net or Java. I should, however, point out at this stage that I am not a programmer, and cannot program in .net or Java myself, although I do dabble a bit with the Arduino flavour of C++
The Z80 has very few instructions which can be summed up in couple of dozen 2 or 3 letter mnemonics, such as LD, RLR, JP or INC. My LED Matrix program only used 12 different mnemonics. So, consider this as your original Lego blocks. 2×4, 2×2, 6×1 or 4x8flat. With a very limited set of instructions or bricks, it was possible to make amazingly complex creations. However, if you used those brickstructions creatively, and used enough of them, it was possible to come up with amazing creations. Sure, the resolution was low, so you had to build your dragon really huge so you could see any detail, and maybe you had to rely a bit on the users imagination, but amazing things could be built. Such things as a single command to multiply by 5 wasn’t possible, and neither was curved bricks to build round structures.
During the 80ss and 90’s, computers got slicker and faster, and when I wrote my first program in 1982 I used BASIC, which compared to Assembly Language was pretty, well, basic! Likewise the Lego sets got better too, so my spaceships had radar dishes and control panels, and I wasn’t limited to just red, white, blue and yellow bricks (which, in hindsight, was awful spaceship colours!)
These days, if I want to build a Lego castle, I simply buy the Harry Potter set and build myself Hogwarts. If I want to get my Arduino to talk to a LED matrix, I call the LED matrix library and tell it want I want to say. I can build a spaceship that looks just like Millennium Falcon or I can call a Java script that fetches SQL data and draws it as a pretty pie chart in whatever colour theme I choose.
Now, I’m not saying that progress is a bad thing. I know that if I was still 12 years old and was offered an official Star Wars branded Lego X-Wing fighter to play with versus the Lego spaceships I built in 1983, I’m totally sure I would go with the one that actually included R2D2. Likewise, I am currently working on an Arduino and LCD project at work, so do you think I am crafting the code for this from one layer above 1’s and 0’s? Hell no, I’m calling a library, telling it the screen size and what text I want placed where. Job done.
80s command line display vs modern gui display
I do think it is important though to appreciate where things started though, and appreciate how far we have come. And, although the libraries are there for the complex and tedious jobs, and the kits are there to let you build the set from The Lego Movie, it is still possible to take things down to a much more fundamental level. With a bit of practice, hard work, some creativity and squinting a bit, you can still build whatever your imagination can dream up!
03 August 2014
In a lot of electronic audio circuits the response is controlled by a variable resistor rather than a control voltage (CV). If you want to adapt these circuits to use in a modular configuration then you often feel it would be nice to replace or augment the variable resistor with a control voltage input. In some cases this can be quite easy – the variable resistor might just be set up as a voltage divider between two DC levels and effectively the output of the wiper is a control voltage. However it is often the case that the variable resistor is actually manipulating a waveform inside the circuit. For example, in a lot of filter designs the resonance level works on a variable resistance controlling the amount of positive feedback from the output to the input and this isn’t easily replaced with a control voltage.
I recently got this question from the web:
I want to add external CV [control voltage] control to an existing circuit. It’s to control the resonance of a filter where there’s already a pot to do this manually. My first idea was to use a vactrol and run the resistance from that in sequence with the pot with the pot then acting as an offset whenever there’s CV applied. However there’s a few things I’m struggling with.
1) It’s always only going to be a positive offset, even if you feed a bipolar signal to the CV, being that the vactrol can’t output negative resistance
2) What’s the strategy for managing current limits going to the vactrol? I’m familiar with *reducing* current via resistance but what if you don’t actually know what the current is going to be? How do you bring it within a usable range?
3) The big question: is this the best way to achieve the original aim? Any other suggestions?
This question nicely captures the classic problems in this situation – there isn’t an easy general purpose way of changing a control voltage in to a variable resistance. The simplest approach, as suggested here, is to use a vactrol. For those not familiar with the term a vactrol is a light pointing at a light dependent resistor in a sealed unit. By connecting the control voltage to the light you generate a variable resistance that depends on the control voltage while keeping the control voltage electrically isolated from the resistance.
Vactrols are easy to use but have lots of limitations – they don’t have a well defined relationship between the CV and the resistance and the range of resistance values achieved may not match what you want in your application. Generally they also have quite slow response. There isn’t much you can do about these limitations. Some kind of preprocessing of the CV might help set the range of resistances achieved to better meet your needs. You will also want to introduce the light dependent resistor in to the circuit with some kind of additional adjustment (perhaps the existing control) to set the control-point it is working around. For example, to get a bipolar response (Q1 above) you can add a DC offset to the CV so that the bipolar signal becomes an alternating positive signal and then set the adjusting resistor to position the range of the output to be that you are interested in. You can try putting the vactrol in series with the adjusting resistor instead of in parallel.
As far as I know most vactrols will go down close to 0 Ohms resistance when the controlling light is fully-on. This gives you the lower bound for the resistance, and hence upper bound for the in-circuit current. As just about all variable resistors also go to 0 Ohms you can pretty much add a vactrol in series or parallel with an existing variable resistor from the point of view of the minimum resistance (Q2). If you don’t want the vactrol to drop to 0 Ohms put a resistor in series with it, or manipulate the CV to limit how large the signal feeding the vactrol’s lamp gets.
As for Q3 – no, sorry there isn’t a general way of replacing resistance-driven circuits with CVs. There are various circuits that are called voltage-to-resistance converters (eg see the LM13700 datasheet) but in reality these have complicated limitations on how they can be used and don’t fully isolate the CV from the rest of the circuit. Unless you know a lot about how the circuit you are modifying works and fully understand the limitations it is hard to retrospectively introduce these in to an existing design that uses a mechanical variable resistor. If you *really* want a solution you could have a servo-motor turning a mechanical variable resistor – I can remember a few hi-fi buff friendly amps that used this approach.
Normally though the best you can do is to experiment with different ways of using a vactrol and learn to love their limitations. Any technical defects are called “character” and in classic audio equipment people pay good money for them!
Testing the platform and new control box… in the dark… because it’s pretty.
02 August 2014
It's inevitable when you're working with wood that a few of the sheets are going to end up warped. I thought I would share a few of my tips for working with slightly warped wood while still getting good cuts from the laser. Magnets.
This is it really, magnets are the key to success, plonk them down all over the work piece and that will hold the wood flat while you cut. The magnets cling to the honeycomb underneath and a decent stack of neodymiums can pull 9mm sheets back onto the table.
When the wood is bowed, arrange it so that the centre of the wood is lifted off the table. Magnets placed right in the middle of the bow will pull it flat to the honeycomb. When placed the other way up you have to balance the magnets on either side of the work piece and you can get a 'see saw' effect if the bow is too severe.
The trick to placing magnets in the middle of the work is figuring out where to put them so that they aren't cut by the laser. My trick for this is to draw a few circles on the wood right at the very start of the process, pause the machine, then move the magnets onto the circles. This way you know that the magnets will not be under the laser beam at any point.
01 August 2014
31 July 2014
Here we see some photos of BarBot assembled with the various dispensers in place. The [mono]rail for the platform has been attached, and the platform [monorail car?] has been powered up to show the pretty lights.
There’s still a huge amount to do to get it working, but seeing everything in place really makes it feel real. This coming weekend the team plan to do some serious hacking to mount the dispensers, arrange wiring and such. With a bit of luck we’ll have a functional BarBot for the fundraiser party in the 16th of August (6-9pm at Nottinghack).
Wow! What an awesome month July has been. The whole Retro Challenge thing has been great, and despite moments of stress or despair, I have thoroughly enjoyed taking part and seeing what everyone else has been up to. Before I sum up my project, I should make a few honourable mentions.
Retro Challenge – A huge thanks to Mark and Wgoodf do a great job in hosting this twice a year. Keeping everyone updated via Twitter has worked really well. Cheers guys!
Grant Searle is responsible for the general Z80 design I used and also converted MS BASIC from the Nascom to run on this. Really, this project is a test of my understanding of Grants work and seeing how far I can take things.
Nottingham Hackspace has an amazing “parts bin” that included the LEDs, Veroboard, case, some of the logic chips and the RAM I used.
OSHPark did a great job (for a very good price!) on the PCBs – even if the postal system did keep me on the edge of my seat for a bit!
Chris Gammell introductions to KiCad PCB design videos were critical in guiding me through the various stages of board design.
Rodney Zaks book Programming the Z80 has been like a bible for me. Combined with a few dozen other resources of Z80 info on line I’ve been able to at least get the basics assembly language programming.
CLRHome is a great online Z80 IDE that can compile assembly language in a variety of output formats including for the ZX Spectrum. I doubt I could have managed this in notepad!
All of the other Retro Challenge entrants deserve a mention too, but there’s a few that really caught my eye and taught me stuff about their particular approach to RC2014, such as Wgoodf – Turtles all the way down, Ians restoration of Northstar Horizon, Tezzas restoration and programming of Challenger 4P, John finishing work on Fahrfall
I have shared the PCB design files on OSHPark, so if you want to build your own Z80 computer but don’t want to get involved in the PCB design side, you just need to click Add To Cart and the boards will pop through your letterbox soon. I think all the component info and other details you need are there, but if you do decide to build your own, please let me know. I’d love to see other people using the RC2014!
I cannot get my head around Github, so, for now, the design files and source code are not up there. If I can get Github to do what I expect it to do any time soon I’ll upload the files. In the mean time though, I am going to print the schematics, BOMs and PCB layouts as pdf files for those of you that want to take a look. Feel free to drop me a line if you want the actual KiCad files or if there’s anything I can help you with.
As for the Z80 assembler code, here’s an abridged version (The full ASCII stuff was posted here a couple of weeks ago, and makes for a very long tedious lising!). As I have said before, I am not a programmer, so I know that this is not pretty code. It is not efficient code. It is not easy to read code. It does, however, do what I needed it to do, so that’s fine by me :-)
#define DECODED $9000 #define DEC2 $9001 #define DEC3 $9002 #define DEC4 $9003 #define DEC5 $9004 #define WRKSPC $8045 .org $0000 NOP NOP di ;disable intrupts. NOP NOP NOP ld hl,WRKSPC ld sp,hl ;set stack pointer to 0x8045 ;clear led matrix ld a,255 out (0),a ld a,0 out (1),a out (2),a out (3),a out (4),a out (5),a ld a,49 out (129),a ;Fill display memory - 1st character ld b,0 ld c,8 ld ix,STRING ld a,(ix+0) sub 32 ld hl,0 ld l,a add hl,hl ;2 x string(b) add hl,hl ;4 x string(b) add hl,hl ;8 x string(b) ld de,ASCII add hl,de ; hl now points to ASCII +( 8 x (STRING+b)) ld de,DECODED Loops80: ld a,(hl) ;load A with line from ASCII ld (de),a ;DECODED now contains line of stuff inc de inc de inc de inc de inc de ;added 5 to DECODED address inc hl ;increment to next line of ASCII dec c jp nz,Loops80 ; repeat for next 7 lines ;This bit of code is copied & pasted 5 times for each character, but with an incrementing "ld a,(ix+0) and the loops80: For brevity I've omitted them here ;5th character ld c,8 ld ix,STRING ld a,(ix+4) sub 32 ld hl,0 ld l,a add hl,hl ;2 x string(b) add hl,hl ;4 x string(b) add hl,hl ;8 x string(b) ld de,ASCII add hl,de ; hl now points to ASCII + 8 x (STRING+b) ld de,DEC5 Loops84: ld a,(hl) ld (de),a ;decoded now contains line of stuff inc de inc de inc de inc de inc de ;added 5 to decode address inc hl dec c jp nz,Loops84 ;Main Loop START: ld hl,DECODED ld a,127 ;start x with $01111111 ld b,8 ROWLOOP: out (0),a ld c,5 COLLOOP: ld d,(hl) out (c),d inc hl dec c jp nz,COLLOOP ;repeat this loop 5 times call DELAY rrca ;move to next row <<10111111<<<11011111<<etc dec b jp nz,ROWLOOP ;repeat this loop 8 times jp START DELAY: push hl ;save hl and af registers push af ld hl,1000 DELLOOP: dec l jp nz,DELLOOP ;countdown l from 255 to 0 dec h jp nz,DELLOOP ;countdown h from 16 to 0 ;clear led matrix ld a,255 out (0),a ld a,0 out (1),a out (2),a out (3),a out (4),a out (5),a pop af ;restore hl and af registers pop hl ret STRING: .db "SOwen" ;this is the text to be displayed ASCII: ;these ascii characters were taken from ZX Spectrum ROM ; $20 - Character: ' ' CHR$(32) .defb %00000000 .defb %00000000 ;See previous post for full ascii listing
Thanks to everyone that has been keeping up with this project and encouraging me along the way. There’s still a lot that I want to do with the RC2014 computer, but I’m sure a lot of that can wait until the Winter Challenge!
30 July 2014
With over 24 hours to go before the end of July deadline the final piece of the puzzle fell in to place!
But, first, a quick catchup from the last blog post;
On Sunday I successfully burned BASIC to a couple of 8k slots on a 64k EEPROM, and that worked great. So, on Monday, I figured there was no more putting it off, I had to finish my Assembler Code program and give it a go. So, I removed the Spectrum specific bits that I’d used to debug it, added bits specific to my hardware and wrote the actual display code loop. Then burned it to the EEPROM, held my breath and plugged it in….
This left me with a dilemma. Apart from the LED matrix, how could I debug code on a Z80 that had no form of input or output? Then I realised the serial port must have an address. So I hunted through the source code and found stuff being sent to port 0x81 (129). So I added a few OUT (129),a commands and tried again. Nope. Still nothing. Ahhh… I hadn’t initialised the stack pointer. Ok, do that and try again… No. Still nothing. Check BASIC still works. Yup, that’s fine. My code? No, nothing.
Then I swapped between BASIC and my code with the jumpers without turning it off. After hitting reset the serial port spewed out a load of .Owen# all over the screen! So, my code was doing something.
Finally today I noticed a huge glaring mistake. I was JUMPing out of the main loop to a delay subroutine when I should have CALLed it. Doh! I made the change, burned the code to EPROM, fired it up and… BINGO! It worked!
Well, it was mirrored, but otherwise it worked! My name was written in LEDs being driven by a Z80 based computer I built myself from scratch running my own code written in Assembly Language. That, I believe, is challenge complete!
Well, almost complete. Tomorrow I will write a closing blog, as well as publish the code, schematics, PCB layouts on GitHub and share the PCB files on OSHPark so that everyone else can play along at home.