About the course
What is an “embedded system”?
An “embedded system” is anything that you write code for that isn’t a computer — like a refrigerator, or a car, or a pacemaker. These devices all contain computers, but they are purpose-built for a specific application. Embedded systems are exciting to program because they are often very constrained: they must be low power, low cost, have guaranteed latency, or be super-reliable (or all of the above!) And when the code runs, it interacts with the real world — sensing the environment, controlling motors, and so on. To program these systems, you need to know more than just the programming language; you need a deep understanding of the microcontroller and the hardware it interacts with. And EE 14 exists to give you that experience!
Is EE 14 similar to CS 40?
Not really. There are some similarities: both courses use C (rather than C++) and cover the details of what happens at lower levels of the machine as it runs the code that results from compiling a program. Both courses expose you to some assembly programming, and explore things like how a C compiler turns a function call into something a computer can execute.
But CS 40 is mostly about programming on “large” computers, while EE 14 is focused on “small” microcontrollers that connect directly to the outside world. In CS 40, it’s generally assumed that the operating system handles all interactions with the hardware and provides things like a filesystem and multitasking.
In EE 14, we look at the details of the microprocessor’s hardware units for
this hardware and write code to interface with the “bare metal”.
Instead, they have a whole suite of specialized peripherals to communicate with sensors, actuators, displays, and other microcontrollers.
Using the I/O facilities mentioned above, the microcontrollers in EE 14 have a whole suite of hardware units for interacting with peripherals, like sensors, actuators, displays, or even other microcontrollers. Those are not covered in CS40.
Also, CS 40 tends to assume a “full-sized” CPU such as you might find in a laptop or cell phone, with gigabytes of memory, and
. The microcontrollersEE 14 is focused on microcontrollers (where RAM is often measured in kilobytes). CS 40 has an assignment to examine the performance implications of the cache hierarchy on a CPU; the microcontrollers we use in EE 14 don’t have a cache at all, and the performance bottlenecks are very different.
CS 40 discusses profiling and performance tuning to make code run fast. In EE 14, we’re sometimes concerned about speed, but the ways to make code fast are often very different. “Optimizing” can also mean optimizing for minimal power usage or code size.
Finally, a major difference is that EE 14 has a weekly hands-on lab where we build physical systems with microcontrollers. The labs in CS 40 focus mainly on writing programs and measuring their performance.
Both courses are valuable in different ways, and will make you a stronger programmer. If you have time in your schedule, they are both worth taking!