Embedded Systems
Embedded Systems
Mobile phones
Microprocessor
Microprocessors are the core of any modern computer, they are single chip processing units responsible for computing
each operation stored in the program
Microcontroller
A microcontroller is a small and low cost microcomputer, which is designed to performing in the specific tasks of
embedded systems.
Microcontroller Components
There are different types of Microcontrollers available and are classified based on Bus-width, Memory, Instruction Set,
Architecture, and Manufacturer.
Von
Neumann (or Princeton) Architecture Microcontroller: Von
Neumann or Princeton architecture suggests using a single
memory for both the program and data storage it is the most
used architecture in all computers, desktop and laptops to date.
Comparison Harvard Architecture and Von Neumann
Based on instruction set, microcontrollers are classified into two types i.e. CISC and RISC.
Complex instruction set computer (CISC): CISC computers have small programs. It has a huge number of
compound instructions, which takes a long time to perform
Reduced instruction set computer (RISC): RISC is a computer that only uses simple commands that can be
divided into several Instructions that achieve low-level operation within a single CLK cycle.
In an 8-bit microcontroller, the point when the internal bus is & bit then the ALU performs the arithmetic and
logic operations.
The 16-bit microcontroller performs performance as compared to the 8-bit greater precision and performance
as compared to the 8-bit
The 32-bit microcontroller uses the 32-bit instructions to perform the arithmetic and logic operations. These are
used in automatically controlled devices including implantable medical devices, engine control systems, office
machines, appliances, and other types of embedded systems.
8081 Microcontrollers
8051 is one of the first and most popular microcontrollers also known as MCS-51. Intel introduced it in the year 1981.
Initially, it came out as an N-type metal-oxide-semiconductor (NMOS) based microcontroller, but later versions were
based on complementary metal-oxide-semiconductor (CMOS) technology. The 8051 microcontroller is a great option for
a variety of applications, ranging from straightforward embedded projects to intricate industrial automation systems.
AVR Microcontrollers
Developed by Atmel, AVR (Alf Vegard RISC) microcontrollers are a family of 8-bit and 32-bit MCUs known for their low
power consumption and high performance. They feature RISC architecture and are easy to program. Perfect for DIY
electronics projects, including hobbyist and educational projects, and commercial products where efficiency and
programmability are key.
ARM Microcontrollers
Based on ARM (Advanced RISC Machine) processor architecture, these MCUs range from low-power, simple Cortex-M
series to the more powerful Cortex-R and Cortex-A series, offering high performance and energy efficiency. Ideal for
mobile devices, IoT applications, and complex embedded systems that require high processing capabilities, energy
efficiency, and support for advanced operating systems
PIC Microcontroller
Produced by Microchip Technology, PIC microcontrollers range from 8-bit to 32-bit. They are known for their ease of
programming and versatility, with a wide range of integrated peripherals.
Perfect for DIY electronics projects, including hobbyist and educational projects, and commercial products where
efficiency and programmability are key.
FPGA-based Microcontrollers
These are unique as they combine the flexibility of FPGAs (Field Programmable Gate Arrays with the structure of
microcontroller, allowing users to configure both hardware and software according to their needs
Best suited for specialized applications that require custom hardware configurations, such as signal processing high
speed data analysis, and prototyping of digital systems.
ADCS convert continuous analog signals, such as voltage or current, into discrete digital values. These digital values are
then fed into CPU for further processing
Purpose:
This conversion allows microcontrollers to process and analyze analog data, which is essential for applications like sensor
readings audio processing, and control systems.
Digital-to-Analog Converter (DAC) converts digital pulses into analog voltage or current signals.
Purpose:
This conversion allows microcontrollers to output digital data in a way that can be understood by analog devices, such as
actuators, displays, and audio output circuits.
In Summary:
ADCs and DACs are essential for bridging the gap between the analog and digital words in microcontrollers.
Understanding their functions, types, and key specifications is crucial for designing and implementing applications that
require interfacing with analog sensors actuators, and other devices
Arduino Microcontroller
Arduino is an open-source electronics platform based on easy-to-use hardware software. Arduino boards are able to
read inputs and turn it into an output. You can tell your board what to do by sending a set of instructions to
microcontroller programming on language (based IDE) based on Processing.
Arduino was born at the Ivrea interaction design institute as an easy tool for fast prototyping, aimed at students without
a in electronics and programming. As soon as it reached a wider community, The Arduino board started changing to
adapt a new needs and challenges, differentiating offer from simple 8- bit boards applications, wearable, 3D printing,
and embedded systems.
Microcontroller: It acts as Arduino's "brain" by processing tasks and providing access to input/output pins (I4O)
handling all.
Power Supply Source: An external power source, such as a battery or USB port is needed. Some models also
offer alternative methods, like solar powering up.
Digital outputs & panels or AC adapters that allow more flexibility when Analog read complex signals elements
connect easily.
I/O Pins: General-purpose digital inputs from sensors or buttons while analogs enable like distance sensors or
motor
USB Interface (e.g., FTDI): The serial communication protocol used by most Arduinos is UART over a mini-USB
port. It enables connection with programming, performance computers for simple data.
Clock Speed & Memory Capacity: Higher clock speeds result in faster while complex projects. These larger are
selecting an appropriate Arduino model. Memory important and controllers transfer
Program Structure
The basic structure of the Arduino programming language is fairly simple and runs in at least two parts. These two
required parts, or functions, enclose blocks of statements.
void loop()
Statements;
}void loop()
1. Variable declaration:
All variables have to be declared before they can be used. Declaring a variable means defining its value type, as in int,
long, float, etc., setting a specified name, and optionally assigning an initial value. This only needs to be done once in a
program but the value can be changed at any time using arithmetic and various assignments. The following example
declares that inputVariable is an int, or integer type, and that its initial value equals zero. This is called a simple
assignment.
int inputVariable = 0;
A variable can be declared in a number of locations throughout the program and where this definition takes place
determines what parts of the program can use the variable.
2. Variable Scope:
A variable can be declared at the beginning of the program before void setup(), local() of functions, and sometimes
within a statement block such as for loops. Where the variable is declared determines the variable scope, or the ability
of certain parts of a program to make use of the variable.
A global variable is one that can be seen and used by every function and statement in a program. This variable is
declared at the beginning of the program, before the setup() function
The local variable is one that is defined inside a function or as part of a loop. It is only visible and can only be used inside
the function in which it was declared. It is therefore possible to have two or more variables of the same name in
different parts of the same ram that contain different values.
Example:
void loop()
i++;
A. Byte:
Byte stores an 8-bit numerical value without decimal points. They have a range of 0-255.
B. Int:
Integers are the primary datatype 'for storage of numbers without decimal points and store a 16-bit value with a range
of 32,767 to -32,768.
Note: Integer variables will roll over if forced past their maximum or minimum values by an assignment or comparison.
For example, if x=32767 and a subsequent statement adds 1 to x, x=x+1 or x++, x will then rollover and equal-32,768.
C. Long:
Extended size datatype for long Integers, without decimal points, stored in a 32-bit value with a range of 2,147,483,647
to -2,147,483,648.
D. Float:
A datatype for floating-point numbers, or numbers that have a decimal point. Floating-point numbers have greater
resolution than integers and are stored as a 32-bit value with a range of 3.4028235E+38 to -3.4028235E+38.
Compound Assignments:
Compound assignments combine an arithmetic operation with a variable assignment. These are commonly found in for
loops. The most common compound assignments include:
1. Setup():
The setup() function is called once when your program starts. Use it to initialize pin modes, or begin serial. It must be
included in a program even if there are no statements to run.
2. Loop():
After calling the setup() function, the loop() function does precisely what its name suggests, and loops consecutively,
allowing the program to change, respond, and control the Arduino board.
3. Curly Braces():
Curly braces (also referred to as just "braces" or "curly brackets") define the beginning and end of function blocks and
statement blocks such as the void loop() function and the for and if statements.
4. Semicolon;:
A semicolon must be used to end a statement and separate elements of the program. A semicolon is also used to
separate elements in a for loop.
5. Block Comments/*..*/
Block comments, or multi-line comments, are areas of text ignored by the program and are used for large text
descriptions of code or comments that help others understand parts of the program. They begin with /* and end with */
and can span multiple lines.
Single line comments begin with // and end with the next line of code. Like block comments, they are ignored by the
program and take no memory space.
Single line comments are often used after a valid statement to provide more information about what the statement
accomplishes or to provide a future reminder.
7. pinMode(pin, mode):
8. digitalRead(pin):
Reads the value from a specified digital pin with the result either HIGH or LOW. The pin can be specified as either a
variable or constant (0-13).
9. digitalWrite(pin, value):
Ouputs either logic level HIGH or LOW at (turns on or off) a specified digital pin. The pin can be specified as either a
variable or constant (0-13).
10. analogRead(pin):
Reads the value from a specified analog pin with a 10-bit resolution. This function only works on the analog in pins (0-5).
The resulting integer values range from 0 to 1023.
11 analogWrite(pin, value):
Writes a pseudo-analog value using hardware enabled pulse width modulation (PWM) to an output pin marked PWM.
12. delay(ms):
Pauses your program for the amount of time as specified in milliseconds, where 1000 equals 1 second. 13. Milli s():
Returns the number of milliseconds since the Arduino board began running the current program as an unsigned long
value.
Functions:
A function is a block of code that has a name and a block of statements that are executed when the function is called.
Example:
void loop()
result=sum_func(5,6);
Variables:
A variable is a way of naming and storing a numerical value for later use by the program. As their namesake suggests,
variables are numbers that can be continually changed as opposed to constants whose value never changes. A variable
needs to be declared and optionally assigned to the value needing to be stored.
Example:
Comparison operators:
Comparisons of one variable or constant against another are often used in if statements to test if a specified condition is
true.
X==y // x is equal to y
Logical operators are usually a way to compare two expressions and return a TRUE or FALSE depending on the operator.
There are three logical operators, AND, OR, and NOT that are often used in if statements:
Logical AND
Logical OR
Logical NOT
Arithmetic:
Arithmetic operators include addition, subtraction, multiplication, and division. They return the sum, difference,
product, or quotient (respectively) of two operands.
y=y+3;
X=X-7;
l=j*6;
r=r/5;
There are 20 different Arduino types, each offering unique features and capabilities. From basic microcontrollers to
more advanced modules, some of the popular types of Arduino boards.
1 Smart Homes Motion sensors, outlet control, temperature sensors, blower control garage
door control, air flow control, sprinkler control and bill of materials
6 Medical Cancer Detection, Heart Beat Rate measurement Open source EEG/ECG/EMG
Breathalyzer, Thermometer, WI-FI Body Scale with Arduino Board, Lilypad
Slipper Automatic Foot Massager
7 Data Mining Health care, Industries, defense and other automation sectors
8 Laboratory Digital microscope with automated slide movement, EEG/ECG Sample collectors
9 Body Control HandSight. Heart Rate Monitor, Muscle activity. Temperature, Electrodermal
Respiration, Activity FacialExpression, Eye Tracking