INTRODUCTION TO MICROCONTROLLERS
Definition of a microcontroller
• Small, self-contained computer on a
single chip
• Helps to change the function without
changing the electronic circuit
Contains CPU, memory (RAM, Flash),
• and I/O peripherals
• Designed to perform specific tasks
in embedded systems
2
Historical background
• 1971: 4-bits microcontroller – Intel 4004 used in
calculators by a Japanese company named BUSICOM
• 1973: 12-bits microcontroller – Toshiba TLCS-12 used
in Ford’s cars as engine controller
• 1980s–90s: Rise of 8051, PIC, and AVR families
• 2000s–Present: Dominance of ARM Cortex-M, IoT
exp a ns io n
3
Architecture overview
Harvard architecture Von Neumann architecture
• Known as RISC (Reduced Instruction • Known as CISC (Complex
Set Computer) Instruction Set Computer)
• Newer than Von Neumann Memory • Shared bus, which can cause the
• bus and Data bus are von Neumann bottleneck (a
separate which allows simultaneous limitation in data throughput)
access to data and instructions • Simpler design
(Faster)
4
Architecture overview
RISC architecture CISC architecture
• Contains a hardwired programming • Microcoded (implemented via
unit small programs inside the CPU)
• Simple instructions decoding A • Less usage of memory Less
• single clock cycle for instruction
exe cu t io n • number of instructions
• Fixed size for instructions (32bits- • Variable size for instructions (16
4by tes ) to 64 bits for each instruction)
• • Performance is optimized with a
Performance is optimized, with an
emphasis on software focus on hardware
Commonly used in ARC, Alpha, ARC, ARM, Commonly used in System/360, VAX, AMD,
AVR, PA-RISC, and SPARC. and Intel x86 processors.
5
Architecture overview
6
Some features and capabilities
• Digital & Analog I/O
• Timers, PWM, watchdogs
• Communication: UART, I2C, SPI, CAN
• Built-in ADC, DAC
•
Low-power and sleep modes
7
Applications of microcontrollers
• Home appliances
• Automotive
• Medical devices
• IoT and smart devices
• Robotics and automation
8
Popular microcontroller platforms
• Arduino: Easy for beginners, based on AVR/ARM
• ESP32/ESP8266: Wi-Fi/Bluetooth enabled
• STM32/NXP: Industrial-grade, ARM Cortex-M
• Raspberry Pi Pico: Dual-core RP2040 MCU PIC
• & AVR: Widely used in legacy systems
9
Challenges and considerations
• Limited memory and processing power
• Real-time performance requirements
• Power management in portable devices
• Security in connected systems
10
Selecting a microcontroller
Hardware considerations
• Number of inputs/outputs (GPIO) Types of
• communication protocols needed
Software considerations
• CPU frequency needed and decide if an external clock is nedded
• Mathematical calculations (fixed point, floating point)
Microcontroller architecture
• Data size (8-bit, 16-bit or 32-bit) that a CPU can handle at a time
11
Selecting a microcontroller
Memory considerations
• Flash size and RAM size
Special features considerations
• Built-in peripherals (PWM, ADC…), Operating voltage …
Search for adequate microcontroller
• Search for communities and sources of support
• Examination of costs Examination of scalability
• (for future upgrades)
• Examination of development tools
12