How are everyday machines programmed?

Josh Leitzel picture Josh Leitzel · Apr 11, 2011 · Viewed 12.9k times · Source

How are everyday machines (not so much computers and mobile devices as appliances, digital watches, etc) programmed? What kind of code goes into the programming of a Coca-Cola vending machine? How does my coffee maker accept a pre-programmed time and begin brewing a pot of coffee hours later, when that time arrives?

Do these kinds of machines have operating systems inside of them, or is it something even more basic? Are they written in Assembly, C, or some other language?

And, I would really like to find some resource that lists these operating systems or underlying code systems, possibly even with source code if possible. If anyone knows of such a resource (searching yielded nothing for me), that would be fantastic.

Answer

chubbsondubs picture chubbsondubs · Apr 11, 2011

Most of what you're talking about are embedded based systems where C is a luxury often not available. They don't have software in the traditional sense. Most of the time the software is written in C, assembly, or even machine code. C and ASM require compilers to be written to use them for that platform. Machine code is written as binary w/o a compiler.

Your coffee pot and most simple systems like that don't carry an operating system. They simply load from a start address in memory and you put your code there. Often these systems have their "code" burned into EEPROMS that act as the hard drive of the system. Screw up the code after burning the proms, throw the chips away reburn the code on the chip, and start over. There are newer chips FPGA that higher end devices use to make testing, deploying, etc easier, but they are the same thing.

Coca-cola machines, routers, etc. typically use a realtime OS like QNX, EMBOS, or sometimes RTlinux if you're lucky. Most of these are proprietary OS you license for lots of money, but they have C compilers, drivers to work with hardware, etc.

http://www.qnx.com/

http://www.segger.com/cms/embos.html

http://www.microsoft.com/windowsembedded/en-us/campaigns/compact7/default.aspx?WT.srch=1&WT.mc_ID=SEARCH

RTLinux