My blog has moved to https://coffeeturtle1.github.io/my-blog/.
I haven’t posted in a while because I have been so busy with little projects, anyway, this particular project has got me very exited – my mechanical keyboard. This post will document my progress.
The parts I used to make the mechanical keyboard:
Altogether this keyboard cost about £80 to build.
My first step, the easiest step, was to place all the switches into the key plate and this took me about 10 minutes. Here is a picture of all the keys in the plate:
Next was hardest part, placing the keys into the the PCB. This took a lot longer than I expected because it was difficult to line the keys up in a uniform way. Here is a picture of the key switches in the PCB. The key caps are there for lining up purposes.
Once I had placed the keys in the PCB I could start soldering. It took a lot less time than I thought it would (altogether it took about 30 minutes to finish soldering). Then finally I screwed the keyboard into its case and tested it. It worked first try!
Here are some pictures showing the final result:
Thanks for reading! Hopefully next time it will be another post about my 4-bit CPU!
Hi, for the past couple of days I have been working on a design for an 8-bit CPU (LPU-1). To design it I used Logisim, a great free logic simulation program. I’m doing this as a stop gap whilst waiting for components to arrive from China for my 4-bit TTL CPU.
LPU-1 has 3 general purpose registers – A, B and an accumulator – which is a rather limited amount of registers by usual standards. It also has a carry register, 2 64KB RAMs (one program memory and one data memory) and 11 instructions. It doesn’t have a central bus but I probably should have put one in because it is more convenient. On LPU-1 I/O is handled by the accumulator.
Here is a Picture of the Logisim design file that I created. Download the open-source here:
The instruction set :
- ADD – Adds register A to register B and stores the result in the Accumulator
- SUB – Subtracts the contents of register B from register A and stores the result in the Accumulator
- PUT [REGISTER], X – Puts the value X in [REGISTER]
- JMP X – Jumps to location X
- JEZ X – Jumps to location X if register A’s contents is equal to 0
- JNC X – Jumps to location X if the carry register is not 1
- MOV [REGISTER], [REGISTER2] – Puts the value held in [REGISTER2] into [REGISTER]
- LDA – Loads the value from an address held in register A into the Accumulator
- STA – Stores the value held ine the Accumulator into an address held in register A
- AA – Moves the value held in the Accumulator to register A
- HLT – Stops the clock
Here is a video showing LPU-1 running a Fibonacci sequence program:
I tried to write an assembler in Golang but it was poorly written and wasn’t working properly. I might attempt to do this again some time.
I plan to make a better version of LPU-1 soon (maybe even LPU-2!) with many more registers, a central bus, 1 RAM instead of 2 and an updated instruction set.
Thanks for reading, please feel free to make any comments or constructive suggestions that will help me with my CPU progress!
Haven’t posted for a while, here is what has happened since the last post:
So, I decided that it would be best to make the ALU on a single PCB as it would take up less space. I set about ordering more PCB’s. This time I purchased them from a company in China called allpcb.com. They came within 3 days from the date of order and they only cost £13 for 5 (bargain!).
Here is a picture of them on arrival:
Next I soldered the components to the PCB. It took me two hours to solder the parts on but by the time I had finished my soldering speed and accuracy had vastly improved.
Having finished soldering the components to the board, I set it aside for a few weeks whilst I concentrated on my other projects (I am making some synthesizers :D).
Today I returned from a raspberry jam, newly inspired to continue with my CPU. It was late, I was rushing and a little over keen to get on with it…
… and this happened!
Whoops… next time I must remember to remove the tinfoil when I apply 5 volts to my circuit (I really don’t like this smell and it is making me feel a little sad inside). Thankfully none of my chips were destroyed in the process but now I need to spend another few hours de-soldering and reassembling the components onto another PCB.
Today, I have learnt a lot!
Hello, so, the PCB’s I ordered have arrived today. They cost about £5, they took about two weeks to come from https://www.oshpark.com.
Here is a picture:
I wish I had ordered them on a single board because it would have been much cheaper and also they are a lot smaller than I expected.
I plan to solder them later.
I am getting some 64KB RAM chips later today.
So, a couple of days ago I set to work soldering together a 4-bit “AND” module thing for the ALU… it took me a very long time (I am terrible at soldering).
Here are some pictures documenting my (slow) progress:
Next I decided it would be better to order some PCB’s, so I booted up my computer and googled PCB design. After a brief search I came across a program called KiCad (link: http://kicad-pcb.org/) and I downloaded it. With the help of some YouTube tutorials I got to work learning how to use it and came up with my first schematic for a PCB (A bus control module):
I then redesigned it as a PCB:
Here is a 3D view of the same PCB:
Lastly I designed one more PCB (The AND/OR/XOR Module). Here is my schematic designed using the opensource program KiCad (link: http://kicad-pcb.org/).
This is kind of embarrassing but I eventually figured out how to get more RAM for the CPU by making the program counter 8-bits and making the instruction register 12-bits so that there is room for addressing 8-bits of RAM.
Thanks for reading. Stay tuned for more updates!
This is the part where I should probably introduce myself and tell you a little bit about what I am trying to achieve, so…
My name is Joe and I am a home educated twelve-year-old from the UK, I am currently working on a 4-bit CPU project.
Here is a picture of me:
What I am trying to achieve
Being an inquisitive sort of guy, I was compelled to find out about the process of designing a CPU. What better way to do that than actually building one yourself! So after spending days researching on the internet and applying previous knowledge I gained from a computer architecture book, I set to work ordering my components (7400 series IC chip’s and a TON of wire).
The plan is to build a 4-bit CPU that will have a 16 bytes of ram, around 10 instructions and five registers (two general-purpose registers and one accumulator, a program counter and an instruction register).
What I have made so far
So, this is a picture of a bread board prototype for a 4-bit ALU. It has six commands OR, AND, XOR, NOT, ADD and SUBTRACT.
The components used to build the ALU:
- DIP switch
- Coloured LEDs
- Lots of wire
Next I need to transfer my breadboard prototype for an ALU onto some stripboard and then I can move on to building the RAM and the registers and finally build a control unit.
Thanks for reading I’d really like to hear any comments, questions or suggestions you may have.