Lesson 1 Notes



Lesson Outline

Course Intro

Welcome to ECE382, Embedded Systems I. First things first - what have you heard about this class?!

We're going to learn about computers - how they work and how we use them to accomplish tasks. Specifically, we'll work with small computers called microcontrollers.

In this class, we'll be:

My goal is for you to leave this course with enough knowledge to be confident you can use microcontrollers in your future projects and enough excitement that you actually want to.

Did anyone do the reading for today?! Readings / Assignments in the lesson notes on the course website.

So if you read, what are embedded systems? You're familiar with general-purpose computers - devices that are designed to be flexible and accommodate a wide range of needs.

Embedded systems are different - they're built to interact with the real-world and perform very specific functions, often with difficult constraints (timing, power, etc). These are the systems that monitor the engine temperature in your car, power your digital watch, the brains of your microwave, etc. Or perform functions in manufacturing lines, power plants or water treatment facilities.

I think that this area of computing is going to be a big part of the future.
Swarm of Quadrotors

But even if you don't agree with this vision, learning about computers at a low level gives you a great insight into how these machines actually work. You'll develop skills that will make you a better engineer, regardless of your ultimate focus.

We're going to get very hands-on and expect you to build things that actually work. By the end of the semester, you'll program this robot to navigate this maze.

[Show robot] - and if you win, you'll get your name on the wall - we've been running the maze competition since 1997.


Structure of a Computer

Let's start with some perspective. What are the key components of a computer?

If you shrink this to a single PCB, you've got what we call a single board computer - think of a Raspberry Pi.

System on a Chip

If you take the core components from this computer, shrink them, and integrate them on a single die, you have what's known as a System on a Chip (SoC). Multiple components on a single die is the core feature here. This is what powers your cell phones. The Galaxy S4, for instance, has two models - one uses Qualcomm SnapDragon 600 and other Samsung Exynos 5 Octa. They can include additional components based on application.

Galaxy S4

These SoCs have powerful CPUs and are capable of running modern software like Linux / Windows. Typically they need external memory chips (flash, RAM) to support this software (Android, iOS, etc. need a LOT of RAM)- so they're not completely single-chip.

[In the future, would love to crack open a smartphone and show the guts]


When you scale this down even further (100kB of RAM or less), you reach the world of microcontrollers. That's where we'll live this semester. Microcontrollers typically are completely single-chip. They're extremely low power and low cost. But they typically come with some limitations - memory, CPU speed, onboard subsystems, etc. Another distinction is that they're built to interact with the outside world - they have hardware support for common peripheral devices and they have a lot of input / output lines to enable them to interact with external devices.

[Show MSP430G2553 chip]

Architecture vs Microarchitecture

Now, let's see where we are in the overall hierarchy of ECE - and talk about CPUs a bit more.

EE Hierarchy

Instruction Set Architecture (ISA)
The ISA is the programmer's view of the processor. Processors with the same ISA share the same data types, assembly language instructions, registers, addressing modes, memory architecture, interrupts, IO, etc. This is the API into the processor for the programmer - the tools the programmer has access to to accomplish what they want.

Are all processors that implement an ISA the same? Are the Intel and AMD chips that implement x86 the same (Pentium, Athlon)?
NO - different microarchitectures.

The microarchitecture is the hardware implementation of a given ISA. An ISA can be implemented with different microarchitectures. This allows programmers to write software that functions on chips made by different manufacturers.

Does anyone know what ISA / processor their computer is running?
Mine runs x86_64:

Capt Branchflower's Architecture

Can anyone name any more instruction set architectures (ISA)?

These aren't toy architectures - they're used in all sorts of devices we use everyday.

The architecture we'll use in this course is the MSP430 - it specializes in extremely low power applications. We'll learn more about it next lesson.

Some History - RISC vs CISC

On board - ISAs fall into two different categories, Reduced Instruction Set Computer (RISC) and Complex Instruction Set Computer (CISC).

Early in the history of computing, most programming was done using the ISA directly (assembly language). Higher level languages (compiled - C, C++, etc interpreted - Python, Ruby, etc) weren't as widely available and the associated compilation technology wasn't as good. Consequently, computer architects designed ISAs that included progressively higher-level programming constructs - designed to make the assembly programmer's life easier. As a result, instructions were created that were capable of performing several low-level operations in a single step. For example, a single instruction might load some information from memory, perform an addition operation, and store the result - taking many clock cycles. Since instructions coded for more operations, this had the added benefit of making program length shorter - which was important because memory was expensive and slow at the time.

Brief summary on board.

Over time, people began to gravitate toward higher-level compiled languages like C for their benefits in portability and programmer productivity. Good, portable compilers along with open operating systems had been developed and fewer programs were being written in assembly language. So programmer convenience became less of an driving force behind ISA design. Designers noticed that compilers didn't need many of the features meant to facilitate manual assembly programming. They thought that these complex instruction could be replaced with sequences of simpler ones. The simpler hardware would give room for more registers, reducing the number of slow memory accesses. In these designs, instructions were typically of uniform length - allowing for better pipelining and higher clock frequencies. This strategy became known as Reduced Instruction Set Computing (RISC).

Brief summary on board.

Others thought that hardware design was more mature than compiler design and sought to implement these higher level constructs in hardware - this philosophy became known as Complex Instruction Set Computing (CISC).

RISC designers focused on architectures with a small amount of highly-optimized instructions. They found that these could often be faster than complex instructions performing the same operation. You'll learn a lot more about this in ECE485 with Dr. York. But the key characteristics of RISC are a small, highly optimized instruction set, many general purpose registers, and higher clock speeds than CISC processors. They also have longer programs lengths than CISC architectures.

CISC is characterized by a bigger instruction set, many addressing modes, instructions take multiple clock cycles, and typically slower clock speeds than RISC.

But RISC never really made it mainstream. That's probably due to the large amount of software written for x86, a CISC architecture - only the most recent version of Windows is available on ARM. Intel also could afford to invest a lot more in process improvements, etc. than the RISC manufacturers. They also adapted a lot of the RISC improvements to their own architecture - CISC architectures often translate their higher-level instructions in hardware to microcode, similarly to RISC. Now high-performing CPUs (both RISC and CISC) are all pretty similar.

x86 is still pretty dominant on PCs, but RISC has found a home in low-end mobile systems and high-end supercomputing.

In the past, we worked with the Motorola 68S12, which used a CISC architecture.

This semester, we'll be working with the MSP430. It uses a RISC architecture. It has a grand total of 27 instructions.

[Show Launchpad kit]