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.
زۆربەی لەناو ئامێرەکانی تردا شاراونەتەوە. و چەسپێنراو بەراورد بکە، ببینە بۆچی لە دەژی، سەیری زۆر بچووک بکە کە یەک لەسەر هەشت پیشان دەدات، ، و لە مایکرۆوەیڤێکدا ببینە و سێ نیشانەکەی فێر ببە — لەوانە : نە دواکەوتوو و نە زووتر.
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).
کەواتە دوو خێزانی گەورەن. — ، ، ، مۆبایل، و — هەر جێبەجێ دەکەن کە خۆت هەڵیدەبژێریت. چەسپێنراوەکان لەناو ئۆتۆمبێل، ئامێرەکانی ماڵ، کامێرا، تیڤی، ئامێری یاری، ئامێری مۆسیقا، ئامێرەکانی ئۆفیس، ئامێری پزیشکی، ، فڕۆکە و ئامێرەکانی پەیوەندیدا دانراون و بە دەگمەن هەستیان پێ دەکەیت. ژمارەیان زۆر زیاترە (ئامێری لەبەرکراو و کۆمپیوتەری چەسپێنراو).
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، یاری، ، وێنە و ڤیدیۆی تێدا هەڵدەگیرێت.
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) و .
- بچووکە، بۆیە بۆ زۆر شوێن دەست دەدات: نزیکەی لە هەموو شوێنێک جێی دەبێتەوە، تەنانەت لەناو ئامێری زۆر بچووکیشدا.
- تێدایە: تەنیا ئەو پێویستیەتی، کە بۆ ئەوە نییە زوو زوو بگۆڕێت.
- لەوانەیە جێبەجێ بکات کە ئەرکەکانی ڕێک دەخات — یان هیچ نەبێت.
- هەرزانە: لە چەند دە سەنتێکەوە تا چەند دۆلارێک.
The embedded computer: one machine, one jobکۆمپیوتەری چەسپێنراو: یەک ئامێر، یەک کار
Side by sideلە تەنیشت یەکتر
The two families compared, mark by mark:
دوو خێزانەکە بەراورد کراون، نیشانە بە نیشانە:
| 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بەس بۆ چەندین جۆری |
| Hardware | usually a single chipزۆرجار یەک | many chips: CPU, RAM, storageچەندین : ، ، |
| Operating system | none, or a small RTOSنییە، یان بچووک | a large OS (Windows, iOS, Linux) manages the resources گەورە (Windows، iOS، Linux) سەرچاوەکان بەڕێوە دەبات |
| Software | firmware, 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.
لە ناوەوە، هێشتا پرۆسێسەری چەسپێنراوی بچووکی خۆی هەیە. بۆ نموونە، ئەو پرۆسێسەرەی قسە لەگەڵ دەکات خۆی لە خۆیدا جێبەجێ دەکات.
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 نییە، تەنیا بچووک و سادەی دەوێت کە یەک کارەکەی بکات، وەک شۆردنی جل یان گەرمکردنی خواردن. ئەو . لەناو ئامێرەکەدا هەڵگیراوە و دروستکەر بە دەگمەن دەیگۆڕێت، تەنیا بۆ هۆیەکی گرنگ.
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 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 (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
}0 ms 1 1 1 1 1 1 1 1 = 255 1000 ms 0 1 0 1 0 1 0 1 = 0x55 2000 ms 1 0 1 0 1 0 1 0 = 0b10101010
Read from the pin events of the CêIT Arduino checker; this sketch prints nothing to the Serial Monitor.
لە ڕووداوەکانی پینەکانی پشکنەری Arduinoـی CêITـەوە خوێنراوەتەوە؛ ئەم هیچ لە Serial Monitor چاپ ناکات.
Explain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 4-9
(value >> bit) & 1picks 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 patterns, 0 to 255. 255 is 11111111: every LED on. 0x55 is , 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.
یەک شێوە هەڵدەگرێت، لە 0 تا 255. 255 دەکاتە 11111111: هەموو هەڵدەبن. 0x55 دەکاتە ، کە بە دەبێتە 01010101. 0b10101010 دەکاتە 170، یان 0xAA بە . گۆڕینی نێوان ئەم سیستەمانە لە دووانی بۆ شانزەیی: گرووپی چوارانە فێر دەکرێت.


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


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:
چەسپێنراوەکەیە لەگەڵ ئەو ئامێرەی لە دەوریەتی. سێ نیشانەی هەیە:
- It is typically built from a microcontroller — a whole small computer on one chip (Microprocessor or microcontroller?).
- It is often part of a larger mechanical or electrical system.
- It usually has real-time constraints.
- زۆرجار لە دروست دەکرێت — بچووکی تەواو لەسەر یەک (مایکرۆپرۆسێسەر یان مایکرۆکۆنترۆڵەر؟).
- زۆرجار بەشێکە لە سیستەمێکی میکانیکی یان کارەبایی گەورەتر.
- زۆرجار سنووری هەیە.
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 جار لە چرکەیەکدا بکەن.
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.
ئەندازیاران «کاتی گونجاو» وەک کاتێکی دیاریکراو دەنووسن و لە ئەم کاتانە زۆر کورتن. زووتر دەکرێت هێندەی دواکەوتن خراپ بێت: پریسکەی بزوێنەر دەبێت لە ساتی گونجاوی هەر سووڕێکدا بێت — ئەگەر زووتر بێت بزوێنەرەکە تەقەتەق دەکات، ئەگەر درەنگتر بێت توانا بەفیڕۆ دەچێت — و کیسەی هەوا هەرگیز نابێت بێ پێکدادان بکرێتەوە. توند و نەرم لە کاتی ڕاستەقینە واتە گەیشتن بە کاتی دیاریکراو ڕوون کراونەتەوە. کاتێک گیر دەخوات و هەموو کاتە دیاریکراوەکان لەدەست دەدات، دەکات: بڕوانە تاقیگە: تایمەری پاسەوان.
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: .0x55 : . |
Exercisesڕاهێنانەکان
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.
- (أ) گشتی — هەر دایبەزێنیت جێبەجێی دەکات؛
- (ب) چەسپێنراو — یەک کار لەناو سیستەمێکی گەورەتردا، بە سنووری کاتەوە؛
- (ج) چەسپێنراو — بچووک بە جێگیر و چەند دوگمەیەکەوە؛
- (د) گشتی — و چەندین جێبەجێ دەکات؛
- (ه) چەسپێنراو — تەنیا دەپێوێت، پیشان دەدات و لەوانەیە زەنگ لێ بدات؛
- (و) گشتی — و هەر هەڵیبژێریت.
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.
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 نییە: کورتی لە بەسە.
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.
- زۆرجار لە دروست دەکرێت، بەشێکە لە ئامێرێکی گەورەتر و سنووری هەیە: نە دواکەوتوو و نە زووتر.
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زاراوە سەرەکییەکان
Embedded Systems at Work: a Bike Computer and a Car Engineسیستەمە چەسپێنراوەکان لە کاردا: کۆمپیوتەری پاسکیل و بزوێنەری ئۆتۆمبێل
Related lecturesوانە پەیوەندیدارەکان
- Embedded Systems at Work: a Bike Computer and a Car Engineسیستەمە چەسپێنراوەکان لە کاردا: کۆمپیوتەری پاسکیل و بزوێنەری ئۆتۆمبێل
- Microprocessor or Microcontroller?مایکرۆپرۆسێسەر یان مایکرۆکۆنترۆڵەر؟
- The Questions Behind Every IoT Designئەو پرسیارانەی لە پشت هەموو دیزاینێکی IoTـەوەن
- Arduino Boards and the Arduino IDEبۆردەکانی Arduino و Arduino IDE
- Types of Computersجۆرەکانی کۆمپیوتەر
- Memory: RAM, ROM and Cacheبیرگە: RAM، ROM و کاش
- The CPU: Control Unit, ALU and CoresCPU: یەکەی جڵەوکردن، ALU و ناوکەکانی پرۆسێسەر
- Binary, Octal and Hex Shortcutsڕێگا کورتەکانی دووانی، هەشتی و شانزەیی
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- Arduino UNO R3 user manual / datasheet (SKU A000066): ATmega328P, 16 MHz, 32 kB flash, 2 kB SRAM, 1 kB EEPROM, timers, USART, SPI, I2C
- Arduino CLI docs: Sketch build process (a sketch becomes a C++ program, compiled and written to the chip's program memory)
- UNSW COMP9242 Advanced Operating Systems (2023), Real-Time Systems Basics, G. Heiser (CC BY 4.0): real time is not real fast; deadline table
- Wikipedia: Microwave oven (control circuit usually with a microcontroller; redundant safety interlocks)
- Wikipedia: Anti-lock braking system (wheel speed sensors, valves, controller; some systems pulse 15 times a second)
- Wikipedia: Baseband processor (runs a real-time OS as its firmware, with its own RAM)
- Wikipedia: Engine knocking (spark too early causes knock; knock control retards the timing)
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.