Tuesday, December 15, 2015

Basic Electronics - and a dream to make an open source processor?

Recently, I have picked up an interest in Electronic Circuits I guess.

It all started with the Raspberry Pi. Recently I came across the Raspberry Pi frequently enough that I decided to look into it. When I realized what it is, I pretty promptly picked this kit up off of Amazon:
http://www.amazon.com/gp/product/B00PWYK2V6

 The Raspberry Pi 2 is pretty awesome, I must say. The first day or two was spent trying the standard Raspbian distro, Risc OS, the media center packages, and even a port of Android to Raspberry Pi. Recently I moved to using Ubuntu MATE on the Pi.

Anyhow, the important thing is, the Raspberry Pi has GPIO ports, and there is something about making an LED light up using a C-program that rekindles your inner childhood curiosity and the desire to experiment more. Also, the idea behind the Pi - that kids these days don't anymore have that kind of programming skills they used to in the past, nor the ability to experiment and learn, and instead spend most of their time with prepackaged learning modules and little with do-it-yourself stuff - stuck a lot with me, because this is something I had realized personally even before I ever heard of the Pi.

Consequence of all of that? For one, I resurrected my mini-project from undergraduate days, which is a simulation of a 5-stage pipeline of the MIPS R2000 microprocessor, done in C++ using POSIX threads, and including an assembler and basic terminal emulation capabilities. I fixed all the bugs that have accrued due to changes to the C++ language, and finally put it up on Github under the GNU General Public License - my first contribution to the world of Open Source Software :) You can find it here: https://github.com/varghese85/coconut

However, this is only the first step into a vision. The full vision is to make this processor in real hardware as maybe even an open-source kit. Stage 1 will be an implementation without any pipe-lining, and  stage 2 will include the pipeline. I could potentially use some Arduino chips (although it's ironic in using a more powerful micro-controller to assist a less powerful processor) to do bootloading and terminal server; or maybe use USB to bring the terminal output back into another computer. We'll see.

The real roadblock to all of this is that I don't know enough electronics. So recently I found two books:
(1.1) Make: Electronics (Learning by discovery) - 1st edition (http://www.amazon.com/gp/product/0596153740)
(1.2) Make: More Electronics: Journey deep into the world of Logic Chips, Amplifiers, Sensors and Randomicity (http://www.amazon.com/gp/product/1449344046)
(2) Practical Electronics for Inventors (http://www.amazon.com/gp/product/0071771336)
The "Make" series books even have companion kits available:
(1) Component pack 1: http://www.amazon.com/gp/product/B00T0UCLIK
(2) Component pack 2: http://www.amazon.com/gp/product/B00T0UCLF8

Maybe I can use these to learn enough electronics to design the processor :)

PS: While working on the book on the experiment 10 on transistors, I tried out something I've always known possible, but never tested before. Basically in the below picture, I am using a 1.5 V battery output across the Base-Emitter of the 2N2222 transistor to switch a 12 V DC supply from a universal wall adapter across the Collector-Emitter powering the LED.
 And here's the schematic of the circuit.
PS: the parallel and series arrangements of 330 Ohm resistors are because 330 Ohms was the only value I had in hand. Also note that I missed including the LED between the parallel pair of 330 Ohm resistors and the collector lead of the transistor.
.

No comments:

Post a Comment