

Ask HN: Embedded Systems? - razerbeans

I recently discovered a book called "Embedded C" by Michael J. Pont which is somewhat dated, but I was interested in learning more about embedded systems.<p>Does anyone have any suggestions as to where I could start if I have absolutely no experience in this area? And what chipset should I start with?
======
ax0n
A startup I worked for in 2006 was ostensibly building embedded systems for
their server farm. Granted: We were talking about x86 boxes, but they would
boot from 32MB of flash. Hundreds of them, we built. In our case, we were
running a custom-packaged version of OpenBSD.

A few suggestions: Play with small, embeddable OSes on commodity hardware:
uCLinux or even TinyCore/PuppyLinux, make a tiny BSD derivative to start out
with.

Mostly, the startup was using 1U Rackmount servers that booted from USB
"thumb" drives, but we also built a few bookPCs for other purposes. Our
SMS/TXT Gateway systems were using Soekris Engineering systems. Those are neat
(if pricey) x86 "Embedded" systems. And they're very well executed and great
for taking the next step into tinkering with Embedded systems. Someone
mentioned Beagleboard as well. I haven't ever used one, but some folks in the
hackerspace nearby have been tinkering with them a lot, and that also seems
like a good way to go, and more cost effective than Soekris stuff.

Pick up some Fonera routers or old wrt54g stuff to play with. Most of these
are MIPS or Atheros System-on-chip.

Another one of my favorites is old HP Jornada clamshells. They run WinCE by
default on ARMv4x hardware, but you can get a bootloader that you can run from
Compact Flash which will load a smallish Linux distro up. <http://jlime.com/>
\- for example.

Once you're more comfortable with using the embedded operating systems, you
can figure out how to cross-compile for these platforms. You will rarely write
code and compile it directly on the target environment. From there, you've
pretty much got it figured out.

As cperciva said, everything from Mr. Coffee and your TV, to your car and
modern oscilloscopes are powered by embedded systems. Many of these run
proprietary firmware on common microcontrollers, so they don't really have an
operating system as such. I'd recommend getting into microcontroller
programming next. Or, heck, get into microcontroller programming while messing
with some of the easier and higher-level embedded toys. I'd start with the
Arduino or Propeller platform. Both are great for learning the ropes.

------
cperciva
What sort of embedded systems are you interested in? There are "embedded
systems" which consist of standard server hardware with some preinstalled
software (aka. "server appliances"); there are "embedded systems" which
consist of low power boards running general purpose operating systems (e.g.,
cheap home routers); there are "embedded systems" which run specialized
operating systems (e.g., the Martian rovers, running a commercially-available
RTOS); and there are "embedded systems" which don't run what you'd recognize
as an OS at all (e.g., your car, your TV, my blood glucose tester, etc).

~~~
razerbeans
Right now I'm more interested in just getting started, so whatever would have
a smaller learning curve in the beginning. I have had experience with
installing custom firmware on home routers (dd-wrt) and that was what
initially piqued my interest.

~~~
fragmede
The key question to me is 'how embedded'? On smaller embedded microcontrollers
there is a 'main' with "for(;;)", and you have to manually schedule various
tasks. Arduino makes it very easy to get started with this level of embedded.

However, if you're after incremental steps on top of dd-wrt, set up a cross-
compile toolchain for arm and start by just rebuilding the dd-wrt firmware
you've already flashed. After you get that, make a "hello world" for the home
router that blinks a light and outputs via serial. It'll give you a good feel
for certain aspects of embedded development.

Have you tried to add USB to a home router? Certain models of router make this
a relatively doable task, and there is usually at least a minimal bit of help
(over doing it from scratch yourself), but you may already have most of the
hardware to do it, possibly making it easier to start on.

------
follower
I'd also recommend taking a look at the Arduino (<http://arduino.cc/>).

The main reasons I got started with it is that you can start learning "at the
top" with the "Arduino language" (really a C/C++ subset with some pre-
processing) and you don't have to re-start from scratch as you make your way
as far down as bare-assembly level (if you really want to go down that far)
because the underlying tool chain (gcc) is the same (and also, open
source/free software if that's important to you).

Because the project has aimed at non-technical users from the start the forums
are very friendly to people just starting out.

If at some point you want to get away from the higher level interface the
Arduino environment provides, you can keep using all the same hardware so you
don't have to throw away your hardware investment.

You also have a choice in expenditure, from the official boards through the
lower-priced "clones", then the non-USB runtime boards to the bare chip on a
breadboard.

The Arduino environment doesn't have integrated debugging outside of serial
console and LEDs but in general that's not too much of a hindrance--if you
really want it you can look at some of the other tools for the AVR chips.

There's plenty of third-party library support for attaching different
devices/sensors.

Once you reach the limit of what you can do with an Arduino you can look at
some of the other chips in the AVR family or some of the semi-compatible ARM-
based boards.

------
macemoneta
Head over to <http://makezine.com/> for lots of projects to get started. Many
are based on the Arduino, which you can pick up for under $30 USD:

<http://www.makershed.com/SearchResults.asp?Cat=43>

It's probably the easiest and lowest cost way to get your hands dirty.

------
brk
If you are comfortable with C, I would recommend you look at PICs mostly.

The BAISC Stamp series, or the Arduino's are too get started with as well, but
they may be too simplistic and the core of the chip is too removed from direct
access to really be "fun" if you want to explore true embedded systems (IMO).

The PIC has many variants and has been popular for a long time. So, you can
find lots of good references online for interfacing to Ethernet chipsets, GPS
chips, gyros, etc.

You would probably want to also pick up a "EE 101" type book. To do anything
of purpose with an embedded system you generally end up interfacing to
external hardware. So, the likes of pullup and pulldown resistors,
transistors, op-amps, diodes, RC (resistor/capacitor) circuits and so on
become regular components.

------
olefoo
Hitachi makes a NAS head under the name SimpleTech, it's got ethernet and two
USB ports and has fully open source software.

It runs on a little startech ARM SOC and once you get a cross compilation
toolchain set up, it's easy to run stuff on it by loading from a usb drive.

[http://www.simpletech.com/products/storage/simplenet/simplen...](http://www.simpletech.com/products/storage/simplenet/simplenet.php)

I can remember having laptops less powerful than these units, so they are
roomy and fast by the standards of most embedded developers. But for
prototyping stuff they are excellent.

------
JunkDNA
I highly suggest the "beginning embedded electronics" tutorials over at
sparkfun (<http://www.sparkfun.com/commerce/tutorials.php>), just to get
yourself up to speed. I have no experience with any kind of hardware hacking
(never even had one EE course in college) and I really thought they were
great. The nice thing is that arduino (<http://www.arduino.cc/>) makes it easy
to get started, and then you can build more advanced stuff from there.

------
mru
I would recommend getting a Beagleboard[1] or a Hawkboard[2], both low-cost
single-board systems with somewhat differing capabilities.

[1] <http://beagleboard.org/> [2] <http://hawkboard.org/>

~~~
razerbeans
Thanks for the links mru! Both look very interesting; Beagleboard in
particular. How helpful are the communities associated with both? It'd be nice
to know whether I can ask newbie questions without getting blasted.

~~~
mru
The Beagleboard has a very friendly and helpful community with mailing list
and IRC channel. The Hawkboard is newer and as such doesn't have quite the
same following, but you should have no trouble getting help with it either.

