Module 1

General Aspects

Before we write code, we must understand the machine. From basic logic gates to complex architectures.

XOR RISC Von Neumann MSP430

Digital Electronics Review

The building blocks of everything we do.

science The Magic of XOR

The Exclusive OR (XOR) is critical in assembly for toggling bits and comparing values.
Output is 1 only if inputs are different.

INTERACTIVE LAB
0 A 0 B XOR 0
TRUTH TABLE
Input A Input B Output (A^B)
000
011
101
110

lightbulb Remember Bases

Embedded systems live in Hexadecimal.

Binary
1010
Decimal
10
Hex
0xA

Real World Signals

In code, we see 0 and 1. In the real world, these are voltage levels.

show_chart Voltage = Logic

Between HIGH and LOW lies the dangerous "Undefined Region" (Noise Margin).

  • VCC (3.3V): Logic 1 (High)
  • Undefined: Unpredictable behavior
  • VSS (0V): Logic 0 (Low/GND)
Logic 1 (>2.0V)
Noise Margin / Undefined
Logic 0 (<0.8V)

What are Embedded Systems?

It is a computing system dedicated to a specific task within a larger system. Unlike a PC (General Purpose), an embedded system does one thing, and does it efficiently.

bolt Resource Constrained (Power, Memory)
timer Real-time Requirements
settings_input_component Direct Hardware Interaction
local_laundry_service Control Washing Machines
directions_car Safety ABS / Airbags
router IoT Smart Sensors
ecg_heart Medical Pacemakers

Evolution & Market

From the first chips to modern microcontrollers.

1970s: The Dawn

Intel 4004 & TI TMS1000. The first "computers on a chip".

1980s-90s: Integration

More peripherals (ADC, UART). 8-bit dominates (8051, PIC).

Now: Efficiency & Power

16/32-bit (MSP430, ARM). Low Power for battery devices.

µP

Microprocessor

CPU only. Needs external RAM, Flash, I/O.

x86, Ryzen
OUR FOCUS
µC

Microcontroller

CPU + RAM + FRAM + Peripherals in one chip.

MSP430, PIC
SoC

System on Chip

CPU + GPU + Radio + DSP. Extreme integration.

M1, Snapdragon

Memory Architectures

How does the CPU fetch Data and Instructions?

CPU
Unified Bus
Unified Memory
Instructions
Data

Von Neumann Architecture

Used by MSP430. Simpler, flexible, but creates a "Bottleneck".

CPU
Instr Bus
Data Bus
Program Mem
Data Mem

Harvard Architecture

Separate paths allow simultaneous access. Faster, but more complex.

RISC vs CISC

CISC

Complex Instruction Set Computer
  • check_box_outline_blank Many complex instructions (variable length).
  • check_box_outline_blank Hardware is complex, Coding is "easier" (fewer lines).
  • check_box_outline_blank Example: Intel x86.
MSP430

RISC

Reduced Instruction Set Computer
  • check_box Few, simple instructions (fixed/predictable length).
  • check_box Hardware is simple/fast, Compiler does the heavy lifting.
  • check_box MSP430 is RISC-like. Optimized for efficiency.
Same task: "Clear bit 3 of a port register"
CISC (x86-style) — 1 instruction
BFCLR #0x08, (PORT)
Read-Modify-Write in hardware
RISC (MSP430) — 3 simple steps
MOV.B &P1OUT, R4 ; load
BIC #0x08, R4 ; clear bit
MOV.B R4, &P1OUT ; store

Why the MSP430?

Why did we choose this specific chip for the course?

16-bit

The Goldilocks Zone

8-bit is too limiting. 32-bit is complex. 16-bit is perfect for learning: clean architecture, powerful enough for math, simple enough to understand every bit.

battery_charging_full

Ultra Low Power

Designed to run on batteries for years. It has sophisticated Low Power Modes (LPM) that we will master.

settings_remote

Modern Peripherals

It's not just a CPU. It includes Timers, ADCs, and Communication modules on-chip. Real-world capabilities.