What is a Microcontroller (MCU)?
A microcontroller is a small computer on a single chip. It integrates:
• Memory – to store data and program instructions.
• CPU (Central Processing Unit) – the brain that executes instructions.
• Input/Output Devices – to interact with the outside world (sensors, displays, motors, etc.).
Microcontrollers can be 8-bit, 16-bit, or 32-bit, depending on the size of their CPU registers and data
bus.
Note: Every microcontroller has a microprocessor (CPU) at its core, but not every microprocessor is a
microcontroller (because a standalone microprocessor usually needs external memory and peripherals).
Memory in a Microcontroller
Microcontrollers have different kinds of memory that work together:
Main Memory
1. RAM (Random Access Memory)
o DRAM (Dynamic RAM): Needs to be refreshed regularly, usually used in larger systems.
o SRAM (Static RAM): Faster, no refresh needed, used for temporary storage of data in
microcontrollers.
2. Processor Registers
o Very small, fast storage inside the CPU.
o Used for calculations, temporary data, and controlling the processor.
3. Cache Memory
o High-speed memory between CPU and RAM.
o Stores recently accessed instructions/data to speed up execution.
Primary Memory (Non-Volatile)
1. ROM (Read-Only Memory) – permanent memory that holds fixed programs or data.
o PROM (Programmable ROM): Can be programmed once.
o EPROM (Erasable PROM): Can be erased with UV light and reprogrammed.
o EEPROM (Electrically Erasable PROM): Can be erased electrically and reused.
o Flash Memory: A modern, fast, and widely used form of EEPROM – allows program
updates (firmware).
, These types of memory exist because microcontrollers evolved from Intel’s early processor designs,
where different memory technologies were used to balance cost, speed, and reusability.
Assembly Language
Assembly language is a low-level programming language that directly controls the microcontroller’s
hardware.
• Processor Dependent: Each CPU family (Intel, ARM, PIC, AVR, etc.) has its own assembly
instructions.
• Instruction Set: Assembly consists of simple instructions (e.g., MOV, ADD, JMP) that tell the CPU
what to do.
• Hardware Control: Each instruction works directly with internal components like registers,
memory, or I/O ports.
Think of assembly as a human-readable form of machine language. Every instruction in assembly
corresponds to a binary machine instruction that the processor can execute.
Why Learn Assembly for Microcontrollers?
1. Direct Hardware Control – You can manage memory, registers, and I/O precisely.
2. Efficiency – Programs can be very fast and memory-efficient.
3. Foundation – Helps you understand how high-level languages (like C) work internally.
4. Debugging – Useful when troubleshooting embedded systems at the lowest level.
With this foundation, the next sections of your notes (registers, data definition, instructions) will make
more sense because readers now understand what a microcontroller is, how memory is organized, and
why assembly language is necessary.