Chapter Three
Chapter Three
B.Sc(SE), 2023
By Mikru L
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Lesson-1 Outline
www. Micro Digital Ed. com
BIHE university
Learning objectives:
After studying this unit, you will be able to:
Explain about Real Time Operating Systems its feature
and its characteristics
Discuss about inter process communication
Discuss the different types of Real Time task scheduling
To know about dynamic allocation of task
To explain about multi tasking and concurrency issue and
fault tolerance
To describe handling resource sharing and dependencies
To describe about synchronization techniques
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
2
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Embedded Firmware Design & Development:
The control algorithm (Program instructions) and or the
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
3
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Embedded Firmware Design & Development:
www. Micro Digital Ed. com
BIHE university
The product will continue serving the assigned task till hardware
breakdown occurs or a corruption in embedded firmware.
In case of hardware breakdown , the damaged component may
need to be replaced and for firmware corruptions the firmware
should be re-loaded, to bring back the embedded product to the
normal functioning.
The embedded firmware is usually stored in a permanent
memory (ROM) and it is non alterable by end users.
Designing Embedded firmware requires understanding of the
particular embedded product hardware, like
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
5
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Embedded Firmware Design & Development:
Component interfacing, memory map details, I/O port details,
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
6
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Embedded Firmware Design & Development
There exist two basic approaches for the design and
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
10
Assembly and C Upper Saddle River, NJ 07458. • All Rights
The Embedded Operating System based approach
Point of Sale (PoS) terminals, Gaming Stations, Tablet
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
11
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
12
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
13
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
14
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
15
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
16
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
17
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
18
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
19
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
20
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
21
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
22
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
23
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
24
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
25
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
26
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
27
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
28
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
29
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
30
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
31
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
32
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
33
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
34
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
35
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
36
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
37
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
38
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
39
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
40
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
41
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
42
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
43
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
44
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Inter-Process Communication
www. Micro Digital Ed. com
BIHE university
Pipes
•Pipe is widely used for communication between two related processes.
•This is a half-duplex method, so the first process communicates with
the second process.
•However, in order to achieve a full-duplex, another pipe is needed
Message Passing:
•It is a mechanism for a process to communicate and synchronize. Using
message passing, the process communicates with each other without
resorting to shared variables.
•IPC mechanism provides two operations:
•Send (message)- message size fixed or variable
•Received (message)
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
46
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Inter-Process Communication
Message Queues:
www. Micro Digital Ed. com
BIHE university
Shared Memory:
•Shared memory is a memory shared between two or more
processes that are established using shared memory between all
the processes.
•This type of memory requires to protected from each other by
synchronizing access across all the processes.
FIFO:
•Communication between two unrelated processes.
• It is a full-duplex method, which means that the first
process can communicate with the second process, and the
opposite can also happen.
•Semaphores: A semaphore is a signaling mechanism technique.
This OS method either allows or disallows access to the
resource, which depends on how it is set up.
•Signals: It is a method to communicate between multiple
processes by way of signaling. The source process will send a
signal which is recognized by number, and the destination
process will handle
AVR Microcontroller and Embeddedit
System Using © 2011 Pearson Higher Education,
48
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
49
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
50
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
51
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
52
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
53
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
54
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
55
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
56
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
57
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
58
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
59
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
60
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
61
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
62
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
63
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
64
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
65
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
66
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
67
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
68
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
69
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
70
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
71
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
72
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
73
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
74
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
75
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
76
Assembly and C Upper Saddle River, NJ 07458. • All Rights
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
77
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Reentrancy
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
78
Assembly and C Upper Saddle River, NJ 07458. • All Rights