Chapterبەش 3 · Lectureوانە 3.3

Microprocessor or Microcontroller?مایکرۆپرۆسێسەر یان مایکرۆکۆنترۆڵەر؟

A microprocessor is a CPU on one chip that needs memory and input/output chips around it; a microcontroller puts a whole small computer on one chip. Look inside both, from the Intel 4004 to today's 24-core processors and the ATmega328P; learn why embedded systems choose microcontrollers, why they are programmed in C and C++, how they run with a main loop and interrupts or a small RTOS, and how they get firmware over the air; then compare the chips IoT builders use in 2026, from the Arduino UNO to the ESP32, the Raspberry Pi Pico 2 and the Raspberry Pi 5.

مایکرۆپرۆسێسەر لەسەر یەک کە پێویستی بە و / هەیە لە دەوریدا؛ بچووکی تەواو دەخاتە سەر یەک . سەیری ناوەوەی هەردووکیان بکە، لە ⁦Intel 4004⁩ـەوە تا پرۆسێسەرە ⁦24⁩ ناوکییەکانی ئەمڕۆ و ⁦ATmega328P⁩؛ فێر ببە بۆچی هەڵدەبژێرن، بۆچی بە C و ⁦C++⁩ بۆ دەنووسرێت، چۆن بە سەرەکی و یان بچووک کار دەکەن و چۆن بە ڕادیۆ وەردەگرن؛ پاشان ئەو بەراورد بکە کە دروستکەرانی IoT لە ⁦2026⁩دا بەکاریان دەهێنن، لە Arduino UNOـەوە تا ⁦ESP32⁩، ⁦Raspberry Pi Pico 2⁩ و ⁦Raspberry Pi 5⁩.

23 min read25 خولەک خوێندنەوە · 18 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain what a microprocessor is and why it needs memory and input/output chips around it.
  • Name the parts inside a microcontroller and compare it with a microprocessor point by point.
  • Explain how constraints lead embedded designers to microcontrollers, to C and C++, and to no operating system or a small RTOS.
  • Describe a foreground/background system and how a safe over-the-air firmware update works.
  • Compare the Arduino UNO R3 and R4, the ESP32 family, the Raspberry Pi Pico 2 and the Raspberry Pi 5, and explain why the Pi 5 is not a microcontroller.
  • ڕوون بکەیتەوە مایکرۆپرۆسێسەر چییە و بۆچی پێویستی بە و / هەیە لە دەوریدا.
  • بەشەکانی ناو ناو ببەیت و خاڵ بە خاڵ لەگەڵ مایکرۆپرۆسێسەر بەراوردی بکەیت.
  • ڕوون بکەیتەوە چۆن سنوورەکان دیزاینەرانی دەبەن بەرەو ، C و ⁦C++⁩ و بێ یان بچووک.
  • سیستەمی پێشەوە و پشتەوە وەسف بکەیت و ڕوون بکەیتەوە چۆن بە سەلامەتی کار دەکات.
  • ⁦Arduino UNO R3⁩ و ⁦R4⁩، خێزانی ⁦ESP32⁩، ⁦Raspberry Pi Pico 2⁩ و ⁦Raspberry Pi 5⁩ بەراورد بکەیت و ڕوون بکەیتەوە بۆچی ⁦Raspberry Pi 5⁩ نییە.

One chip that thinks, or a whole computer on one chip?چیپێک کە بیر دەکاتەوە، یان کۆمپیوتەرێکی تەواو لەسەر یەک چیپ؟

Open a laptop and you find one processor chip with helpers all around it: memory, a storage drive, a Wi-Fi chip and more. Open a TV remote and you find one small chip and almost nothing else. Both chips run programs. The laptop's is a microprocessor; the remote's is a microcontroller.

بکەرەوە: پرۆسێسەر دەبینیت و لە دەوریدا چەندین یاریدەدەر: ، ، و زیاتر. ڕیمۆتێکی تیڤی بکەرەوە: تەنیا بچووک دەبینیت و نزیکەی هیچی تر. هەردوو جێبەجێ دەکەن. هی مایکرۆپرۆسێسەرە؛ هی ڕیمۆتەکە .

This lesson opens both. You will see why almost every embedded system uses a microcontroller, how microcontrollers are programmed, how they run without Windows or Android, how they receive new firmware, and which chips IoT builders use in 2026. The short version is in Microcontrollers; here we go deeper.

ئەم وانەیە هەردووکیان دەکاتەوە. دەبینیت بۆچی نزیکەی هەموو بەکار دەهێنێت، چۆن بۆ دەنووسرێت، چۆن بێ Windows یان Android کار دەکەن، چۆن نوێ وەردەگرن و دروستکەرانی IoT لە ⁦2026⁩دا کام بەکار دەهێنن. کورتەکەی لە مایکرۆکۆنترۆڵەرەکان هەیە؛ لێرەدا قووڵتر دەڕۆین.

Two panels. Left, a laptop's board: a microprocessor (CPU) in the middle, joined to separate chips for RAM (working data), an SSD (programs and files), Wi-Fi (radio) and input/output (USB, screen); the program and its data live in other chips. Right, a TV remote with buttons and an infrared light, and a zoom into its single chip: a microcontroller with CPU, memory, inputs and outputs — a whole small computer on one chip. Below: both run programs; one needs a team of chips, the other is the whole team on one chip.دوو بەش. چەپ، بۆردی لاپتۆپێک: مایکرۆپرۆسێسەر (CPU) لە ناوەڕاست، بەستراو بە چیپەکانی جیاوە بۆ RAM (دراوەی کاتی)، SSD (بەرنامە و فایلەکان)، وای‌فای (ڕادیۆ) و نێوخستە/دەرخستە (USB، شاشە)؛ بەرنامە و دراوەکەی لە چیپەکانی تردان. ڕاست، ڕیمۆتێکی تیڤی بە دوگمە و ڕووناکییەکی ژێرسوورەوە، لەگەڵ گەورەکراوەی تاکە چیپەکەی: مایکرۆکۆنترۆڵەرێک بە CPU، بیرگە، نێوخستە و دەرخستەوە — کۆمپیوتەرێکی بچووکی تەواو لەسەر یەک چیپ. لە خوارەوە: هەردووکیان بەرنامە جێبەجێ دەکەن؛ یەکێکیان پێویستی بە تیمێک چیپ هەیە، ئەوی تر خۆی هەموو تیمەکەیە لەسەر یەک چیپ.
A microprocessor needs a team of chips; a microcontroller is the whole team on one chip.مایکرۆپرۆسێسەر پێویستی بە تیمێک هەیە؛ خۆی هەموو تیمەکەیە لەسەر یەک .CêIT

The microprocessor: a CPU on one chipمایکرۆپرۆسێسەر: CPU لەسەر یەک چیپ

A microprocessor is a CPU built on a single chip. Each processor core inside it does three things again and again: it fetches an instruction from memory, decodes it and executes it (The fetch–decode–execute cycle). Early microprocessors had one core; today's have many, so a better definition is: one or more processor cores on one chip.

مایکرۆپرۆسێسەر کە لەسەر یەک دروست کراوە. هەر لەناویدا سێ کار دووپاتە و دووپاتە دەکات: لە دەهێنێت، شیی دەکاتەوە و جێبەجێی دەکات (سووڕی ڕێکارنامە). یەکەم مایکرۆپرۆسێسەرەکان یەک ناوکیان هەبوو؛ ئەوانەی ئەمڕۆ چەندین ناوکیان هەیە، بۆیە پێناسەیەکی باشتر ئەمەیە: یەک یان چەند لەسەر یەک .

A microprocessor can do general-purpose computing, but it cannot work alone: the program and the data live in memory chips outside it, and keyboards, screens and networks reach it through other chips on the board. The parts inside — the control unit, the registers and the ALU — are explained in Inside the CPU.

مایکرۆپرۆسێسەر دەتوانێت کاری ژمێرکاریی گشتی بکات، بەڵام بە تەنیا کار ناکات: و لە دەرەوەیدا دەژین و ، شاشە و لە ڕێی ترەوە لەسەر بۆردەکە پێی دەگەن. بەشەکانی ناوەوەی — ، و ALU — لە ناو CPU ڕوون کراونەتەوە.

Inside a dashed outline labelled microprocessor chip: a memory interface feeds an instruction fetcher, then come an instruction decoder, the registers and an ALU drawn as a wide funnel, with arrows from the registers into the ALU and from the ALU's result back to the registers. A grey note inside says one core is drawn here and today's chips repeat it: 6, 8, 24 cores. Outside the chip, thick buses on the board lead to separate chips: RAM with the running program and its data, storage (an SSD) with programs and files kept without power, and I/O chips for the keyboard, screen, network and USB.لەناو هێڵێکی پچڕپچڕدا بە ناوی چیپی مایکرۆپرۆسێسەر: پەیوەندی بە بیرگەوە ڕێکارنامەکان دەداتە بەشی هێنانی ڕێکارنامە، پاشان کۆدهەڵوەشێنەری ڕێکارنامە، تۆمارگەکان و ALU دێن کە وەک قیفێکی پان کێشراوە، بە تیر لە تۆمارگەکانەوە بۆ ALU و لە ئەنجامی ALUـەوە بۆ تۆمارگەکان. تێبینییەکی خۆڵەمێشی لەناویدا دەڵێت لێرەدا یەک ناوکی پرۆسێسەر کێشراوە و چیپەکانی ئەمڕۆ دووپاتەی دەکەنەوە: 6، 8، 24 ناوک. لە دەرەوەی چیپەکە، تێپەڕگەکانی ئەستووری سەر بۆردەکە دەچن بۆ چیپەکانی جیا: RAM بە بەرنامە کارپێکراوەکە و دراوەکەی، شوێنی خەزنکردن (SSD) بە بەرنامە و فایلەکانەوە کە بێ کارەباش دەمێننەوە، هەروەها چیپەکانی I/O بۆ کیبۆرد، شاشە، ڕایەڵە و USB.
A microprocessor fetches, decodes and executes; its memory and its inputs and outputs are other chips.مایکرۆپرۆسێسەر دەهێنێت، شی دەکاتەوە و جێبەجێ دەکات؛ ، و ترن.CêIT

The microprocessor: a CPU on one chipمایکرۆپرۆسێسەر: CPU لەسەر یەک چیپ

From 4 bits to 24 coresلە 4 بیتەوە تا ⁦24⁩ ناوک

The Intel 4004, sold from November 1971, was the first microprocessor sold as a part. It was 4-bit, had about 2,300 transistors and ran at up to 740 kHz — roughly 92,000 instructions a second. It was made for a printing calculator, and even it needed helpers: a 4001 ROM chip held the program, a 4002 RAM chip held the data and a 4003 chip scanned the keyboard and drove the printer.

⁦Intel 4004⁩، کە لە نۆڤەمبەری ⁦1971⁩ـەوە فرۆشرا، یەکەم مایکرۆپرۆسێسەر بوو کە وەک پارچەیەک بفرۆشرێت. 4 بوو، نزیکەی ⁦2,300⁩ تێدابوو و تا ⁦740 kHz⁩ کاری دەکرد — نزیکەی ⁦92,000⁩ لە چرکەیەکدا. بۆ دروست کرابوو کە ئەنجامەکانی چاپ دەکرد. تەنانەت ئەویش پێویستی بە یاریدەدەر بوو: ⁦4001⁩ هەڵدەگرت، ⁦4002⁩ هەڵدەگرت و ⁦4003⁩ دەپشکنی و کار پێ دەکرد.

Fifty years later the idea is the same, only much bigger. Today's chips still need RAM modules, an SSD and a motherboard — and a cooler, because they turn 100 to 250 watts into heat. The newest numbers are in Cores.

پەنجا ساڵ دواتر بیرۆکەکە هەمان شتە، تەنیا زۆر گەورەتر. ئەمڕۆ هێشتا پێویستیان بە ، SSD و هەیە — هەروەها ساردکەرەوە، چونکە ⁦100⁩ تا ⁦250⁩ وات دەکەن بە گەرمی. نوێترین ژمارەکان لە ناوکەکان هەن.

Three microprocessors, fifty years apartسێ مایکرۆپرۆسێسەر، پەنجا ساڵ لە نێوانیاندا
ChipBitsCoresناوکClockNeeds around itئەوەی لە دەوریدا پێویستیەتی
Intel 4004 (1971)41740 kHzROM, RAM and I/O chips (4001, 4002, 4003) ROM، RAM و ⁦I/O (4001⁩، ⁦4002⁩، ⁦4003⁩)
Intel Core i9-13900K (2022)6424 (8 performance, 16 efficient)⁦24 (8⁩ خێرا، ⁦16⁩ کەمخەرج)up to 5.8 GHzتا ⁦5.8 GHz⁩RAM, SSD, motherboard, cooler; 125 W, up to 253 WRAM، SSD، ، ساردکەرەوە؛ ⁦125 W⁩، تا ⁦253 W⁩
AMD Ryzen 5 7600X (2022)646up to 5.3 GHzتا ⁦5.3 GHz⁩RAM, SSD, motherboard, cooler; 105 WRAM، SSD، ، ساردکەرەوە؛ ⁦105 W⁩

The microcontroller: a whole computer on one chipمایکرۆکۆنترۆڵەر: کۆمپیوتەرێکی تەواو لەسەر یەک چیپ

A microcontroller (MCU) puts a complete small computer on one chip. Next to its processor core — usually one, though some popular IoT chips have two — the same piece of silicon holds memory blocks (flash for the program, SRAM for the data, often a little EEPROM for settings), digital and analog inputs and outputs, and basic peripherals such as timers and serial ports, all joined by a system bus. The ATmega328P of the Arduino UNO R3 is a classic example:

⁦(MCU)⁩ بچووکی تەواو دەخاتە سەر یەک . لە تەنیشت — زۆرجار یەک دانە، هەرچەندە هەندێک بەناوبانگی IoT دوویان هەیە — هەمان پارچە سیلیکۆن بلۆکەکانی ( بۆ ، بۆ و زۆرجار کەمێک بۆ ڕێکخستنەکان)، و دیجیتاڵ و و سەرەتایی وەک و دەرچەکانی لەخۆ دەگرێت، هەموویان بە پێکەوە بەستراون. ⁦ATmega328P⁩ـی ⁦Arduino UNO R3⁩ نموونەیەکی ناسراوە:

One big chip, the ATmega328P of the Arduino UNO R3, with pins all around. Inside, the top row: CPU core (8-bit AVR, 16 MHz), flash 32 KB (the program), SRAM 2 KB (the data) and EEPROM 1 KB (saved settings). The bottom row: digital I/O (23 pins, HIGH or LOW), ADC (6 analog inputs, 10-bit), timers (3 timers for time and PWM) and serial ports (USART, SPI, I²C). A system bus in the middle joins everything inside the chip. Outside, only a 16 MHz clock and 5 V power. Note: program, data, inputs, outputs and timers on one chip; only a clock, power and a few small parts are outside.چیپێکی گەورە، ATmega328Pـی Arduino UNO R3، بە پین لە هەموو لایەکەوە. لەناویدا، ڕیزی سەرەوە: ناوکی پرۆسێسەر (AVRـی 8 بیتی، 16 MHz)، فلاش مێمۆری 32 KB (بەرنامەکە)، SRAM 2 KB (دراوە) و EEPROM 1 KB (ڕێکخستنە هەڵگیراوەکان). ڕیزی خوارەوە: نێوخستە/دەرخستەی دیجیتاڵ (23 پین، HIGH یان LOW)، ADC (6 نێوخستەی ئەنالۆگ، 10 بیت)، تایمەرەکان (3 تایمەر بۆ کات و PWM) و دەرچەکانی پەیوەندیی زنجیرەیی (USART، SPI، I²C). تێپەڕگەی سیستەم لە ناوەڕاستدا هەموو بەشەکانی ناو چیپەکە پێکەوە دەبەستێت. لە دەرەوە تەنیا کاتژمێرێکی 16 MHz و کارەبای 5 V هەن. تێبینی: بەرنامە، دراوە، نێوخستە، دەرخستە و تایمەرەکان لەسەر یەک چیپ؛ تەنیا کاتژمێر، کارەبا و چەند پارچەیەکی بچووک لە دەرەوەن.
A microcontroller: memory, inputs, outputs and timers on the same chip as the core.: ، ، و لەسەر هەمان ناوکەکە.CêIT

Microcontrollers are made for control: switching things on and off, reading sensors, moving motors and showing information on a small screen. You find them behind the buttons and display of a microwave oven, in a TV remote, in a car's engine control (A petrol engine's control unit) and running a washing machine's programs. How the ADC turns a voltage into a number comes in Reading Analog Signals.

بۆ کۆنترۆڵکردن دروست کراون: هەڵکردن و کوژاندنەوەی شتەکان، خوێندنەوەی ، جووڵاندنی و پیشاندانی زانیاری لەسەر شاشەیەکی بچووک. لە پشت دوگمە و شاشەی مایکرۆوەیڤ، لەناو ڕیمۆتی تیڤی، لە کۆنترۆڵی بزوێنەری ئۆتۆمبێل (یەکەی کۆنترۆڵی بزوێنەری بەنزین) و لە بەڕێوەبردنی بەرنامەکانی جلشۆردا دەیاندۆزیتەوە. ئەوەی ADC چۆن دەکات بە ژمارە، لە خوێندنەوەی سیگناڵەکانی ئەنالۆگ فێر دەبیت.

Microprocessor and microcontroller side by sideمایکرۆپرۆسێسەر و مایکرۆکۆنترۆڵەر لە تەنیشت یەکتر

Two kinds of chipدوو جۆر
PointخاڵMicroprocessorمایکرۆپرۆسێسەرMicrocontroller
On the chipلەسەر one or more fast cores, with cacheیەک یان چەند ناوکێکی خێرا، لەگەڵ a core with memory, inputs, outputs and timersناوکێک لەگەڵ ، ، و
Memoryoutside: gigabytes of RAM and an SSDلە دەرەوە: چەند گیگابایتێک RAM و SSDinside: kilobytes to a few megabytesلەناوەوە: کیلۆبایت تا چەند مێگابایتێک
Inputs and outputs و through other chips on the boardلە ڕێی ترەوە لەسەر بۆردەکەpins on the chip itself, some with an ADC or PWMپین لەسەر خودی ، هەندێکیان بە ADC یان PWM
Speedخێراییgigahertzگیگاهێرتزmegahertz (16 to 240 MHz in this lesson)مێگاهێرتز (لەم وانەیەدا ⁦16⁩ تا ⁦240 MHz⁩)
Softwarea full operating system and many programs تەواو و چەندین one program, with no OS or a small RTOSیەک ، بێ یان لەگەڵ بچووک
Powerوزەtens to hundreds of wattsدەیان تا سەدان واتmilliwatts running, microwatts or less asleepمیلیوات لە کاتی کارکردندا، مایکرۆوات یان کەمتر لە
Priceنرخhundreds of dollarsسەدان دۆلارcents to a few dollarsچەند سەنتێک تا چەند دۆلارێک
Typical usesبەکارهێنانی باوPCs, laptops, servers (phones use SoCs)PC، ، (مۆبایل بەکار دەهێنێت)appliances, toys, sensors, car parts, IoT devicesئامێرەکانی ماڵ، یاری، ، پارچەی ئۆتۆمبێل، ئامێرەکانی IoT
A bar chart on a log scale from 1 microwatt to 1 kilowatt, where each big step is 1,000 times more. A microcontroller asleep (ESP32-C3 in deep sleep, 5 µA at 3.3 V) uses about 17 µW. The same microcontroller running at 160 MHz (23 mA at 3.3 V) uses about 76 mW. Desktop microprocessors: AMD Ryzen 5 7600X, 105 W; Intel Core i9-13900K, 125 W normally and up to 253 W in turbo. Note: a sleeping microcontroller uses more than 7 million times less power than a 125 W desktop processor.هێڵکارییەکی ستوونی لەسەر پێوەری لۆگاریتمی لە 1 مایکرۆوات تا 1 کیلۆوات، کە هەر هەنگاوێکی گەورە 1,000 جار زیاترە. مایکرۆکۆنترۆڵەرێکی خەوتوو (ESP32-C3 لە خەوی قووڵدا، 5 µA لەسەر 3.3 V) نزیکەی 17 µW بەکار دەبات. هەمان مایکرۆکۆنترۆڵەر لە کاتی کارکردندا لەسەر 160 MHz (23 mA لەسەر 3.3 V) نزیکەی 76 mW. مایکرۆپرۆسێسەرە مێزییەکان: AMD Ryzen 5 7600X، 105 W؛ Intel Core i9-13900K، بە ئاسایی 125 W و لە تێربۆدا تا 253 W. تێبینی: مایکرۆکۆنترۆڵەرێکی خەوتوو زیاتر لە 7 ملیۆن جار کەمتر لە پرۆسێسەرێکی مێزیی 125 وات وزە بەکار دەبات.
Power use, from a sleeping microcontroller to a desktop microprocessor (makers' data; log scale).، لە خەوتووەوە تا مایکرۆپرۆسێسەرێکی مێزی (ژمارەکانی دروستکەران؛ پێوەری لۆگاریتمی).CêIT

Constraints choose the chipسنوورەکان چیپەکە هەڵدەبژێرن

Embedded systems live with tight limits on cost, size and weight, power and energy, and their environment (The four limits on every embedded system). These limits shape three choices: the chip, the programming language and the operating system.

لەگەڵ سنووری توند لەسەر تێچوو، قەبارە و کێش، و و ژینگەکەیان دەژین (چوار سنوورەکەی هەموو سیستەمێکی چەسپێنراو). ئەم سنوورانە سێ هەڵبژاردن دیاری دەکەن: ، و .

Four limits on the left — cost, size and weight, power and energy, environment — point through a wide arrow to three choices on the right. 1, the chip: a microcontroller, with memory and peripherals on the chip, so fewer parts. 2, the language: C and C++ with a little assembly, for small, fast code. 3, the software: no operating system — a loop and interrupts — or a small RTOS. Below: the next screens take the three choices one by one.چوار سنوور لە لای چەپ — تێچوو، قەبارە و کێش، توانای کارەبایی و وزەی کارەبایی، ژینگە — بە تیرێکی پان ئاماژە بۆ سێ هەڵبژاردن لە لای ڕاست دەکەن. 1، چیپەکە: مایکرۆکۆنترۆڵەر، بە بیرگە و ئامێرە لاوەکییەکانەوە لەسەر چیپەکە، بۆیە پارچەی کەمتر. 2، زمانەکە: C و C++ لەگەڵ کەمێک زمانی ئەسێمبلی، بۆ کۆدی بچووک و خێرا. 3، نەرمەواڵەکە: بێ سیستەمی وەگەڕخەر — خول و پچڕاندنەکان — یان سیستەمێکی وەگەڕخەری کاتی ڕاستەقینەی بچووک. لە خوارەوە: پەردەکانی داهاتوو سێ هەڵبژاردنەکە یەک بە یەک ڕوون دەکەنەوە.
The limits of embedded systems decide the chip, the language and the software.سنوورەکانی ، زمانەکە و دیاری دەکەن.CêIT

The first choice is clear: microcontrollers are used rather than microprocessors. A microcontroller already includes the peripherals that talk to other devices, so it can react to a button or a sensor quickly and efficiently. And because its RAM and ROM — today usually flash — are on the chip, no separate memory chips are needed: the circuit board becomes smaller, simpler and cheaper.

هەڵبژاردنی یەکەم ڕوونە: لە جیاتی مایکرۆپرۆسێسەر بەکار دەهێنرێت. خۆی تێدایە کە قسە لەگەڵ ئامێرەکانی تر دەکەن، بۆیە دەتوانێت بە خێرایی و بە کارایی کاردانەوەی هەبێت بۆ یان . هەروەها چونکە و — کە ئەمڕۆ زۆرجار — لەسەر ، پێویست بە جیا ناکات: بۆردەکە بچووکتر، سادەتر و هەرزانتر دەبێت.

C and C++, and a little assemblyC و ⁦C++⁩، لەگەڵ کەمێک زمانی ئەسێمبلی

The second choice is the language. Microcontrollers are programmed mostly in C, and today also in C++ — Arduino sketches are C++. A compiler turns the program into the chip's own machine code, so the code is small and fast, and a cheaper microcontroller with less memory is enough. A smartwatch programmed in C needs less memory and power than if it were written in Java, which first becomes bytecode and needs a virtual machine running beside the program (Java: compile with javac, run on the JVM).

هەڵبژاردنی دووەم زمانەکەیە. زۆربەیان بە C و ئەمڕۆ هەروەها بە ⁦C++⁩ بۆ دەنووسرێت — Arduino بە ⁦C++⁩ دەنووسرێن. دەکات بە خودی ، بۆیە کۆدەکە بچووک و خێرایە و هەرزانتر بە کەمترەوە بەسە. کاتژمێرێکی هۆشمەند کە بە C نووسرابێت و وزەی کەمتری پێویستە وەک لەوەی بە Java بنووسرێت، کە سەرەتا دەبێتە و پێویستی بە هەیە لە تەنیشت کار بکات (Java: کۆمپایلکردن بە javac، جێبەجێکردن لەسەر JVM).

Four cards joined by arrows. C, what you write: int add(int a, int b) { return a + b; } — one line does the work. A compiler turns it into assembly for an Arm Cortex-M4: add r0, r1 and bx lr — two instructions. An assembler turns those into machine code: 4408 and 4770 in hexadecimal, 01000100 00001000 and 01000111 01110000 in binary — four bytes. They are stored in the flash memory of the microcontroller, whose Cortex-M4 core runs them from there. Notes: checked with clang for an Arm Cortex-M4, the core of the Arduino UNO R4; Java would first become bytecode, and a virtual machine would have to fit in the chip too.چوار کارت بە تیر بەستراون. C، ئەوەی تۆ دەینووسیت: int add(int a, int b) { return a + b; } — 1 دێڕ کارەکە دەکات. کۆمپایلەرێک دەیکات بە زمانی ئەسێمبلی بۆ Arm Cortex-M4: add r0, r1 و bx lr — 2 ڕێکارنامە. ئەسێمبلەرێک ئەوانە دەکات بە کۆدی ئامێر: 4408 و 4770 بە شانزەیی، 01000100 00001000 و 01000111 01110000 بە دووانی — 4 بایت. لەناو فلاش مێمۆریی مایکرۆکۆنترۆڵەرەکەدا هەڵدەگیرێن و ناوکی Cortex-M4ـەکەی لەوێوە جێبەجێیان دەکات. تێبینی: بە clang بۆ Arm Cortex-M4 پشکنراوە، ناوکی Arduino UNO R4؛ Java سەرەتا دەبێتە بایتکۆد، پاشان ئامێرێکی گریمانەیی دەبێت لەناو چیپەکەشدا جێی ببێتەوە.
One line of C becomes two instructions and four bytes of flash.یەک دێڕی C دەبێتە دوو و چوار .CêIT

Where every microsecond or byte counts, engineers write a few performance-critical parts in assembly language: it is even lower-level than C, one line per machine instruction, and it gives full control (Low-level and high-level languages). As of 2026, MicroPython also runs on larger microcontrollers such as the Pico 2 and the ESP32 family; Java is rare on microcontrollers.

لەو شوێنانەی هەر مایکرۆچرکەیەک یان گرنگە، ئەندازیاران چەند بەشێکی هەستیار بە دەنووسن: لە C نزمترە، هەر دێڕێک یەک ئامێرە و کۆنترۆڵی تەواو دەدات (زمانە ئاستنزمەکان و زمانە ئاستبەرزەکان). تا ⁦2026⁩، هەروەها MicroPython لەسەر گەورەتری وەک ⁦Pico 2⁩ و خێزانی ⁦ESP32⁩ کار دەکات؛ Java لەسەر دەگمەنە.

No operating system: a main loop and interruptsبێ سیستەمی وەگەڕخەر: خولی سەرەکی و پچڕاندنەکان

The third choice is the operating system — usually none. A digital thermometer does not need Android: it checks the temperature, shows it and maybe beeps. Its firmware can be a simple scheduler that decides when each task runs, or even just a main loop plus interrupts. An interrupt is a signal — from a timer, a pin or a peripheral — that makes the processor pause the loop, run a short routine and go back. With no operating system to notice a frozen loop, many boards use a watchdog timer that resets them: see Lab: The Watchdog Timer.

هەڵبژاردنی سێیەم — زۆرجار هیچ. گەرمیپێوێکی دیجیتاڵی پێویستی بە Android نییە: پلەی گەرمی دەپێوێت، پیشانی دەدات و لەوانەیە بیپ بکات. دەتوانێت بەرنامەیەکی سادەی بێت کە بڕیار دەدات هەر ئەرکێک کەی کار بکات، یان تەنیا سەرەکی لەگەڵ . — لە ، پینێک یان — کە ناچار دەکات ڕابگرێت، کورت جێبەجێ بکات و بگەڕێتەوە. چونکە هیچ نییە هەست بە گیرخواردوو بکات، زۆر بۆرد بەکار دەهێنن کە بۆردەکە دەکات: بڕوانە تاقیگە: تایمەری پاسەوان.

Engineers call this a foreground/background system. The main loop is the background (task level): it does the jobs one after another, again and again. The interrupt routines are the foreground (interrupt level): urgent work is done there at once. Most high-volume, low-cost microcontroller products — microwave ovens, toys, simple phones — are built this way. Watch one:

ئەندازیاران ئەمە ناو دەنێن سیستەمی پێشەوە و پشتەوە (foreground/background system). سەرەکی پشتەوەیە (ئاستی ئەرک): کارەکان یەک لە دوای یەک دەکات، دووپاتە و دووپاتە. پێشەوەن (ئاستی ): کاری بەپەلە یەکسەر لەوێ دەکرێت. زۆربەی ئەو بەرهەمە هەرزانانەی کە بە ژمارەیەکی زۆر دروست دەکرێن — مایکرۆوەیڤ، یاری منداڵان، مۆبایلی سادە — بەم شێوەیە دروست کراون. سەیری یەکێکیان بکە:

An animation in six steps. Left, the background: a main loop of three boxes — 1 measure (read the sensor), 2 show (update the display), 3 check (act on any notes) — with a display showing 24.5 °C, a button and a timer that fires every second. Right, the foreground: a button routine (button_pressed = 1) and a timer routine (time_to_measure = 1), and a reminder: keep these routines very short, they only take a note. 1: the loop runs measure, show, check. 2: while it shows the reading, the button is pressed — an interrupt. 3: the CPU marks its place in the loop and runs the button routine, which only takes a note. 4: microseconds later it returns to the exact place where the loop stopped. 5: at check, the loop reads that note and the display changes from 24.5 °C to 76.1 °F. 6: each second a timer interrupt notes that it is time to measure.
An animation in six steps. Left, the background: a main loop of three boxes — 1 measure (read the sensor), 2 show (update the display), 3 check (act on any notes) — with a display showing 24.5 °C, a button and a timer that fires every second. Right, the foreground: a button routine (button_pressed = 1) and a timer routine (time_to_measure = 1), and a reminder: keep these routines very short, they only take a note. 1: the loop runs measure, show, check. 2: while it shows the reading, the button is pressed — an interrupt. 3: the CPU marks its place in the loop and runs the button routine, which only takes a note. 4: microseconds later it returns to the exact place where the loop stopped. 5: at check, the loop reads that note and the display changes from 24.5 °C to 76.1 °F. 6: each second a timer interrupt notes that it is time to measure.
Foreground interrupts take short notes; the background loop does the work. پێشەوە تێبینیی کورت دەنووسن؛ پشتەوە کارەکە دەکات.CêIT

When one loop is not enough: a small RTOSکاتێک یەک خول بەس نییە: سیستەمێکی وەگەڕخەری کاتی ڕاستەقینەی بچووک

In one big loop, a job must wait for its turn: if one pass of the loop takes 50 ms, a reading can wait up to 50 ms, and every change to the code changes the timing. Devices that juggle more use a small real-time operating system (RTOS). Its scheduler always runs the most urgent task that is ready, so deadlines are met even while a long job is busy (Real time means meeting a deadline).

لە گەورەدا، هەر کارێک دەبێت چاوەڕێی نۆرەی خۆی بکات: ئەگەر یەک سووڕانەوەی ⁦50 ms⁩ بخایەنێت، خوێندنەوەیەک دەکرێت تا ⁦50 ms⁩ چاوەڕێ بکات و هەر گۆڕانێک لە کۆدەکەدا کاتەکان دەگۆڕێت. ئەو ئامێرانەی کاری زیاتر بەڕێوە دەبەن بچووک بەکار دەهێنن. نۆرەدانەکەی هەمیشە بەپەلەترین ئەرکی ئامادە جێبەجێ دەکات، بۆیە کاتە دیاریکراوەکان دەپارێزرێن تەنانەت کاتێک کارێکی درێژ لە کاردایە (کاتی ڕاستەقینە واتە گەیشتن بە کاتی دیاریکراو).

A timeline from 0 to 40 milliseconds with three tasks. High priority, read the motion sensor every 10 ms: short runs at 0, 10, 20 and 30 ms. Medium, send by radio, ready at 13 ms: it runs from 13 to 17 ms. Low, write the log file, a long job: it starts at 1.5 ms but is paused at 10 ms for the sensor, at 13 ms for the radio and at 20 ms for the sensor again, and it finishes at 24 ms. When nothing is ready, the chip sleeps. Orange marks at 10, 13 and 20 ms show where the low task is paused, so the sensor is read on time.هێڵێکی کات لە 0 تا 40 میلیچرکە بە سێ ئەرکەوە. پێشینەیی بەرز، خوێندنەوەی هەستەوەری جووڵە هەموو 10 ms جارێک: جێبەجێکردنی کورت لە 0، 10، 20 و 30 ms. مامناوەند، ناردن بە ڕادیۆ، لە 13 ms ئامادەیە: لە 13 تا 17 ms کار دەکات. نزم، نووسینی فایلی لۆگ، کارێکی درێژ: لە 1.5 ms دەست پێ دەکات بەڵام لە 10 ms بۆ هەستەوەرەکە، لە 13 ms بۆ ڕادیۆکە و لە 20 ms دیسان بۆ هەستەوەرەکە ڕادەگیرێت و لە 24 ms تەواو دەبێت. کاتێک هیچ ئەرکێک ئامادە نییە، چیپەکە دەخەوێت. نیشانە پرتەقاڵییەکان لە 10، 13 و 20 ms ئەو شوێنانە پیشان دەدەن کە ئەرکە نزمەکە ڕادەگیرێت، بۆیە هەستەوەرەکە لە کاتی خۆیدا دەخوێنرێتەوە.
An RTOS pauses a long, less urgent job whenever an urgent one is ready. کارێکی درێژ و کەمتر بەپەلە ڕادەگرێت هەر کاتێک کارێکی بەپەلە ئامادە بێت.CêIT

Two well-known open-source examples: FreeRTOS (MIT licence, maintained by AWS, for more than 40 processor families; Espressif's ESP-IDF for the ESP32 is built on it) and Zephyr (Apache 2.0 licence, more than 1,000 boards). Arm ended Mbed in July 2026, so Arduino moved the boards that used it, such as the GIGA and the Nano 33 BLE, to a new core built on Zephyr; that core became stable in July 2026, and the old Mbed cores are being retired (as of November 2026; The same four, with today's names). A drone's autopilot runs on an RTOS too (The drone's brain).

دوو نموونەی بەناوبانگی : FreeRTOS (مۆڵەتی MIT، AWS بەڕێوەی دەبات، بۆ زیاتر لە ⁦40⁩ خێزانی پرۆسێسەر؛ ⁦ESP-IDF⁩ـی Espressif بۆ ⁦ESP32⁩ لەسەری دروست کراوە) و Zephyr (مۆڵەتی ⁦Apache 2.0⁩، زیاتر لە ⁦1,000⁩ بۆرد). Arm لە تەممووزی ⁦2026⁩دا کۆتایی بە Mbed هێنا، بۆیە Arduino ئەو بۆردانەی Mbedـیان بەکار دەهێنا، وەک GIGA و ⁦Nano 33 BLE⁩، گواستەوە بۆ بنەمایەکی نوێ کە لەسەر Zephyr دروست کراوە. ئەو بنەمایە لە تەممووزی ⁦2026⁩دا جێگیر بوو و بنەما کۆنەکانی Mbed وەلا دەنرێن (تا تشرینی دووەمی ⁦2026⁩؛ هەمان چوارەکە، بە ناوەکانی ئەمڕۆ). لەسەر کار دەکات (مێشکی درۆن).

Firmware updates over the airنوێکردنەوەی بێتەلی پتەوواڵە

Firmware is kept in flash memory, so it can be replaced (Hardware plus software: firmware). Connected devices receive new firmware through their radio — an over-the-air (OTA) update — to fix bugs, close security holes and add features. A safe update never overwrites the only working copy. On an ESP32, for example, the flash has two app slots:

لە هەڵدەگیرێت، بۆیە دەکرێت بگۆڕدرێت (ڕەقەواڵە و نەرمەواڵە: پتەوواڵە). ئامێرە بەستراوەکان نوێ لە ڕێی ڕادیۆکەیانەوە وەردەگرن — ⁦(OTA)⁩ — بۆ چاککردنی ، داخستنی و زیادکردنی تایبەتمەندی. سەلامەت هەرگیز تاکە کۆپیی کارکردوو ناسڕێتەوە. بۆ نموونە لە ⁦ESP32⁩دا، دوو بەشی جیا بۆ هەیە:

  1. The device keeps running the old firmware from slot A while it downloads the new one into slot B.
  2. It checks the file and the maker's digital signature, so a broken or fake file is refused.
  3. It switches its start flag to B and restarts.
  4. If the new firmware fails its self-test, it rolls back to A. A power cut in the middle cannot ruin the device, because the old copy stays whole.
  1. ئامێرەکە بەردەوام کۆن لە بەشی A جێبەجێ دەکات، لە کاتێکدا نوێیەکە بۆ بەشی B دابار دەکات.
  2. فایلەکە و دروستکەر دەپشکنێت، بۆیە فایلی تێکچوو یان ساختە ڕەت دەکرێتەوە.
  3. نیشانەی دەستپێکردنی دەگۆڕێت بۆ B و دووپاتە دەست پێ دەکاتەوە.
  4. ئەگەر نوێیەکە لە تاقیکردنەوەی خۆیدا شکستی هێنا، دەگەڕێتەوە بۆ A. بڕانی کارەبا لە ناوەڕاستدا ناتوانێت ئامێرەکە تێک بدات، چونکە کۆپییە کۆنەکە بە تەواوی دەمێنێتەوە.
An animation in six steps. Left, an update server holding v1.1, signed by the maker. Right, a device whose flash memory has two slots, A and B, and a start flag. 1: the device runs v1.0 from slot A; slot B is empty; the maker publishes v1.1. 2: v1.1 is downloaded into slot B by radio while v1.0 keeps working; 60 percent received. 3: the device checks the maker's digital signature: signature OK; a fake or broken file would stop here. 4: the start flag is switched to B and the device restarts; the new firmware runs a self-test. 5: the self-test passes: v1.1 is confirmed, and v1.0 stays in slot A as a spare. 6: if the test fails, or the power is cut during the update, the device starts v1.0 from A again.
An animation in six steps. Left, an update server holding v1.1, signed by the maker. Right, a device whose flash memory has two slots, A and B, and a start flag. 1: the device runs v1.0 from slot A; slot B is empty; the maker publishes v1.1. 2: v1.1 is downloaded into slot B by radio while v1.0 keeps working; 60 percent received. 3: the device checks the maker's digital signature: signature OK; a fake or broken file would stop here. 4: the start flag is switched to B and the device restarts; the new firmware runs a self-test. 5: the self-test passes: v1.1 is confirmed, and v1.0 stays in slot A as a spare. 6: if the test fails, or the power is cut during the update, the device starts v1.0 from A again.
A safe OTA update: download beside the old copy, check, switch, and keep a way back. سەلامەت: لە تەنیشت کۆپییە کۆنەکە، پشکنین، گۆڕین و هێشتنەوەی ڕێگەیەک بۆ گەڕانەوە.CêIT

Why updates matter so much for security is explained in Updates: closing holes over the air. If new firmware hangs, a watchdog timer resets the board instead of leaving it frozen: see Lab: The Watchdog Timer.

بۆچی ئەوەندە بۆ ئاسایش گرنگن، لە نوێکردنەوە: داخستنی کونەکان بە بێتەلی ڕوون کراوەتەوە. ئەگەر نوێیەکە گیر بخوات، بۆردەکە دەکات لەبری ئەوەی بە گیرخواردوویی بیهێڵێتەوە: بڕوانە تاقیگە: تایمەری پاسەوان.

Firmware updates over the airنوێکردنەوەی بێتەلی پتەوواڵە

Updates and the lawنوێکردنەوە و یاسا

Updates are becoming a legal duty too. Under the EU Cyber Resilience Act, makers have had to report actively exploited security holes in their products since 11 September 2026, and from 11 December 2027 connected products sold in the EU must receive security updates (as of November 2026; When standards meet the law).

خەریکە دەبێتە ئەرکێکی یاساییش. بەپێی ، لە ⁦11⁩ی ئەیلوولی ⁦2026⁩ـەوە دروستکەران دەبێت ئەو ڕاپۆرت بکەن کە لە بەرهەمەکانیاندا بە کردەوە بەکار دەهێنرێن. لە ⁦11⁩ی کانوونی یەکەمی ⁦2027⁩ـیشەوە هەر بەرهەمێکی بەستراو کە لە EU دەفرۆشرێت دەبێت ئاسایش وەربگرێت (تا تشرینی دووەمی ⁦2026⁩؛ کاتێک ستاندارد دەگاتە یاسا).

Why microcontrollers win: five reasonsبۆچی مایکرۆکۆنترۆڵەرەکان سەردەکەون: پێنج هۆ

So in most embedded systems a microcontroller is the best solution, because it offers:

کەواتە لە زۆربەی باشترین چارەسەرە، چونکە ئەمانە دەدات:

  • Low development and manufacturing cost — one cheap chip instead of many; an RP2350 chip cost about one dollar in 2024.
  • Easy porting and updating — porting means moving the program to a different device or a newer version: when a smart fan moves to a newer microcontroller of the same family, most of the code is reused, and new firmware can be sent over the air.
  • A light footprint — it needs little memory, power and space: a small fitness tracker uses very little storage and power.
  • Relatively low power consumption — great for battery devices: a smart door sensor can run for a year on a small battery. The ESP32-C3, for example, draws only about 5 µA in deep sleep.
  • Satisfactory performance for low-end products — a low-end product is basic and cheap, with fewer features or lower performance than others: the lower end of a range. Microcontrollers work well for such simple systems that do not need much computing power.
  • تێچووی کەمی گەشەپێدان و بەرهەمهێنان — هەرزان لەبری چەندین دانە؛ ⁦RP2350⁩ لە ⁦2024⁩دا نزیکەی یەک دۆلار بوو.
  • و ئاسان — واتە گواستنەوەی بۆ ئامێرێکی جیاواز یان وەشانێکی نوێتر: کاتێک پانکەیەکی هۆشمەند دەگوازرێتەوە بۆ نوێتری هەمان خێزان، زۆربەی کۆدەکە دووپاتە بەکار دێتەوە و نوێ دەتوانرێت بە ڕادیۆ بنێردرێت.
  • شوێنپێیەکی سووک — ، وزە و شوێنی کەمی پێویستە: ئامێرێکی بچووکی چاودێریی وەرزش شوێنی خەزنکردن و وزەیەکی زۆر کەم بەکار دەبات.
  • بە بەراورد کەم — بۆ ئامێری پاتریدار زۆر باشە: هۆشمەندی دەرگا دەتوانێت ساڵێک بە بچووک کار بکات. بۆ نموونە ⁦ESP32-C3⁩ لە خەوی قووڵدا تەنیا نزیکەی ⁦5 µA⁩ دەکێشێت.
  • توانای بەس بۆ بەرهەمە سادەکان — بەرهەمی ئاستنزم سادە و هەرزانە، بە تایبەتمەندی یان توانای کەمتر لە بەرهەمەکانی تر: خوارەوەی ڕیزێک بەرهەم. بۆ ئەم جۆرە سیستەمە سادانە باش کار دەکەن کە پێویستیان بە توانای ژمێرکاریی زۆر نییە.
Five cards. Low cost (a stack of coins): one cheap chip instead of many; an RP2350 cost about $1 (2024). Easy porting and updating (an arrow from one chip to a newer one): reuse the code on a newer chip; send new firmware. Light footprint (a feather): little memory, power and space. Low power use (a battery): a door sensor can run for a year on a small battery. Enough for low-end products (a gauge): basic, cheap products need no more speed than this.پێنج کارت. تێچووی کەم (کۆمەڵێک دراو): چیپێکی هەرزان لەبری چەندین دانە؛ RP2350 نزیکەی 1 دۆلار بوو (2024). گواستنەوە و نوێکردنەوەی ئاسان (تیرێک لە چیپێکەوە بۆ یەکێکی نوێتر): گواستنەوەی نەرمەواڵە، کۆدەکە لەسەر چیپێکی نوێتر بەکار بهێنەوە؛ پتەوواڵەیەکی نوێ بنێرە. شوێنپێی سووک (پەڕێک): بیرگە، وزە و شوێنی کەمی پێویستە. بەکارهێنانی وزەی کەم (پاترییەک): هەستەوەرێکی دەرگا دەتوانێت ساڵێک بە پاترییەکی بچووک کار بکات. بەسە بۆ بەرهەمە سادەکان (پێوەرێک): بەرهەمی سادە و هەرزان لەمە زیاتر خێراییان پێویست نییە.
Five reasons microcontrollers win in most embedded systems.پێنج هۆ کە بۆچی لە زۆربەی سەردەکەون.CêIT

Microcontrollers you will meet (as of November 2026)ئەو مایکرۆکۆنترۆڵەرانەی دەیانبینیت (تا تشرینی دووەمی ⁦2026⁩)

These chips are behind the boards of this course and many IoT products (figures from the makers' data sheets). Since the classic picture of one core and no radio, two things changed: many now have two cores, and many carry a radio.

ئەم لە پشت بۆردەکانی ئەم کۆرسە و زۆر بەرهەمی IoTـەوەن (ژمارەکان لە دروستکەرانەوەن). بەراورد بە وێنە کۆنەکەی «یەک ناوک و بێ ڕادیۆ»، دوو شت گۆڕاون: زۆریان ئێستا دوو ناوکیان هەیە و زۆریان ڕادیۆیەک هەڵدەگرن.

Popular IoT microcontrollers, as of November 2026 بەناوبانگی IoT، تا تشرینی دووەمی ⁦2026⁩
Chip (board) (بۆرد)CoresناوکClockMemory on the chip لەسەر Radioڕادیۆ
ATmega328P (Arduino UNO R3)1 × 8-bit AVR⁦1 × AVR⁩ـی 8 16 MHz32 KB flash, 2 KB SRAM, 1 KB EEPROM⁦32 KB⁩ فلاش، ⁦2 KB SRAM⁩، ⁦1 KB EEPROM⁩noneنییە
Renesas RA4M1 (Arduino UNO R4 Minima, WiFi)1 × 32-bit Arm Cortex-M4⁦1 × Arm Cortex-M4⁩ـی ⁦32⁩ 48 MHz256 KB flash, 32 KB SRAM, 8 KB EEPROM⁦256 KB⁩ فلاش، ⁦32 KB SRAM⁩، ⁦8 KB EEPROM⁩none (UNO R4 WiFi: an ESP32-S3 module)نییە (⁦UNO R4 WiFi⁩: مۆدیولێکی ⁦ESP32-S3⁩)
Espressif ESP32-S32 × 32-bit Xtensa LX7⁦2 × Xtensa LX7⁩ـی ⁦32⁩ up to 240 MHzتا ⁦240 MHz⁩512 KB SRAMWi-Fi 4, Bluetooth LE 5
Espressif ESP32-C31 × 32-bit RISC-V⁦1 × RISC-V⁩ـی ⁦32⁩ up to 160 MHzتا ⁦160 MHz⁩400 KB SRAMWi-Fi 4, Bluetooth LE 5
Espressif ESP32-C632-bit RISC-V + a low-power core⁦RISC-V⁩ـی ⁦32⁩ + ناوکێکی کەمخەرجup to 160 MHzتا ⁦160 MHz⁩512 KB SRAMWi-Fi 6, Bluetooth LE 5, Thread, Zigbee
Raspberry Pi RP2350 (Pico 2)2 × Arm Cortex-M33, or 2 × Hazard3 RISC-V⁦2 × Arm Cortex-M33⁩، یان ⁦2 × Hazard3 RISC-V⁩150 MHz520 KB SRAM; 4 MB flash on the board⁦520 KB SRAM⁩؛ ⁦4 MB⁩ فلاش لەسەر بۆردەکەnone (Pico 2 W: Wi-Fi, Bluetooth 5.2)نییە (⁦Pico 2 W⁩: ، ⁦Bluetooth 5.2⁩)

The boards themselves — pins, 3.3 V or 5 V, USB and the Arduino IDE — come in Arduino Boards and the Arduino IDE; your first sketch, in Lab: Blink an LED.

بۆردەکان خۆیان — پین، ⁦3.3 V⁩ یان ⁦5 V⁩، USB و Arduino IDE — لە بۆردەکانی Arduino و Arduino IDE دێن؛ یەکەم لە تاقیگە: هەڵکردنی LEDـێک دەنووسیت.

Raspberry Pi 5: a computer, not a microcontroller⁦Raspberry Pi 5⁩: کۆمپیوتەرێکە، نەک مایکرۆکۆنترۆڵەر

People often put a Raspberry Pi and an Arduino in the same box, but they are different kinds of machine. The Raspberry Pi 5 (October 2023) is a single-board computer. Its Broadcom BCM2712 is a system on a chip with four 64-bit Arm Cortex-A76 cores at 2.4 GHz — the same kind of cores as in phones. Its RAM (1 to 16 GB) is a separate chip, its programs and files sit on a microSD card or an SSD, and it boots a full operating system, Raspberry Pi OS (Linux). It needs a 5 V, 5 A (27 W) power supply.

خەڵک زۆرجار Raspberry Pi و Arduino لە یەک سندووقدا دادەنێن، بەڵام دوو جۆر ئامێری جیاوازن. ⁦Raspberry Pi 5⁩ (ئۆکتۆبەری ⁦2023⁩) . ⁦BCM2712⁩ـی Broadcom بە چوار ناوکی ⁦Arm Cortex-A76⁩ـی ⁦64⁩ لەسەر ⁦2.4 GHz⁩ — هەمان جۆرە ناوکی ناو مۆبایل. (⁦1⁩ تا ⁦16 GB⁩) جیایە، و لەسەر microSD یان SSDـیەکن و تەواو، ⁦Raspberry Pi OS (Linux)⁩، بووت دەکات. پێویستی بە ⁦5 V⁩، ⁦5 A (27 W)⁩ هەیە.

The Raspberry Pi Pico 2 (August 2024) is a microcontroller board: its RP2350 holds the cores and 520 KB of SRAM on one chip, runs one program from flash as soon as it has power, needs no operating system and is happy with the power from a USB port. Both boards have GPIO pins; what decides is the chip.

⁦Raspberry Pi Pico 2⁩ (ئابی ⁦2024⁩) : ⁦RP2350⁩ـەکەی ناوکەکان و ⁦520 KB⁩ لەسەر یەک هەڵدەگرێت، هەر کە کارەبای پێ گەیشت لە فلاشەوە جێبەجێ دەکات، پێویستی بە نییە و کارەبای دەرچەیەکی USB بەسیەتی. هەردوو بۆردەکە هەیە؛ ئەوەی بڕیار دەدات .

Two boards. Left, Raspberry Pi Pico 2, a microcontroller board: a narrow board with a USB socket, rows of pins along both sides, an RP2350 chip (2 cores, 520 KB SRAM, I/O and ADC) and a separate 4 MB flash chip. Notes: runs one program from flash, no OS; starts as soon as it has power; a USB port is enough power. Right, Raspberry Pi 5, a single-board computer: a larger board with a 40-pin GPIO header, a BCM2712 system on a chip (4 Cortex-A76 cores at 2.4 GHz and a GPU), a separate RAM chip of 1 to 16 GB, an RP1 I/O chip, USB and network ports, a microSD slot, two HDMI outputs and a 27 W USB-C power input. Notes: boots Linux (Raspberry Pi OS) from the card; RAM and storage are separate chips; needs a 5 V, 5 A (27 W) power supply. Below: both have GPIO pins; what decides is the chip — a microcontroller, or a SoC with powerful cores that runs a full OS.دوو بۆرد. چەپ، Raspberry Pi Pico 2، بۆردێکی گەشەپێدانی مایکرۆکۆنترۆڵەر: بۆردێکی باریک بە سۆکێتی USB، ڕیزی پین بە هەردوو لادا، چیپێکی RP2350 (2 ناوک، 520 KB SRAM، I/O و ADC) و چیپێکی جیای 4 MB فلاش. تێبینییەکان: بەرنامەیەک لە فلاشەوە جێبەجێ دەکات، بێ سیستەمی وەگەڕخەر؛ هەر کە کارەبای پێ گەیشت دەست پێ دەکات؛ دەرچەیەکی USB بەسە بۆ کارەباکەی. ڕاست، Raspberry Pi 5، کۆمپیوتەرێکی تاکبۆرد: بۆردێکی گەورەتر بە ڕیزێک لە 40 پینی GPIOـەوە، سیستەم لەسەر چیپی BCM2712 (4 ناوکی Cortex-A76 لەسەر 2.4 GHz و GPU)، چیپێکی جیای RAM بە 1 تا 16 GB، چیپێکی I/Oـی RP1، دەرچەکانی USB و ڕایەڵە، شوێنی کارتی microSD، دوو دەرچەی HDMI و دەرچەی کارەبای USB-C بە 27 W. تێبینییەکان: Linux (Raspberry Pi OS) لە کارتەکەوە بووت دەکات؛ RAM و شوێنی خەزنکردن چیپی جیان؛ پێویستی بە سەرچاوەیەکی وزەی 5 V، 5 A (27 W) هەیە. لە خوارەوە: هەردووکیان پینەکانی GPIOـیان هەیە؛ ئەوەی بڕیار دەدات چیپەکەیە — مایکرۆکۆنترۆڵەرێک، یان سیستەم لەسەر چیپ بە ناوکی بەهێزەوە کە سیستەمێکی وەگەڕخەری تەواو جێبەجێ دەکات.
Same maker, two kinds of machine: a microcontroller board and a single-board computer.یەک دروستکەر، دوو جۆر ئامێر: و .CêIT

Raspberry Pi 5: a computer, not a microcontroller⁦Raspberry Pi 5⁩: کۆمپیوتەرێکە، نەک مایکرۆکۆنترۆڵەر

Cortex-M or Cortex-A?⁦Cortex-M⁩ یان ⁦Cortex-A⁩؟

Arm, whose designs are inside most of the chips above, sorts its processor cores into three families. Cortex-M cores are made for microcontrollers: low power, quick and predictable reactions to interrupts — a Cortex-M4 starts its interrupt routine about 12 clock cycles after the signal, a quarter of a microsecond at the UNO R4's 48 MHz — and no memory management unit (MMU) for virtual memory, so they run firmware with no OS or with an RTOS. Cortex-A cores are application processors: with an MMU they run Linux and Android, as in phones and the Raspberry Pi 5. Cortex-R cores sit between them, for hard real-time jobs such as car safety systems, modems and storage controllers.

Arm، کە دیزاینەکانی لەناو زۆربەی ئەو سەرەوەدایە، خۆی دەکات بە سێ خێزان. ناوکەکانی ⁦Cortex-M⁩ بۆ دروست کراون: وزەی کەم، کاردانەوەی خێرا و پێشبینیکراو بۆ — ⁦Cortex-M4⁩ نزیکەی ⁦12⁩ لێدانی کاتژمێر دوای دەست پێ دەکات، واتە چارەکە مایکرۆچرکەیەک لەسەر ⁦48 MHz⁩ـی ⁦UNO R4⁩ — و MMUـیان نییە (ئەو بەشەی دابین دەکات)، بۆیە بێ یان لەگەڵ جێبەجێ دەکەن. ناوکەکانی ⁦Cortex-A⁩ بۆ و سیستەمی گەورەن: بە MMUـەوە Linux و Android جێبەجێ دەکەن، وەک لە مۆبایل و ⁦Raspberry Pi 5⁩دا. ناوکەکانی ⁦Cortex-R⁩ لە نێوانیاندان، بۆ کاری توند وەک سیستەمەکانی سەلامەتیی ئۆتۆمبێل، مۆدێم و کۆنترۆڵکەری خەزنکردن.

Three columns. Cortex-M, for microcontrollers: no MMU, so no virtual memory; fast, predictable interrupts; no OS, or an RTOS; microwatts to milliwatts; examples: UNO R4 (M4), Pico 2 (M33), sensors and wearables. Cortex-R, for hard real time: built for safety and strict deadlines; usually an RTOS; car safety systems, modems, storage controllers. Cortex-A, for applications: has an MMU for virtual memory; runs Linux and Android; many apps at once; watts; phones and the Raspberry Pi 5 (A76). An arrow below: more performance, more power.سێ ستوون. Cortex-M، بۆ مایکرۆکۆنترۆڵەرەکان: MMU نییە، بۆیە بیرگەی گریمانەیی نییە؛ پچڕاندنی خێرا و پێشبینیکراو؛ بێ سیستەمی وەگەڕخەر، یان RTOS؛ مایکرۆوات تا میلیوات؛ نموونەکان: UNO R4 (M4)، Pico 2 (M33)، هەستەوەرەکان و ئامێرە لەبەرکراوەکان. Cortex-R، بۆ کاتی ڕاستەقینەی توند: بۆ سەلامەتی و کاتی دیاریکراوی توند دروست کراوە؛ زۆرجار RTOS؛ سیستەمەکانی سەلامەتیی ئۆتۆمبێل، مۆدێم، کۆنترۆڵکەری خەزنکردن. Cortex-A، بۆ ئەپەکان: MMUـی هەیە بۆ بیرگەی گریمانەیی؛ Linux و Android جێبەجێ دەکات؛ چەندین ئەپ پێکەوە؛ وات؛ مۆبایل و Raspberry Pi 5 (A76). تیرێک لە خوارەوە: توانای زیاتر، وزەی زیاتر.
Arm's M, R and A families: microcontroller, real-time and application cores.خێزانەکانی M، R و Aـی Arm: ناوکی ، و .CêIT

Common mistakesهەڵە باوەکان

MistakeهەڵەBetterباشتر
"A microprocessor has exactly one core."«مایکرۆپرۆسێسەر تەنیا یەک ناوکی هەیە.»Early ones did; today's have many — the Core i9-13900K has 24. A microprocessor is one or more cores on one chip.یەکەمەکان وا بوون؛ ئەوانەی ئەمڕۆ چەندین ناوکیان هەیە — ⁦Core i9-13900K 24⁩ ناوکی هەیە. مایکرۆپرۆسێسەر یەک یان چەند ناوکە لەسەر یەک .
"A microcontroller is just a slow microprocessor."« تەنیا مایکرۆپرۆسێسەرێکی هێواشە.»It is a whole small computer: a core plus memory, inputs, outputs and timers on one chip. بچووکی تەواوە: ناوکێک لەگەڵ ، ، و لەسەر یەک .
"A Raspberry Pi 5 is a big Arduino."«⁦Raspberry Pi 5 Arduino⁩ـیەکی گەورەیە.»It is a single-board computer that runs Linux. The Pico 2 and the Arduino boards are microcontroller boards. کە Linux جێبەجێ دەکات. ⁦Pico 2⁩ و بۆردەکانی Arduino .
"Embedded code is mostly written in Java."«کۆدی زۆربەی بە Java دەنووسرێت.»Mostly C and C++, with a little assembly, and MicroPython on larger chips. Java needs a virtual machine and is rare on microcontrollers.زۆربەی بە C و ⁦C++⁩، لەگەڵ کەمێک و MicroPython لەسەر گەورەتر. Java پێویستی بە هەیە و لەسەر دەگمەنە.
"Without an operating system a chip can do only one thing."«بێ تەنیا دەتوانێت یەک کار بکات.»A main loop with interrupts, or a small RTOS, handles several jobs on time. سەرەکی لەگەڵ ، یان بچووک، چەند کارێک لە کاتی خۆیدا بەڕێوە دەبات.
"An interrupt routine should do all the work."« دەبێت هەموو کارەکە بکات.»Keep it very short: take a note and return. The main loop does the rest.زۆر کورتی بکەرەوە: تێبینییەک بنووسە و بگەڕێوە. سەرەکی ئەوەی تر دەکات.
"An OTA update simply overwrites the old firmware."« بە سادەیی کۆن دەسڕێتەوە.»A safe update writes the new version beside the old one, checks its signature and keeps the old one to roll back to. سەلامەت وەشانە نوێیەکە لە تەنیشت کۆنەکە دەنووسێت، واژووەکەی دەپشکنێت و کۆنەکە دەهێڵێتەوە بۆ گەڕانەوە.

Exercisesڕاهێنانەکان

ExerciseڕاهێنانMicrocontroller or microprocessor?مایکرۆکۆنترۆڵەر یان مایکرۆپرۆسێسەر؟

For each chip, say whether it is a microcontroller, a microprocessor or the system on a chip of a single-board computer, and give one reason: (a) ATmega328P; (b) Intel Core i9-13900K; (c) RP2350; (d) Broadcom BCM2712; (e) ESP32-C3; (f) Intel 4004.

بۆ هەر بڵێ ، مایکرۆپرۆسێسەرە یان ؛ هۆیەکیش بهێنەوە: (أ) ⁦ATmega328P⁩؛ (ب) ⁦Intel Core i9-13900K⁩؛ (ج) ⁦RP2350⁩؛ (د) ⁦Broadcom BCM2712⁩؛ (ه) ⁦ESP32-C3⁩؛ (و) ⁦Intel 4004⁩.

Show answerوەڵامەکە پیشان بدە
  • (a) microcontroller — 32 KB of flash, 2 KB of SRAM and 23 I/O pins on the chip;
  • (b) microprocessor — 24 fast cores, but its RAM, storage and I/O are other chips;
  • (c) microcontroller — 520 KB of SRAM and I/O on the chip; it runs one program from flash;
  • (d) the system on a chip of a single-board computer (Raspberry Pi 5) — Cortex-A cores, separate RAM, runs Linux;
  • (e) microcontroller — a RISC-V core, 400 KB of SRAM and a Wi-Fi and Bluetooth radio on one chip;
  • (f) microprocessor — it needed separate ROM, RAM and I/O chips.
  • (أ) — ⁦32 KB⁩ ، ⁦2 KB⁩ و ⁦23⁩ پینی ⁦I/O⁩ لەسەر ؛
  • (ب) مایکرۆپرۆسێسەر — ⁦24⁩ ناوکی خێرا، بەڵام RAM، شوێنی خەزنکردن و ⁦I/O⁩ـەکەی ترن؛
  • (ج) — ⁦520 KB⁩ و ⁦I/O⁩ لەسەر ؛ لە فلاشەوە جێبەجێ دەکات؛
  • (د) ⁦(Raspberry Pi 5)⁩ — ناوکی ⁦Cortex-A⁩، RAMـی جیا، Linux جێبەجێ دەکات؛
  • (ه) — ناوکێکی ⁦RISC-V⁩، ⁦400 KB⁩ و ڕادیۆیەکی و Bluetooth لەسەر یەک ؛
  • (و) مایکرۆپرۆسێسەر — پێویستی بە جیای ROM، RAM و ⁦I/O⁩ بوو.
ExerciseڕاهێنانHow much more memory?چەند جار بیرگە زیاتر؟

An Arduino UNO R3 has 2 KB of SRAM; a Raspberry Pi 5 can have 8 GB of RAM. How many times more memory is that? (1 KB = 1,024 bytes; 1 GB = 1,024 × 1,024 × 1,024 bytes.)

⁦Arduino UNO R3 2 KB⁩ هەیە؛ ⁦Raspberry Pi 5⁩ دەتوانێت ⁦8 GB RAM⁩ـی هەبێت. ئەمە چەند جار زیاترە؟ (⁦1 KB = 1,024⁩ ؛ ⁦1 GB = 1,024 × 1,024 × 1,024⁩ .)

Hintئاماژە

Write both in powers of two: 2 KB = 2×2102 \times 2^{10} bytes and 8 GB = 8×2308 \times 2^{30} bytes.

هەردووکیان بە توانی 2 بنووسە: ⁦2 KB⁩ = 2×2102 \times 2^{10} و ⁦8 GB⁩ = 8×2308 \times 2^{30} .

Show answerوەڵامەکە پیشان بدە
8×2302×210=4×220=4 194 304\frac{8 \times 2^{30}}{2 \times 2^{10}} = 4 \times 2^{20} = 4\,194\,304

About 4.2 million times more memory, and the Pi's RAM is a separate chip, while the UNO's 2 KB sit inside the microcontroller.

نزیکەی ⁦4.2⁩ ملیۆن جار زیاتر. هەروەها RAMـی Raspberry Pi جیایە، لە کاتێکدا ⁦2 KB⁩ـەکەی UNO لەناو .

ExerciseڕاهێنانChoose the chipچیپەکە هەڵبژێرە

Choose a chip from this lesson for each product and give one reason: (a) a soil-moisture sensor in a field that must run on two AA batteries for years; (b) a Matter smart plug that speaks Wi-Fi and Thread; (c) a door camera that recognises faces itself and serves a web page; (d) a remote-control toy car.

بۆ هەر بەرهەمێک لەم وانەیە هەڵبژێرە و هۆیەک بهێنەوە: (أ) شێی خاک لە کێڵگەیەکدا کە دەبێت چەند ساڵێک بە دوو پاتریی AA کار بکات؛ (ب) Matter کە بە و Thread قسە دەکات؛ (ج) کامێرایەکی دەرگا کە خۆی ڕووخسارەکان دەناسێتەوە و پەڕەیەکی وێب پیشکەش دەکات؛ (د) ئۆتۆمبێلێکی یاریی کە بە ڕیمۆت دەڕوات.

Show answerوەڵامەکە پیشان بدە
  • (a) a low-power microcontroller that sleeps between readings — it draws microamperes while asleep; the radio is chosen in Range, Speed and Power;
  • (b) the ESP32-C6 — Wi-Fi 6 and an IEEE 802.15.4 radio for Thread on one chip;
  • (c) a single-board computer such as the Raspberry Pi 5 — video and face recognition need fast application cores, gigabytes of RAM and Linux;
  • (d) a small microcontroller such as the ATmega328P or the RP2350 — it only reads the radio receiver and drives the motors.
  • (أ) کەمخەرج کە لە نێوان خوێندنەوەکاندا دەخەوێت — لە چەند مایکرۆئەمپێرێک دەکێشێت؛ ڕادیۆکە لە هەڵبژاردنی تەکنەلۆجیایەکی بێتەل هەڵدەبژێردرێت؛
  • (ب) ⁦ESP32-C6⁩ — 6 و ڕادیۆیەکی ⁦IEEE 802.15.4⁩ بۆ Thread لەسەر یەک ؛
  • (ج) وەک ⁦Raspberry Pi 5⁩ — ڤیدیۆ و پێویستیان بە ناوکی خێرا، چەند گیگابایتێک RAM و Linux هەیە؛
  • (د) بچووک وەک ⁦ATmega328P⁩ یان ⁦RP2350⁩ — تەنیا دەخوێنێتەوە و کار پێ دەکات.
ExerciseڕاهێنانForeground or background?پێشەوە یان پشتەوە؟

A digital thermometer measures every second, shows the reading, switches between Celsius and Fahrenheit when its button is pressed, and beeps when the reading is steady. Which jobs go into interrupt routines, and which into the main loop? Why?

گەرمیپێوێکی دیجیتاڵی هەموو چرکەیەک دەپێوێت، خوێندنەوەکە پیشان دەدات، کاتێک دادەگیرێت لە نێوان سیلیزی و فەهرەنهایتدا دەگۆڕێت و کاتێک خوێندنەوەکە جێگیر بوو بیپ دەکات. کام کارانە دەچنە ناو و کامیان دەچنە ناو سەرەکی؟ بۆچی؟

Show answerوەڵامەکە پیشان بدە

Interrupt routines (foreground): the timer tick every second and the button press — each one only takes a note (sets a flag). Main loop (background): reading the sensor, converting and showing the value, switching the unit when the button note is set, and beeping. The routines stay short so that no interrupt is missed; the slower work waits for its turn in the loop.

(پێشەوە): لێدانی هەموو چرکەیەک و پەستانی — هەریەکەیان تەنیا تێبینییەک دەنووسێت (ئاڵایەک دادەنێت). سەرەکی (پشتەوە): خوێندنەوەی ، گۆڕین و پیشاندانی بەهاکە، گۆڕینی یەکەکە کاتێک تێبینیی هەیە، هەروەها بیپکردن. کورت دەمێننەوە بۆ ئەوەی هیچ لەدەست نەچێت؛ کارە هێواشترەکان چاوەڕێی نۆرەی خۆیان لە دەکەن.

Summaryپوختە

  • A microprocessor is one or more CPU cores on one chip: it fetches, decodes and executes, but its memory and I/O are other chips — from the Intel 4004 (1971, 4-bit) to today's 24-core, 64-bit desktop chips.
  • A microcontroller is a whole small computer on one chip: a core with flash, SRAM, often EEPROM, digital and analog I/O, timers and serial ports — such as the ATmega328P (16 MHz, 32 KB flash, 2 KB SRAM).
  • Constraints lead embedded systems to microcontrollers, to C and C++ (with a little assembly) and to no OS — a main loop with interrupts, the foreground/background system — or a small RTOS such as FreeRTOS or Zephyr.
  • Firmware in flash can be updated over the air; a safe update keeps the old copy, checks the digital signature and can roll back.
  • Microcontrollers win on cost, porting and updating, footprint, power and good-enough performance. In 2026 many have two cores and a radio (ESP32-S3, ESP32-C6, RP2350); the Raspberry Pi 5 is a single-board computer with Cortex-A cores, not a microcontroller.
  • مایکرۆپرۆسێسەر یەک یان چەند ناوکی لەسەر یەک : دەهێنێت، شی دەکاتەوە و جێبەجێ دەکات، بەڵام و ⁦I/O⁩ـەکەی ترن — لە ⁦Intel 4004⁩ـەوە (⁦1971⁩، 4 ) تا مێزیی ⁦24⁩ ناوکی و ⁦64⁩ ئەمڕۆ.
  • بچووکی تەواوە لەسەر یەک : ناوکێک لەگەڵ ، ، زۆرجار ، ⁦I/O⁩ـی دیجیتاڵ و ، و دەرچەکانی — وەک ⁦ATmega328P (16 MHz⁩، ⁦32 KB⁩ فلاش، ⁦2 KB SRAM⁩).
  • سنوورەکان دەبەن بەرەو ، C و ⁦C++⁩ (لەگەڵ کەمێک ) و بێ — سەرەکی لەگەڵ ، واتە سیستەمی پێشەوە و پشتەوە — یان بچووکی وەک FreeRTOS یان Zephyr.
  • لە دەکرێت بە ڕادیۆ نوێ بکرێتەوە؛ سەلامەت کۆپییە کۆنەکە دەهێڵێتەوە، دەپشکنێت و دەتوانێت بگەڕێتەوە.
  • بە تێچوو، و ، شوێنپێ، وزە و توانای بەس سەردەکەون. لە ⁦2026⁩دا زۆریان دوو ناوک و ڕادیۆیەکیان هەیە (⁦ESP32-S3⁩، ⁦ESP32-C6⁩، ⁦RP2350⁩)؛ ⁦Raspberry Pi 5⁩ بە ناوکی ⁦Cortex-A⁩، نەک .
Review questionsپرسیارەکانی پێداچوونەوە
What is the difference between a microprocessor and a microcontroller?جیاوازیی نێوان مایکرۆپرۆسێسەر و مایکرۆکۆنترۆڵەر چییە؟

A microprocessor is CPU cores on a chip that need separate memory and I/O chips; a microcontroller puts the core, memory, inputs, outputs and timers on one chip.

مایکرۆپرۆسێسەر ناوکی لەسەر کە پێویستی بە جیای و ⁦I/O⁩ هەیە؛ ناوک، ، ، و دەخاتە سەر یەک .

What is a foreground/background system?سیستەمی پێشەوە و پشتەوە چییە؟

Firmware with no operating system: a main loop does the jobs one after another (the background), and short interrupt routines handle urgent events at once (the foreground).

بێ : سەرەکی کارەکان یەک لە دوای یەک دەکات (پشتەوە) و کورتی ڕووداوە بەپەلەکان یەکسەر بەڕێوە دەبەن (پێشەوە).

Why do Cortex-M cores not run Linux?بۆچی ناوکەکانی ⁦Cortex-M Linux⁩ جێبەجێ ناکەن؟

They have no memory management unit for virtual memory, which Linux needs; they run firmware with no OS or a small RTOS.

MMUـیان نییە بۆ ، کە Linux پێویستی پێیەتی؛ بێ یان لەگەڵ بچووک جێبەجێ دەکەن.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Arduino Boards and the Arduino IDEبۆردەکانی Arduino و Arduino IDE

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.