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

What Is an Embedded System?سیستەمی چەسپێنراو چییە؟

Most computers are hidden inside other machines. Compare general-purpose and embedded computers, see why firmware lives in a chip's flash memory, watch a tiny firmware program show one byte on eight LEDs, follow input, process and output through a microwave oven, and learn the three marks of an embedded system — including real time: not late, and not too early.

زۆربەی لەناو ئامێرەکانی تردا شاراونەتەوە. و چەسپێنراو بەراورد بکە، ببینە بۆچی لە دەژی، سەیری زۆر بچووک بکە کە یەک لەسەر هەشت پیشان دەدات، ، و لە مایکرۆوەیڤێکدا ببینە و سێ نیشانەکەی فێر ببە — لەوانە : نە دواکەوتوو و نە زووتر.

15 min read15 خولەک خوێندنەوە · 13 stepsهەنگاو

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

  • Compare general-purpose computers and embedded computers mark by mark.
  • Explain what firmware is and why today it is usually kept in flash memory.
  • Read a short firmware sketch and write one byte in decimal, hexadecimal and binary.
  • Name the inputs, processing and outputs of an embedded computer.
  • Give the three marks of an embedded system and explain real-time constraints.
  • و چەسپێنراوەکان نیشانە بە نیشانە بەراورد بکەیت.
  • ڕوون بکەیتەوە چییە و بۆچی ئەمڕۆ زۆرجار لە هەڵدەگیرێت.
  • کورتی بخوێنیتەوە و یەک بە ، و بنووسیت.
  • ، و چەسپێنراو ناو ببەیت.
  • سێ نیشانەکەی بڵێیت و سنووری ڕوون بکەیتەوە.

Computers you never seeئەو کۆمپیوتەرانەی هەرگیز نایانبینیت

How many computers are there in your home? Most people count a laptop and a few phones. But the washing machine, the microwave, the TV remote, the Wi-Fi router, the family car and even a digital thermometer each hide a small computer too. These hidden computers are embedded computers: each one is built into another machine and does one job for it.

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

So computers come in two big families. General-purpose computers — laptops, desktops, workstations, phones, tablets and servers — run whatever program you choose. Embedded computers sit inside cars, home appliances, cameras, TVs, game consoles, music players, office machines, medical equipment, robots, aircraft and communication equipment, and you rarely notice them. There are far more of them (Wearables and embedded computers).

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

Two rings. A small blue ring labelled general-purpose computers holds a laptop, a phone, a tablet, a server and a desktop computer, with the words: a few, and you see each one. A much bigger teal ring labelled embedded computers holds a car, a washing machine, a microwave, a camera, a TV, a game controller, an aeroplane, a medical monitor, a robot arm, a music player, a printer and a router, with the words: billions, hidden inside other machines.دوو بازنە. بازنەیەکی شینی بچووک بە ناوی کۆمپیوتەرە گشتییەکان کە لاپتۆپ، مۆبایل، تابلێت، ڕاژەکار و کۆمپیوتەری مێزی تێدایە، لەگەڵ ئەم وشانە: چەند دانەیەک و هەموویان دەبینیت. بازنەیەکی سەوزی زۆر گەورەتر بە ناوی کۆمپیوتەرە چەسپێنراوەکان کە ئۆتۆمبێل، جلشۆر، مایکرۆوەیڤ، کامێرا، تیڤی، دەسکی یاری، فڕۆکە، ئامێری چاودێریی پزیشکی، بازووی ڕۆبۆت، ئامێری مۆسیقا، چاپەر و ڕێدۆز تێدایە، لەگەڵ ئەم وشانە: ملیاران و لەناو ئامێرەکانی تردا شاراونەتەوە.
General-purpose computers are the few you see; embedded computers are the many you do not. ئەو کەمانەن کە دەیانبینیت؛ چەسپێنراوەکان ئەو زۆرانەن کە نایانبینیت.CêIT

The general-purpose computer: one machine, many jobsکۆمپیوتەری گشتی: یەک ئامێر، چەندین کار

A general-purpose computer is built to run many kinds of software: a report in the morning, a film at lunch, a game at night. Its marks:

بۆ جێبەجێکردنی چەندین جۆری دروست کراوە: بەیانی ڕاپۆرتێک، نیوەڕۆ فیلمێک، شەو یارییەک. نیشانەکانی:

  • It runs a variety of software and needs an operating system (Windows, macOS, Linux, Android, iOS) to share the hardware between the programs.
  • It is designed for heavy user interaction: you type, click, touch and watch for hours.
  • It is expensive: hundreds to thousands of dollars.
  • Its hardware is relatively powerful — relatively means compared with something else, here with embedded computers: a fast processor and plenty of storage for data and programs.
  • It uses many peripherals: a display, a keyboard, a mouse, an internet connection, Wi-Fi and Bluetooth.
  • Its work is spread over many chips (ICs, integrated circuits) — a distributed design: one chip is the CPU; others hold the working data (RAM) and the storage where Windows, games, apps, photos and videos are kept.
  • جۆراوجۆر جێبەجێ دەکات و پێویستی بە هەیە (Windows، macOS، Linux، Android، iOS) بۆ ئەوەی لە نێوان دابەش بکات.
  • بۆ کارلێکی زۆری دیزاین کراوە: بە کاتژمێر دەنووسیت، کلیک دەکەیت، دەست لێ دەدەیت و سەیر دەکەیت.
  • گرانە: سەدان تا هەزاران دۆلار.
  • بە بەراورد بەهێزە — بە بەراورد واتە بەراورد لەگەڵ شتێکی تر، لێرەدا لەگەڵ چەسپێنراوەکان: پرۆسێسەرێکی خێرا و جێگەیەکی زۆر بۆ و .
  • چەندین بەکار دەهێنێت: ، ، ، پەیوەندیی ، و Bluetooth.
  • کارەکەی بەسەر چەندین دابەش کراوە (IC، بازنەی تێکەڵکراو) — دیزاینێکی دابەشکراو: ؛ ئەوانی تر کاتی () و ئەو Windows، یاری، ، وێنە و ڤیدیۆی تێدا هەڵدەگیرێت.
Inside a laptop's main board: separate chips for the CPU (runs the programs), RAM (working data), a GPU (pictures), an SSD (Windows, apps, photos and files), Wi-Fi (radio) and USB (ports). Around the board are a display, a keyboard, wireless and a mouse or touchpad. A note says each job sits on its own chip, a distributed design, and that phones put most of these into one system on a chip.ناو بۆردی سەرەکیی لاپتۆپێک: چیپەکانی جیاواز بۆ CPU (بەرنامەکان جێبەجێ دەکات)، RAM (دراوەی کاتی)، GPU (وێنە)، SSD (Windows، ئەپ، وێنە و فایل)، وای‌فای (ڕادیۆ) و USB (دەرچەکان). لە دەوری بۆردەکە شاشە، کیبۆرد، بێتەل و ماوس یان تاچپاد هەن. تێبینییەک دەڵێت هەر کارێک لەسەر چیپی خۆیەتی، کە دیزاینێکی دابەشکراوە. مۆبایل زۆربەیانی لە یەک سیستەم لەسەر چیپدا کۆ دەکاتەوە.
A general-purpose computer spreads its work over many chips. کارەکەی بەسەر چەندین دابەش دەکات.CêIT

The embedded computer: one machine, one jobکۆمپیوتەری چەسپێنراو: یەک ئامێر، یەک کار

An embedded computer is application-specific: it is made for one purpose and built into a larger system, such as a washing machine. Its marks:

چەسپێنراو تایبەت بە یەک بەکارهێنانە: بۆ یەک مەبەست دروست کراوە و لەناو سیستەمێکی گەورەتردا دانراوە، وەک جلشۆرێک. نیشانەکانی:

  • It often has real-time limits: it must act at the right moment.
  • Its resources — processor, memory, inputs and outputs — can sit on a single chip.
  • That chip carries its own peripherals: timers, analog-to-digital converters (ADC), digital-to-analog converters (DAC) and serial interfaces.
  • It is small, so it is very versatile: it fits almost anywhere, even inside tiny devices.
  • It contains firmware: only the software it needs, not meant to change often.
  • It may run a real-time operating system (RTOS) that schedules its tasks — or no operating system at all.
  • It is cheap: from tens of cents to a few dollars.
  • زۆرجار سنووری هەیە: دەبێت لە ساتی گونجاودا کار بکات.
  • سەرچاوەکانی — پرۆسێسەر، ، و — دەتوانن لەسەر یەک بن.
  • ئەو خۆی هەیە: ، ⁦(ADC)⁩، ⁦(DAC)⁩ و .
  • بچووکە، بۆیە بۆ زۆر شوێن دەست دەدات: نزیکەی لە هەموو شوێنێک جێی دەبێتەوە، تەنانەت لەناو ئامێری زۆر بچووکیشدا.
  • تێدایە: تەنیا ئەو پێویستیەتی، کە بۆ ئەوە نییە زوو زوو بگۆڕێت.
  • لەوانەیە جێبەجێ بکات کە ئەرکەکانی ڕێک دەخات — یان هیچ نەبێت.
  • هەرزانە: لە چەند دە سەنتێکەوە تا چەند دۆلارێک.
A washing machine on the left; its small control board is zoomed in on the right. The board's chip is a microcontroller holding a CPU core, flash memory with the wash programs, timers, an ADC, a DAC and a serial port, all on one chip. Blue arrows bring inputs from a temperature sensor, a water-level sensor and the buttons and display. Orange arrows go out to the water valve, the heater and the drum motor. A note says: one job, a small program, a chip that costs a few dollars.جلشۆرێک لە لای چەپ؛ بۆردە بچووکەکەی کۆنترۆڵی لە لای ڕاست گەورە کراوە. چیپی بۆردەکە مایکرۆکۆنترۆڵەرێکە کە ناوکی پرۆسێسەر، فلاش مێمۆری بە بەرنامەکانی شۆردنەوە، تایمەرەکان، ADC، DAC و پەیوەندیی زنجیرەیی تێدایە، هەمووی لەسەر یەک چیپ. تیرە شینەکان نێوخستەکان دەهێنن لە هەستەوەری پلەی گەرمی، هەستەوەری ئاستی ئاو و دوگمەکان و شاشەکەوە. تیرە پرتەقاڵییەکان دەچن بۆ سەمامەی ئاو، گەرمکەرەوە و ماتۆڕی سووڕاندن. تێبینییەک دەڵێت: یەک کار، بەرنامەیەکی بچووک، چیپێک بە چەند دۆلارێک.
The washing machine's embedded computer: one chip with its own peripherals. چەسپێنراوی جلشۆر: یەک بە خۆیەوە.CêIT

The embedded computer: one machine, one jobکۆمپیوتەری چەسپێنراو: یەک ئامێر، یەک کار

Side by sideلە تەنیشت یەکتر

The two families compared, mark by mark:

دوو خێزانەکە بەراورد کراون، نیشانە بە نیشانە:

Embedded and general-purpose computers چەسپێنراو و
MarkنیشانەEmbedded computer چەسپێنراوGeneral-purpose computer
Jobکارone job, embedded in the system it controlsیەک کار، چەسپێنراو لەناو ئەو سیستەمەی کۆنترۆڵی دەکاتmany jobs: any software you installچەندین کار: هەر دایبەزێنیت
Performanceتواناenough to get its one job doneبەس بۆ تەواوکردنی یەک کارەکەیenough for many kinds of softwareبەس بۆ چەندین جۆری
Hardwareusually a single chipزۆرجار یەک many chips: CPU, RAM, storageچەندین : ، ،
Operating systemnone, or a small RTOSنییە، یان بچووکa large OS (Windows, iOS, Linux) manages the resources گەورە (Windows، iOS، Linux) سەرچاوەکان بەڕێوە دەبات
Softwarefirmware, not meant to be changed by the user، بۆ ئەوە نییە بیگۆڕێتthe user installs and removes programs دادەبەزێنێت و لای دەبات
Costتێچووpennies to a few dollarsچەند سەنتێک تا چەند دۆلارێکhundreds to thousands of dollarsسەدان تا هەزاران دۆلار

The embedded computer: one machine, one jobکۆمپیوتەری چەسپێنراو: یەک ئامێر، یەک کار

Is a phone embedded?ئایا مۆبایل چەسپێنراوە؟

Phones show that the border between the two families can move. Early mobile phones were embedded systems: the maker's firmware did a fixed set of jobs — calls, text messages, an alarm, a simple game. In the last two decades smartphones and tablets became so capable that they now count as general-purpose computers: they run a full operating system and any app you install.

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

Inside, a smartphone still has small embedded processors of its own. The baseband processor that talks to the mobile network, for example, runs its own real-time firmware in its own memory.

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

Two phones. Left, an early mobile phone with a small screen showing 12:30 and a keypad; it does fixed jobs chosen by the maker — calls, SMS, an alarm, a game — and is labelled embedded. A teal arrow points right to a smartphone with a screen full of app icons; it has a full operating system and any app you install, and is labelled general-purpose.دوو مۆبایل. لای چەپ، مۆبایلێکی سەرەتایی بە شاشەیەکی بچووک کە 12:30 پیشان دەدات و دوگمەکان؛ کارە جێگیرەکانی دروستکەر دەکات — پەیوەندی، SMS، زەنگی ئاگادارکردنەوە، یارییەک — و ناوی چەسپێنراوە. تیرێکی سەوز ئاماژە بۆ لای ڕاست دەکات بۆ مۆبایلێکی هۆشمەند کە شاشەکەی پڕە لە وێنۆچکەی ئەپ؛ سیستەمێکی وەگەڕخەری تەواوی هەیە و هەر ئەپێک دایبەزێنیت؛ ناوی گشتییە.
Early phones were embedded; smartphones are general-purpose computers.مۆبایلە سەرەتاییەکان چەسپێنراو بوون؛ .CêIT

Hardware plus software: firmwareڕەقەواڵە و نەرمەواڵە: پتەوواڵە

An embedded computer is hardware — the chip — plus software — its program. Think of the brain of a washing machine or a microwave: it needs no Windows or Android, only a small, simple program that does its one job, such as washing clothes or heating food. That program is the firmware. It is saved inside the machine, and the maker changes it rarely, only for a good reason.

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

Definitionپێناسە

Software stored permanently on a chip inside a device, which controls that device at the lowest level. Examples are a PC's and the program inside a router, a printer or an SSD; makers can update it.

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

The firmware sits in memory inside the chip, so an embedded computer needs no secondary storage such as a hard disk. Older devices kept it in mask ROM, written once in the factory. Today it is usually in flash memory, which keeps its contents without power but can be rewritten — that is why routers, cars and even light bulbs receive firmware updates (ROM today: flash that can be updated). Updates over the radio come in Firmware updates over the air.

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

A code card labelled software (firmware) with a short program — setup, loop, read sensors, decide, drive outputs — and a curved arrow saying stored in, pointing into a chip labelled hardware. Inside the chip a box says flash memory, and under it CPU, RAM and pins. Beside the chip a disk is crossed out: no disk needed. Below, two boxes: older devices used mask ROM, written once in the factory and never changed; today flash keeps the firmware without power and can be updated when needed.کارتێکی کۆد بە ناوی نەرمەواڵە (پتەوواڵە) لەگەڵ بەرنامەیەکی کورت — setup، loop، خوێندنەوەی هەستەوەرەکان، بڕیاردان، کارپێکردنی دەرخستەکان — و تیرێکی چەماوە کە دەڵێت هەڵدەگیرێت لە، ئاماژە بۆ ناو چیپێک دەکات بە ناوی ڕەقەواڵە. لەناو چیپەکەدا سندووقێک دەڵێت فلاش مێمۆری، لە ژێریدا CPU، RAM و پینەکانی GPIO. لە تەنیشت چیپەکە دیسکێک خەتی بەسەردا هاتووە: دیسکی ناوێت. لە خوارەوە دوو سندووق: ئامێرە کۆنەکان ROMـی کارگەیان بەکار دەهێنا، کە یەک جار دەنووسرا و نەدەگۆڕا؛ ئەمڕۆ فلاش مێمۆری پتەوواڵە بێ کارەباش دەپارێزێت و کاتی پێویست نوێ دەکرێتەوە.
The firmware lives in flash memory inside the chip: no disk needed. لە ناو دەژی: دیسکی ناوێت.CêIT

A tiny firmware program: one byte on eight LEDsپتەوواڵەیەکی زۆر بچووک: یەک بایت لەسەر هەشت LED

Firmware is often short. This sketch for an Arduino UNO lights eight LEDs on pins 2 to 9 to show one byte — eight bits — at a time. It shows three bytes, each written in a different number system: decimal, hexadecimal (0x) and binary (0b).

زۆرجار کورتە. ئەم بۆ Arduino UNO هەشت لەسەر پینەکانی 2 تا 9 هەڵدەکات بۆ ئەوەی هەر جارە یەک — هەشت — پیشان بدات. سێ پیشان دەدات و هەریەکەیان بە جیاواز نووسراوە: ، (0x) و (0b).

One byte on eight LEDsیەک بایت لەسەر هەشت LEDone_byte.inoARDUINORuns on a phone (or an emulator)لەسەر مۆبایل کار دەکات
// One byte on eight LEDs (Arduino UNO): bit 0 on pin 2 ... bit 7 on pin 9
const int FIRST_PIN = 2;

void showByte(byte value) {
  for (int bit = 0; bit < 8; bit++) {
    int level = (value >> bit) & 1;   // this bit: 1 or 0
    digitalWrite(FIRST_PIN + bit, level);
  }
}

void setup() {
  for (int bit = 0; bit < 8; bit++) {
    pinMode(FIRST_PIN + bit, OUTPUT);
  }
  showByte(255);          // decimal
  delay(1000);
  showByte(0x55);         // hexadecimal
  delay(1000);
  showByte(0b10101010);   // binary
}

void loop() {
  // empty: the last pattern stays on the LEDs
}
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 4-9

(value >> bit) & 1 picks out one bit of the byte; that bit decides whether its LED is on (1) or off (0).

(value >> bit) & 1 یەک دەردەهێنێت؛ ئەو بڕیار دەدات کە هەڵبێت ⁦(1)⁩ یان بکوژێتەوە ⁦(0)⁩.

Lineدێڕی 15-19

The same idea three times: 255 in decimal, 0x55 in hexadecimal and 0b10101010 in binary, one second apart.

هەمان بیرۆکە سێ جار: ⁦255⁩ بە ، ⁦0x55⁩ بە و ⁦0b10101010⁩ بە ، بە یەک چرکە لە نێوانیاندا.

Lineدێڕی 22-24

loop() is empty, so the last pattern simply stays on the LEDs.

loop() بەتاڵە، بۆیە دوایین شێوە بە سادەیی لەسەر دەمێنێتەوە.

One byte holds 28=2562^8 = 256 patterns, 0 to 255. 255 is 11111111: every LED on. 0x55 is 5×16+5=855 \times 16 + 5 = 85, which is 01010101 in binary. 0b10101010 is 170, or 0xAA in hexadecimal. Converting between these systems is taught in Binary to hex: groups of four.

یەک 28=2562^8 = 256 شێوە هەڵدەگرێت، لە 0 تا ⁦255. 255⁩ دەکاتە ⁦11111111⁩: هەموو هەڵدەبن. 0x55 دەکاتە 5×16+5=855 \times 16 + 5 = 85، کە بە دەبێتە ⁦01010101⁩. 0b10101010 دەکاتە ⁦170⁩، یان 0xAA بە . گۆڕینی نێوان ئەم سیستەمانە لە دووانی بۆ شانزەیی: گرووپی چوارانە فێر دەکرێت.

An animation in five steps. 1: setup makes pins 2 to 9 outputs; all eight LEDs are off, 00000000. 2: showByte(255) lights all eight LEDs, 11111111; decimal 255 = 0xFF. 3: showByte(0x55) lights every second LED, 01010101; hexadecimal 0x55 = 85. 4: showByte(0b10101010) lights the other four LEDs, 10101010; binary 0b10101010 = 170 = 0xAA. 5: loop is empty, so this last pattern stays on. Bit 7 is the leftmost LED, on pin 9; bit 0 is the rightmost, on pin 2.
An animation in five steps. 1: setup makes pins 2 to 9 outputs; all eight LEDs are off, 00000000. 2: showByte(255) lights all eight LEDs, 11111111; decimal 255 = 0xFF. 3: showByte(0x55) lights every second LED, 01010101; hexadecimal 0x55 = 85. 4: showByte(0b10101010) lights the other four LEDs, 10101010; binary 0b10101010 = 170 = 0xAA. 5: loop is empty, so this last pattern stays on. Bit 7 is the leftmost LED, on pin 9; bit 0 is the rightmost, on pin 2.
The firmware at work: three numbers, three number systems, one byte each. لە کاردا: سێ ژمارە، سێ ، هەریەکە یەک .CêIT

Input, process, outputنێوخستە، چارەسەرکردن و دەرخستە

Every embedded computer takes input from its environment, processes it with its software and sends output back into the world. Beside it there is usually a small user interface — buttons and a display — and sometimes a link to other systems, through a cable or a radio. A microwave oven has all of them: its control circuit is usually built around a microcontroller. The parts of a connected IoT device are drawn in What every IoT device needs.

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

An animation in five steps around a block diagram: inputs on the left (keypad and START, door switch), the embedded computer in the middle (software over hardware, an MCU and a display), outputs on the right (magnetron for the heat, turntable motor, lamp, beeper), and under the computer a user interface and a link to other systems. 1: you type 30 seconds and press START. 2: the program switches on the heat, the turntable and the lamp; the display shows 0:30. 3: the door opens; safety switches cut the heat at once and the program pauses at 0:12. 4: the door is shut, START is pressed, and it carries on. 5: time is up; everything switches off and the beeper calls you.
An animation in five steps around a block diagram: inputs on the left (keypad and START, door switch), the embedded computer in the middle (software over hardware, an MCU and a display), outputs on the right (magnetron for the heat, turntable motor, lamp, beeper), and under the computer a user interface and a link to other systems. 1: you type 30 seconds and press START. 2: the program switches on the heat, the turntable and the lamp; the display shows 0:30. 3: the door opens; safety switches cut the heat at once and the program pauses at 0:12. 4: the door is shut, START is pressed, and it carries on. 5: time is up; everything switches off and the beeper calls you.
Input, process and output in a microwave oven.، و لە مایکرۆوەیڤێکدا.CêIT

Look at step 3: when the door opens, the heat stops at that very moment. Acting at the right time is part of the job — more on that below.

سەیری هەنگاوی 3 بکە: کاتێک دەرگاکە دەکرێتەوە، گەرمی لە هەمان ساتدا دەوەستێت. کارکردن لە کاتی گونجاودا بەشێکە لە کارەکە — لە خوارەوە زیاتری لەسەر دەڵێین.

So, what is an embedded system?کەواتە سیستەمی چەسپێنراو چییە؟

An embedded system is the embedded computer together with the machine around it. It has three marks:

چەسپێنراوەکەیە لەگەڵ ئەو ئامێرەی لە دەوریەتی. سێ نیشانەی هەیە:

  1. It is typically built from a microcontroller — a whole small computer on one chip (Microprocessor or microcontroller?).
  2. It is often part of a larger mechanical or electrical system.
  3. It usually has real-time constraints.
  1. زۆرجار لە دروست دەکرێت — بچووکی تەواو لەسەر یەک (مایکرۆپرۆسێسەر یان مایکرۆکۆنترۆڵەر؟).
  2. زۆرجار بەشێکە لە سیستەمێکی میکانیکی یان کارەبایی گەورەتر.
  3. زۆرجار سنووری هەیە.

A car's anti-lock brakes (ABS) show all three. A microcontroller reads a speed sensor on every wheel; when one wheel is about to lock, valves in the brake system ease its brake and apply it again. Some systems can do this about 15 times a second.

برێکی دژەقفڵی ئۆتۆمبێل ⁦(ABS)⁩ هەر سێکیان پیشان دەدات. خێرایی سەر هەر چەرخێک دەخوێنێتەوە؛ کاتێک چەرخێک خەریکە قفڵ دەبێت، سەمامەکانی سیستەمی برێک برێکی ئەو چەرخە سووک دەکەن و دووپاتە توندی دەکەنەوە. هەندێک سیستەم دەتوانن ئەمە نزیکەی ⁦15⁩ جار لە چرکەیەکدا بکەن.

A car seen from above with four wheels. In the middle sits the ABS ECU, a microcontroller, joined by dashed blue lines to a speed sensor on every wheel. Labels: sensors, a speed sensor on every wheel; actuators, valves that ease and re-apply each brake. On the right, three marks: 1, built from a microcontroller; 2, part of a bigger machine, the car's brakes; 3, real time, some can ease and re-apply a brake 15 times a second.ئۆتۆمبێلێک لە سەرەوە بە چوار چەرخەوە. لە ناوەڕاستدا ECUـی ABS هەیە، مایکرۆکۆنترۆڵەرێک، کە بە هێڵی شینی پچڕپچڕ بە هەستەوەری خێرایی سەر هەر چەرخێکەوە بەستراوە. ناونیشانەکان: هەستەوەرەکان، هەستەوەرێکی خێرایی لەسەر هەر چەرخێک؛ جووڵێنەرەکان، سەمامەکان کە برێکی هەر چەرخێک سووک و دووپاتە توند دەکەن. لە لای ڕاست سێ نیشانە: 1، لە مایکرۆکۆنترۆڵەرێک دروست کراوە؛ 2، بەشێکە لە ئامێرێکی گەورەتر، برێکی ئۆتۆمبێلەکە؛ 3، کاتی ڕاستەقینە، هەندێکیان لە چرکەیەکدا 15 جار برێکێک سووک و توند دەکەنەوە.
Anti-lock brakes: a microcontroller, inside a bigger machine, working in real time.برێکی دژەقفڵ: ، لەناو ئامێرێکی گەورەتردا، بە کار دەکات.CêIT

On time: not late, and not too earlyلە کاتی خۆیدا: نە دواکەوتوو، نە زووتر

When we say that embedded systems usually have real-time constraints, we mean: they must do their job exactly at the right time — not late, not too early — and act very fast when needed. In a car crash the airbag must open within milliseconds; if it is even a little late, people can be hurt. When a heart monitor in a hospital sees a problem, it must sound the alarm at once; if it is slow, the patient can die.

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

Engineers write "the right time" as a deadline, and in embedded systems deadlines are tiny. Too early can be as bad as too late: an engine's spark must come at the right moment of each turn — too early makes the engine knock, too late wastes power — and an airbag must never open without a crash. Hard and soft real time are explained in Real time means meeting a deadline. When a program freezes and misses every deadline, a watchdog timer resets it: see Lab: The Watchdog Timer.

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

A time line from 0 to 100 milliseconds after an event, with five deadlines marked: an engine spark 2.5 ms, a factory robot 5 ms, an airbag 20 ms, aircraft control 50 ms and a heart pacemaker 100 ms. A note says: a late answer is a wrong answer, and some jobs must not happen too early either.هێڵێکی کات لە 0 تا 100 میلیچرکە دوای ڕووداوێک، بە پێنج کاتی دیاریکراو: پریسکەی بزوێنەر 2.5 ms، ڕۆبۆتی کارگە 5 ms، کیسەی هەوا 20 ms، کۆنترۆڵی فڕۆکە 50 ms و ڕێکخەری لێدانی دڵ 100 ms. تێبینییەک دەڵێت: وەڵامی دواکەوتوو وەڵامی هەڵەیە و هەندێک کاریش نابێت زووتر لە کاتی خۆی ڕوو بدەن.
Deadlines of some real-time jobs, in milliseconds.کاتی دیاریکراوی هەندێک کاری ، بە میلیچرکە.CêIT, after G. Heiser (UNSW COMP9242, CC BY 4.0)

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

MistakeهەڵەBetterباشتر
"An embedded computer is just a small PC."« چەسپێنراو تەنیا بچووکە.»It is built for one job, usually on one chip, with no disk and often no operating system.بۆ یەک کار دروست کراوە، زۆرجار لەسەر یەک ، بێ دیسک و زۆرجار بێ .
"Firmware can never change."« هەرگیز ناگۆڕێت.»Today firmware usually lives in flash memory, so it can be updated — carefully and rarely.ئەمڕۆ زۆرجار لە ، بۆیە دەکرێت نوێ بکرێتەوە — بە وریایی و بە دەگمەن.
"Real time means as fast as possible."« واتە هەرچی خێراتر.»Real time means on time: before the deadline, and not too early. واتە لە کاتی خۆیدا: پێش کاتی دیاریکراو و نە زووتر.
"A smartphone is an embedded system."« .»Today it is a general-purpose computer — though it contains embedded processors, such as its modem.ئەمڕۆ — هەرچەندە پرۆسێسەری چەسپێنراوی تێدایە، وەک مۆدێمەکەی.
"Embedded systems are always cheap toys."« هەمیشە یاریی هەرزانن.»Most are cheap, but anti-lock brakes and an aircraft's flight control are embedded systems too, and they must be very reliable.زۆربەیان هەرزانن، بەڵام برێکی دژەقفڵ و کۆنترۆڵی فڕینی فڕۆکەش و دەبێت زۆر جێی متمانە بن.
"0x55 and 55 are the same number."«0x55 و ⁦55⁩ هەمان ژمارەن.»0x55 is hexadecimal: 5×16+5=855 \times 16 + 5 = 85.0x55 : 5×16+5=855 \times 16 + 5 = 85.

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

ExerciseڕاهێنانGeneral-purpose or embedded?گشتی یان چەسپێنراو؟

Classify each computer as general-purpose or embedded and give one reason: (a) a laptop; (b) the controller of a traffic light; (c) a TV remote control; (d) a web server; (e) a digital thermometer; (f) a tablet.

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

Show answerوەڵامەکە پیشان بدە
  • (a) general-purpose — it runs any software you install;
  • (b) embedded — one job inside a bigger system, with timing limits;
  • (c) embedded — a tiny chip with fixed firmware and a few buttons;
  • (d) general-purpose — a server runs an operating system and many programs;
  • (e) embedded — it only measures, shows and perhaps beeps;
  • (f) general-purpose — an operating system and any app you choose.
  • (أ) گشتی — هەر دایبەزێنیت جێبەجێی دەکات؛
  • (ب) چەسپێنراو — یەک کار لەناو سیستەمێکی گەورەتردا، بە سنووری کاتەوە؛
  • (ج) چەسپێنراو — بچووک بە جێگیر و چەند دوگمەیەکەوە؛
  • (د) گشتی — و چەندین جێبەجێ دەکات؛
  • (ه) چەسپێنراو — تەنیا دەپێوێت، پیشان دەدات و لەوانەیە زەنگ لێ بدات؛
  • (و) گشتی — و هەر هەڵیبژێریت.
ExerciseڕاهێنانBytes on the LEDsبایت لەسەر LEDـەکان

In the sketch, which LEDs (pins 2 to 9) light for showByte(0x0F), for showByte(0xF0) and for showByte(129)? Write each value in binary first.

لە ، کام (پینەکانی 2 تا ⁦9⁩) هەڵدەبن بۆ showByte(0x0F)، بۆ showByte(0xF0) و بۆ showByte(129)؟ سەرەتا هەر نرخێک بە بنووسە.

Hintئاماژە

Bit 0 is on pin 2, bit 7 on pin 9. 0x0F means 0 sixteens and 15 ones.

0 لەسەر پینی 2ـە و 7 لەسەر پینی 9. 0x0F واتە 0 شانزە و ⁦15⁩ یەکە.

Show answerوەڵامەکە پیشان بدە
  • 0x0F = 00001111 → bits 0–3 → pins 2, 3, 4 and 5;
  • 0xF0 = 11110000 → bits 4–7 → pins 6, 7, 8 and 9;
  • 129 = 128 + 1 = 10000001 → bits 7 and 0 → pins 9 and 2.
  • ⁦0x0F = 00001111⁩ ← 0 تا 3 ← پینەکانی 2، 3، 4 و 5؛
  • ⁦0xF0 = 11110000⁩ ← 4 تا 7 ← پینەکانی 6، 7، 8 و 9؛
  • ⁦129 = 128 + 1 = 10000001⁩ ← 7 و 0 ← پینەکانی 9 و 2.
ExerciseڕاهێنانFind the inputs and outputsنێوخستەکان و دەرخستەکان بدۆزەرەوە

A digital thermometer checks the temperature, shows it on a small screen and beeps when the reading is ready. Name its inputs, its processing and its outputs. Does it need an operating system like Android?

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

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

Inputs: the temperature sensor and the ON button. Processing: the firmware turns the sensor's reading into degrees and decides when the reading is steady. Outputs: the display and the beeper. It needs no Android: a short firmware program in the chip's flash is enough.

: و دوگمەی هەڵکردن. : خوێندنەوەی دەکات بە پلە و بڕیار دەدات کەی خوێندنەوەکە جێگیرە. : شاشەکە و زەنگەکە. پێویستی بە Android نییە: کورتی لە بەسە.

ExerciseڕاهێنانToo late, or too early?زۆر درەنگ یان زۆر زوو؟

For each system, say what goes wrong if it acts too late, and what goes wrong if it acts too early: (a) a car's airbag; (b) an engine's spark; (c) a heart-monitor alarm.

بۆ هەر سیستەمێک بڵێ ئەگەر زۆر درەنگ کار بکات چی هەڵە دەبێت و ئەگەر زۆر زوو کار بکات چی هەڵە دەبێت: (أ) کیسەی هەوای ئۆتۆمبێل؛ (ب) پریسکەی بزوێنەر؛ (ج) ئاگادارکەرەوەی ئامێری چاودێریی دڵ.

Show answerوەڵامەکە پیشان بدە
  • (a) late: the passenger hits the wheel; early or without a crash: the bag opens for nothing and can hurt or frighten the driver;
  • (b) late: power is wasted; early: the engine knocks and can be damaged;
  • (c) late: the patient can die before help comes; a false early alarm is less dangerous, but too many false alarms make staff stop trusting it.
  • (أ) درەنگ: سەرنشینەکە بەر سووکانەکە دەکەوێت؛ زوو یان بێ پێکدادان: کیسەکە بێ هۆ دەکرێتەوە و دەکرێت شۆفێرەکە بریندار بکات یان بیترسێنێت؛
  • (ب) درەنگ: توانا بەفیڕۆ دەچێت؛ زوو: بزوێنەرەکە تەقەتەق دەکات و لەوانەیە زیانی پێ بگات؛
  • (ج) درەنگ: لەوانەیە نەخۆشەکە پێش گەیشتنی یارمەتی بمرێت؛ ئاگادارکردنەوەی هەڵەی زوو کەمتر مەترسیدارە، بەڵام زۆری ئاگادارکردنەوەی هەڵە وا دەکات ستاف متمانەی پێ نەمێنێت.

Summaryپوختە

  • General-purpose computers run many kinds of software under an operating system, need heavy user interaction, cost hundreds to thousands of dollars and spread their work over many chips.
  • Embedded computers do one job inside a larger system: often on one chip with its own peripherals (timers, ADC, DAC, serial), with firmware, sometimes an RTOS, and a cost of cents to a few dollars.
  • Firmware lives in the chip's memory — today usually flash, so it can be updated — and no disk is needed.
  • One byte has 256 patterns: 255 = 11111111, 0x55 = 85 = 01010101, 0b10101010 = 170 = 0xAA.
  • An embedded system is typically built from a microcontroller, is part of a larger machine and has real-time constraints: not late and not too early.
  • چەندین جۆری لەژێر جێبەجێ دەکەن، کارلێکی زۆری دەوێت، سەدان تا هەزاران دۆلار تێدەچن و کارەکەیان بەسەر چەندین دابەش دەکەن.
  • چەسپێنراوەکان یەک کار لەناو سیستەمێکی گەورەتردا دەکەن: زۆرجار لەسەر یەک بە خۆیەوە (، ADC، DAC، زنجیرەیی)، بە ، هەندێک جار و تێچووی چەند سەنتێک تا چەند دۆلارێک.
  • لە دەژی — ئەمڕۆ زۆرجار فلاش، بۆیە نوێ دەکرێتەوە — و دیسک پێویست نییە.
  • یەک ⁦256⁩ شێوەی هەیە: ⁦255 = 11111111⁩، ⁦0x55 = 85 = 01010101⁩، ⁦0b10101010 = 170 = 0xAA⁩.
  • زۆرجار لە دروست دەکرێت، بەشێکە لە ئامێرێکی گەورەتر و سنووری هەیە: نە دواکەوتوو و نە زووتر.
Review questionsپرسیارەکانی پێداچوونەوە
What is firmware?پتەوواڵە چییە؟

The small program built into a device's chip that runs it; it is changed rarely, by the maker.

ئەو بچووکەیە کە لەناو ئامێرێکدا دانراوە و بەڕێوەی دەبات؛ بە دەگمەن و لەلایەن دروستکەرەوە دەگۆڕێت.

Why does an embedded computer need no hard disk?بۆچی کۆمپیوتەری چەسپێنراو پێویستی بە هارد دیسک نییە؟

Its program is stored in memory inside the chip, usually flash.

لە ناو هەڵگیراوە، زۆرجار فلاش.

Give the three marks of an embedded system.سێ نیشانەکەی سیستەمی چەسپێنراو بڵێ.

Built from a microcontroller, part of a larger mechanical or electrical system, and real-time constraints.

لە دروست دەکرێت، بەشێکە لە سیستەمێکی میکانیکی یان کارەبایی گەورەتر و سنووری هەیە.

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

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

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

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

Embedded Systems at Work: a Bike Computer and a Car Engineسیستەمە چەسپێنراوەکان لە کاردا: کۆمپیوتەری پاسکیل و بزوێنەری ئۆتۆمبێل

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.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.