1introduction To Embedded System
1introduction To Embedded System
WATCH
It is a time display SYSTEM
Parts: Hardware, Needles, Battery, Dial,
Chassis and Strap
Rules
1. All needles move clockwise only
2. A thin needle rotates every second
3. A long needle rotates every minute
4. A short needle rotates every hour
5. All needles return to the original position after 12 hours
Smart watch….
Brainstorming..
• What are the problems faced by people
around that you think as an electronic design
engineer you can solve?
Basic concept of Embedded system
Software program
• Real-time operation
• Size
• Cost
• Time
• Reliability
• Safety
• Energy/ power consumption
• Security
CLASSIFICATIONS OF EMBEDDED SYSTEM
• INTEL
8031,8032,8051,8052,8751,8752
• PIC
8-bit PIC16, PIC18,
16-bit DSPIC33 / PIC24,
PIC16C7x
• Motorola
MC68HC11
MICROPROCESSOR Vs MICROCONTROLLER
MICROPROCESSOR MICROCONTROLLER
https://www.researchgate.net/publication/322
094000_Washing_Machine_Controller_with_a
_New_Programming_Method
Layered architecture of Embedded system
Application software
Operating system
Hardware
• Every embedded system consists of custom-built hardware
built around a Central Processing Unit (CPU). This
hardware also contains memory chips onto which the
software is loaded. The software residing on the memory
chip is also called the ‘firmware’.
• The operating system runs above the hardware, and the
application software runs above the operating system. The
same architecture is applicable to any computer including a
desktop computer. However,
there are significant differences. It is not compulsory to
have an operating system in every embedded system.
For small appliances such as remote control units, air
conditioners, toys etc., there is no need for an operating
system and we can write only the software specific to that
application. For applications involving complex processing,
it is advisable to have an operating system.
In such a case, you need to integrate the application software
with the operating system and then transfer the entire
software on to the memory chip. Once the software is
transferred to the memory chip, the software will continue to
run for a long time and you don’t need to reload new software
Operating System (OS):
• An operating system (OS) is system software that
manages computer hardware, software resources, and
provides common services for computer programs.
Types of operating systems
• Single-tasking and multi-tasking
• Single- and multi-user
• Distributed
• Templated
• Embedded
• Real-time
• Library
System software and Application software
• VxWorks
1. It is developed by Wind River.
2. The latest version of this operating system is VxWorks 6.0.
3. It is widely used software operating system.
4. At the moment, there are 300 million devices that utilize this operating system.
5. The core or processor of VxWorks credits reliability, high performance, low latency,
determinism, and scalability.
6. It has increased potential for the management of errors.
7. It has compatibility with extensive POSIX 1003.1, .1b, .1c,
8. It uses preemptive priority and has scheduled for both real time and non-real time processes.
9. Memory is protected on the basis of MMU(memory management unit).
10.It has reduced context switch time. It restores only register windows.
11.For increasing response time, it saves the windows that are registered in a register cache and they
are used for recurring tasks.
• Video
Real Time Embedded Operating Systems
Examples…..
• Microkernels
Microkernels is an operating system that consists of the
basic necessities like scheduling, task switching, and
device handling.
Micro Kernels implement different memory techniques
and protect all system components.
Some of the microkernels protect memory by separating
all components of software from one another.
For further reading :
https://www.design-reuse.com/articles/10722/applica
tion-specific-real-time-microkernel-in-hardware.html
Basic kernel services
Timers
Since many embedded systems have stringent timing
requirements, most RTOS kernels also provide some basic
Timer services, such as task delays and time-outs.
Dynamic Memory Allocation services
This category of services allows tasks to "borrow"
chunks of RAM memory for temporary use in
application software. Often these chunks of memory
are then passed from task to task, as a means of
quickly communicating large amounts of data
between tasks. Some very small RTOS kernels that are
intended for tightly memory-limited environments,
do not offer Dynamic Memory Allocation services.
Problem
What if a low-priority task has already begun to run, and then a higher-priority
task becomes ready?
It will allow the low-priority task to complete the current assembly-language instruction
that it is executing. [But it won’t allow it to complete an entire line of high-level language
code; nor will it allow it to continue running until the next clock tick.] It will then
immediately stop the execution of the low-priority task, and allow the higher-priority task
to run. After the higher-priority task has finished its current work, the low-priority task will
be allowed to continue running.
Figure 3: Timeline for Priority-based Preemptive Scheduling
Examples
Task Switching : Steps to handle
external trigger
Each time the priority-based preemptive scheduler is
alerted by an external world trigger (such as a switch
closing) or a software trigger (such as a message arrival), it
must go through the following 5 steps:
• Determine whether the currently running task should
continue to run. If not then.
• Determine which task should run next.
• Save the environment of the task that was stopped (so it
can continue later).
• Set up the running environment of the task that will run
next.
• Allow this task to run.
• These 5 steps together are called "task switching."
• Preemptive System
Message Queues :
If messages can be sent more quickly than they can
be handled, the RTOS will provide message queues
for holding the messages until they can be
processed.
Synchronization Information
• Another kind of communication between tasks in embedded systems is
the passing of what might be called "synchronization information" from
one task to another.
• "Synchronization information" is like a command, where some commands
could be positive, and some negative.
• Negative Command
For example, a negative command to a task would be something like
"Please don’t print right now, because my task is using the printer." Or
more generally, "I want to lock the . . . for my own use only”.
• Positive Command
A positive command would be something like "I have detected a cardiac
emergency, and I want you to help me handle it." Or more generally,
"Please join me in handling . . ."