Hardware Hacking - An Introduction Via Dev' Boards

by Sarlacii

I favor hardware over software when it comes to hacking.

In the commercial world of design engineering, this is often while trying to find a solution to a problem.  For PJs (private jobs - anything not work-related, really), it may be hacking in a more 2600 sense.  Of course, nowadays it is vital that any engineer understand how to work with software and firmware too, but you can still favor one over the other!

Software hacking appeals straight-up though, as the development interface is so familiar to all of us (PC users).  The tools are also readily at hand - available for download, with examples and tutorials that you can use immediately.  It's also easy to experiment, as failure is a compilation error.

Hardware is that incremental step removed.  You need physical components, small hand-tools, a soldering iron, and multimeter, perhaps.  You will also need to learn some electrical theory... how the resistors, capacitors, inductors, and transistors, etc. all interact.  It may seem that software hacking is easier.  Initially, at least.  And only if you remain a script kiddie.  Digging a bit deeper, you will soon realize that both fields are equally complicated.  But, each also makes use of "building blocks" to simplify the program or circuit.  They can be "black boxes," too - where you have no knowledge of the inner workings, only the boundary conditions and input/output functions.  Serial.println() meets USB-to-serial converter.

So, what are the avenues open to an aspiring hardware hacker?  Two routes present themselves initially, one being the first principles approach, whereby you check out a copy of The Art of Electronics1 or similar text, from your local library.  The second involves a more appealing cocktail of software and hardware, facilitated via a suitable development board, or "dev' board."  The second route is proving to be very popular, for obvious reasons, but it is interesting to note that it is an option that has only really opened up in the last few years.

In general, the difference between a processor and a microcontroller (µC) lies in the architecture of the system.[2]  A processor (as in Central Processing Unit - CPU) is not useful by itself.  It needs peripherals, like those found on a computer motherboard, to provide, for example, memory access and interfacing (PCI, USB, HDD, etc.).  A processor-driven system also requires an Operating System (OS) in order to run, to manage the complex interaction of parts.  A µC, on the other hand, has many (or all) these parts on board the IC, making it a single chip solution.  All that is required is a PCB, and perhaps some additional interfacing or I/O protection, to get a functioning solution to a problem.  As such, a µC-driven system may run an OS, but may also be programmed by a single user, with only a few lines of C code required to get a "hello world."  A PC is far more powerful, but also expensive, power-hungry, and bigger in size.  PCs are complete overkill for small "embedded" tasks, like running a TV, microwave, or cell phone.  A small, cheap microcontroller is the solution in these cases... and, as such, these ICs are literally everywhere in our world.

Strictly speaking, single-board microcontrollers have been around since the 1970s[3].  However, they were difficult to work with, requiring specialized tools in the form of expensive assemblers, compilers, programmers, and debuggers.  Also, before the advent of Electrically Erasable Programmable Read-Only Memory (EEPROM) in 1993, and flash RAM thereafter, non-volatile memory was only available in EPROM form, and this meant ultraviolet (UV) erasers and laborious debugging when it came to testing code (if you didn't own an expensive emulator tool).

Early on in the new millennium, however, the ubiquitous nature of the microcontroller, and the myriad versions available from silicon manufacturers (Renesas, TI, Philips, National, Motorola, etc., to name but a few) led to stiff competition for customers.  Out of this came the idea for simple, ready-to-use, dev' boards, and a tool chain that is free to use (below a certain EEPROM or flash RAM size!).  This move came about in an effort to make adoption of a particular µC line - by commercial design engineers - even more appealing, as the cost and labor involved in prototyping a new design was reduced.  Since this process of launching a new design is constantly streamlined by manufacturers, it has led to ever more intuitive IDEs, excellent software libraries and resources, and a wide range of hardware development tools.

The various embedded options available in each µC has grown exponentially too (with different versions forming a complex product "roadmap"), so that it is now possible to source microcontrollers with everything from embedded TCP/IP stacks and USB hosts to PWM motor control and accelerometers.  And, in many cases the various IC versions are pin-for-pin compatible, with the same code requirements too.  This makes it very easy to chop and change between closely related types.

The end result has been the wide scale adoption of the µC "dev' board" concept by the hacking community at large, in the form of projects like BeagleBoard, Arduino, Mbed Microcontrollers, and Raspberry Pi (if we count a System on Chip (SoC) device as a type of µC), etc. [4-7]  These projects have huge community followings, with user-contributed hardware and software solutions, as well as a plethora of forum/wiki advice.  The coding tools are reasonably straightforward, with example programs or images ready to install and run.  Black-box add-on PCBs make expansion from the initial dev' board very easy too.  Need an Ethernet controller for your Arduino?  Just buy an Ethernet Shield.  The libraries for coding with the shield already exist, so all you have to do is plug it in and use it.

All of the usual suspects (RS, Farnell, RadioShack, Sparkfun, Mobicon, Netram, etc., etc.) will stock one or more of the most popular types, while the original manufacturer will often provide an online store too.  As such, getting hold of a particular dev' board, ready to go, is very simple... and thus appealing.

Pretty soon, though, you might find yourself moving beyond the microcontroller, past the pins, and into the digital and analog components on the rest of the PCB.  At that point, you might consider a few mods of your own, to suit the task at hand, and thus begin hardware hacking in earnest.

Resources

  1. P. Horowitz and W. Hill, The Art of Electronics, 3rd ed., 2015
  2. J. F. Wakerly, Microcomputer Architecture and Programming, Wiley, 1989
  3. Werhner, MOS Technology 6502, Wikipedia
  4. BeagleBoard.org
  5. Arduino - Home
  6. Mbed Microcontrollers - Handbook
  7. Teach, Learn, and Make with the Raspberry Pi Foundation
Return to $2600 Index