Case Study of RTOS and Embedded Devices
Case Study of RTOS and Embedded Devices
Introduction
● A real-time operating system (RTOS) is an operating
system (OS) intended to serve real-time application
requests.
● A real-time system is one whose correctness involves
both the logical correctness of outputs and their
timeliness. It must satisfy response-time constraints
or risk severe consequences including failure.
There are three types of time
constraints
● Hard: A late response is incorrect and implies a
system failure.
● Soft: Timeliness requirements are defined by using an
average response time. If a single computation is late,
it is not usually significant, although repeated late
computation can result in system failures
● Firm: Firm real-time systems have hard deadlines, but
where a certain low probability of missing a deadline
can be tolerated
Industrial applications of RTOS
● Military
● Telecommunications
● Aviation
● Automotive
● Scientific etc..
RTOS
● Real-time computing is where system correctness not only depends on
the correctness of logical result but also on the result delivery time.
● RTOS occupy little space from 10 KB to 100KB
● Using a task to perform bulk of the interrupt service allows the service
to be performed based on a priority chosen by the designer and helps
preserve the priority system of the RTOS
Basic Requirements of an RTOS
● Multi-tasking and preemptable
● Dynamic deadline identification
● Sufficient Priority Levels
● Predictable synchronization
● Memory management
● Task scheduling
Examples
● QNX RTOS v6.1
– Client-server based architecture. QNX adopts the approach of implementing an
OS with a 10 Kbytes
– The system can be distributed over several nodes, and is network transparent.
The system performance is fast and predictable and is robust. It supports Intel
x86family of processors, MIPS, PowerPC, and
StrongARM.
● Windows CE 3.0
– Windows CE 3.0 is an Operating system rich in features and is
available for a variety of hardware platforms.
– t the thread creation and deletion has periodic delays of more than 1 millisecond
occurring every second. The system is complex and highly configurable
Exemplary Devices:
Raspberry Pi / Arduino
Raspberry Pi ?
• Low cost, credit-card sized computer.
19
20
21
Features of Arduino
● Inexpensive
● Cross-platform
● Simple, clear programming environment
● Open source and extensible software
● Open source and extensible hardware
22
Arduino’s ATmega328
● Alf and Vegard's RISC processor.
● ATMEGA328P is high performance, low power
controller from Microchip.
● ATMEGA328P is an 8-bit microcontroller based on
AVR RISC architecture. It is the most popular of all
AVR controllers as it is used in ARDUINO boards.
23
Pins
Serial pin - TxO RAW– i/p volt regulator
Serial pin-RxI GND- Ground
Reset input -RST RST- Reset input
Ground-GND VCC-Dig. power supply
2- Digital i/o A3 – Reads analog sig.
3 A2
4 A1
5 A0
6 13 -Digital i/o
7 12
8 11
9 10
24
Writing Sketches
● Programs written using Arduino Software (IDE) are
called sketches.
● These sketches are written in the text editor and
are saved with the file extension .ino.
● Uploading: you need to select the correct items
from the Tools > Board and Tools > Port menus.
25
● Current Arduino boards will reset automatically and begin the
upload.
● you'll see the RX and TX LEDs blink as the sketch is uploaded.
The Arduino Software (IDE) will display a message when the
upload is complete, or show an error.
● Serial Monitor: Choose the baud rate from the drop-down menu
that matches the rate passed to Serial.begin in your sketch.
26
Arduino Program structure
● Arduino programs can be divided in three main parts:
Structure, Values (variables and constants), and
Functions.
● Software structure consist of two main functions −
– setup( ) function : initialize variables, pins, run only once
– loop( ) function : allowing your program to change and respond
27
LED BLINK Program
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output.
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
28
Comparison with others
Beginners, Min.
App. Size, small Really
set of s/w, low powerful
battery app. embedded
dev.,
Internet app.
GUI App.,
Feels desktop PC