Posts

Showing posts from 2012

The toolchain

Now we have necessary hardware, but still the only thing we can do is to login into the RasPi in a slightly different way. Now we need some software tools to convert our program sources into binaries for RasPi. I'm aware that there are some instructions floating around on how to acquire a toolchain more quickly, but I think the most correct way is to build one ourselves.  Since I'm using Debian as my primary desktop operating system for years, I'll provide instructions for it, but the same principle should be valid for any Linux-based OS. Tip for Windows users: you can run Linux inside VirtualBox. First thing we have to ensure that our host system has all the necessary tools. Open your terminal and run: sudo apt-get install build-essential wget Note that, instead of using sudo , you could also log in as root and execute the commands without it. In this tutorial I'll however prepend sudo to every command that requires elevated privileges. It should either ...

Building a serial add-on board (part 3)

Image
In Part 2 we etched a PCB. But our add-on board is not quite finished, there are still things left to do. Well, let's get to work. First thing to do - we need to drill holes for board's components. I'll use Dremel-like tool with 0.7 or 0.8 mm drill bits. As for surface, I'll use old chair, that I'm not afraid to ruin (even more). You may think of something else, but remember that while drilling holes in PCB you almost certainly will make some in surface below it. If you never did this before, it would be a good idea to practice a little on a piece of scrap FR-4. Also having few spare drill bits at hand wouldn't hurt. You never know when those tiny things break. Note also that dust from drilling is still as hazardous as in Part 2, so again I'm doing this outside. Done. There's however a manufacturing hiccup now. Mechanical pressure and vibrations from drilling proved to be too much for unconnected pads for 26-pin connector and almost all of...

Building a serial add-on board (part 2)

Image
In Part 1 we discussed why we need a serial add-on board and designed one. Now it's time to actually build one. Of course we will require some tools, materials, and chemicals, I'll describe them along the way. First and foremost, we need a material for PCB. I'll use 1-sided FR-4 epoxy laminate. I've been lucky to acquire an enormous piece (1/2 sqm. or so) in a garage sale. But it should be available at most DIY electronics stores. As I mentioned earlier, we will require a piece with size 40 x 45 mm. Draw the borders and cut it off with a hacksaw. Do not worry, if you can not quite follow the line and your cuts are not very straight. You will be able to trim it to right dimensions using a file. Smooth any sharp edges as well, while you're at it. Note, that dust from sawing and filing FR-4 might be hazardous, so I'm doing this outside. Now it's time to clean it. I'll use a kitchen sponge with a bit of laundry detergent on it. Rub i...

Building a serial add-on board (part 1)

Image
Writing code is not everything. No program is good until it can display it's results in some way. With regular programs it is easy - you just print something and it magically appears on screen or somewhere. Bare-metal programming is different. There is no underlying operating system to handle that "magic" and we have to make it happen on our own. And it better be simple, remember, we are practically blind-folded at this point. Trying to send something over network or display on the screen is too complicated, it would never work, since there are too many things to go wrong. There's another simple interface - we could try to blink a LED on RasPi. And then send out our messages using say, Morse code. But that doesn't look too appealing either. Fortunately, RasPi have another simple interface, called UART. Using that we can send anything we want to computer's serial port (or emulated serial port, if computer has no physical ones). But there's a catch. We ...

Acquired a Raspberry Pi. Now what?

I will not go into lengths to explain what a Raspberry Pi is. If you are reading this, most likely you already know. When it finally arrived, I prepared a SD card with OS image, connected the wires and booted it up. Cool, it works! But now what? Here I probably should explain my background a little. I've been everyday Linux user for years. Incidentally I also run Debian on my desktop, so Raspberry Pi running the same OS, albeit on different architecture does not offer too much to explore. Of course, I could choose a different Linux distro for RasPi, but there are only minor differences between them. Also I pretty much know, how to write code. Programming has been my hobby and day-job for even longer. Obviously I need not to learn how to program. But I'm also interested in custom OS development and microcontroller-based DIY electronics. And Raspberry Pi offers a pretty broad field to explore at this level. Yes, that was the reason I ordered one in the first place. ...