views:

317

answers:

6

It is very difficult to find information on programming hardware or electronic devices that are not an actual desktop computer, laptop or server. A few instances that I am speaking of are kid's toys like Bop It, or how about a control system for the home, or even something like Pleo or a mobile phone? I mean, if I want to program behavior into these electronic devices at the very core, what low-level programming language do I need to know? Is this a combination of electrical and software engineering knowledge? What are the books or resources I need?

A: 

The books Physical Computing and Making Things Talk would be a good introduction to this area.

David
A: 

Well, it depends on the vendor. Some manufacturers make their own operating systems and APIs, some use what's offered on the market (Symbian platform) and its API...

Depending on the device, the programming might be done in the assembler (some standard, or vendor's specific), then standard C is found quite often. Newer devices offer APIs for higher languages like Java or even C# on CE platform, then C++ on Symbian, etc. If you want 'at the very core', assembly languages and C might be your stuff, and vendor-specifics.

Sometimes you have to have the knowledge of electronic and software engineering, sometimes it's only the software engineering, as the electronic part is already wrapped in the API...

p.s. i forgot, some other thing that i heard of being used in this kind of stuff is some variant of basic, called BASCOM. never seen it, though.

zappan
A: 

While C (see the K&R book) is king for mass market embedded devices, for prototyping and short runs a higher level language is fine. Remember Moore's Law. Sun's Project Sun Spot, for instance, gives an easy way to use Java in an embedded situation (Disclosure: I work for Sun). Mobile phones tend to be quite powerful for as embedded devices go - over two billion run Java, although the core features still tend to be written in C or C++ (but remember Moore's Law again).

Tom Hawtin - tackline
+1  A: 

I don't think its possible to give a comprehensive answer to this question, there is a huge variety of practices in the embedded space. Most such devices are essentially closed systems without a supported way for the end-user to modify them, so they don't worry about using techniques which other programmers will be able to extend.

There are a few generalities one can make:
* C is still very common in embedded development. Not C++, just plain C.
* assembler is only common in the very smallest CPUs, 8 bit microcontrollers and such, and used sparingly elsewhere. Programmers are simply more productive with more abstraction.
* Mobile phones are different than embedded devices, because they have a real user interface (GUI or text). Java and C++ are common in phones. iPhone uses ObjectiveC, Windows Mobile has a CLR for subsets of the .Net languages.

DGentry
+4  A: 

Programming for embedded systems like you mention is usually done in C or C++.

Toys like the one you mention are mostly 8 bit microcontrollers with limited ram and rom, because they have to be cheap.

You will need to know the platform you want to target. If you have a specific toy you want to hack, find out the micro used in it. Hopefully, it is not a custom ASIC.

For 8 bit microcontrollers, I recommend looking into Atmel AVR series they are well supported and loaded with goodies such as uarts, ADC, etc.. I have programmed these in C using avrlibc tool chain (based on GCC).

For the next step up in performance I would use ARM7TDMI. Which is a 16/32 ARM core with vendor specific peripherals around it. There is also GNU tool chain support for this as well.

Development kits can be bought through Olimex.

See also:
AVR Freaks
avrlibc tool chain
Make Magazine
Olimex

JeffV
A: 

You might be interested in Arduino which is an open-source community around an Atmel ATMEGA168 base, various add-on boards and toolchain

Pete Kirkham