0% found this document useful (0 votes)
29 views

Introduction To Embedded System (Arduino-PIC)

The document provides an overview of embedded systems, microcontrollers, and programming concepts. It discusses characteristics of embedded systems and compares PIC and Arduino microcontrollers. It describes assembly language, high-level languages like C, and basic programming structures in C including variables, functions, loops, branches, and examples. The key aspects covered are embedded systems are dedicated computing devices that interact with the environment, microcontrollers are commonly used, and C is a popular programming language for developing embedded applications.

Uploaded by

arslan khan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Introduction To Embedded System (Arduino-PIC)

The document provides an overview of embedded systems, microcontrollers, and programming concepts. It discusses characteristics of embedded systems and compares PIC and Arduino microcontrollers. It describes assembly language, high-level languages like C, and basic programming structures in C including variables, functions, loops, branches, and examples. The key aspects covered are embedded systems are dedicated computing devices that interact with the environment, microcontrollers are commonly used, and C is a popular programming language for developing embedded applications.

Uploaded by

arslan khan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Introduction to Embedded

System
Overview of PIC18F452 Microcontroller
Overview of Arduino Microcontroller
Embedded Systems
• An embedded system is a computer based system designed to perform one or
more dedicated tasks.
• Or Any device that includes a computer (hardware & software) but is not itself
a general purpose computer, which may expected to perform functions without
human intervention.
• Respond, monitor & control external environment using sensors and actuators.
• Complex system may also contain user interface (create interface between
user & system)
Characteristics of Embedded Systems
• Must be efficient (I) energy (mostly battery operated) (II) low manufacturing
cost
• Must meet real time constraints (must react to stimuli within the dictated time
interval)
• Frequently connected to environment (through sensors & actuators)
• Must be a Hybrid System (analogue + digital parts)

• Must be Reactive system (behaviour depends on input or current states)


• Sophisticated functionality (precise, accurate and expected operation)
• Safe in operation (no harm to be caused)
Comparison
PIC Microcontroller

• Stands for peripheral Interface controller manufactured by Microchip


• High performance RISC CPU

RISC-based machines execute one instruction per clock cycle. CISC


machines can have special instructions as well as instructions that take
more than one cycle to execute.
Assembly Language
• Referred to as a low-level-language
• deals directly with the internal structure of CPU
• deals with registers, memory addresses and call stacks
• all registers of CPU must be known by programmer
• Each statement corresponds to a single machine code instruction mnemonics
or opcode (codes & abbreviations) are easier to remember than machine code
• Translated into machine code by an Assembler
High Level Language

• C, C++ and Java are more structured & closer to spoken languages
• Strong abstraction from the detail of the CPU
• deals with variables, arrays, objects, functions, loops
• No need to understand detailed architecture of CPU
• Translated into machine code by compiler
Flow chart for the addition of two numbers.
The algorithm could be:
1 Start.

2 Set the count as 10.


3 Point to location of bottom
address number.

4 Add bottom address number.


5 Decrease the count number by
1.
6 Add 1 to the address location
pointer.
7 Is count 0? If not branch to 4.
If yes proceed.

8 Store sum.
9 Stop.
C language- Program structure

Within this main function there are


other functions which are called up as
subroutines. Each function contains a
number of statements.
Keywords: In C certain words are reserved as keywords with specific meanings. For
example,
• int is used to indicate that integer values are concerned;
• if is used for when a program can change direction based on whether a decision is true or
false.
• C requires that all keywords are in lower case letters.
Statements:
• These are the entries which make up a program,
• Every statement being terminated by a semicolon.
Functions:
• The term function is used for a self-contained block of program code which performs a
specific set of actions and has a name by which it can be referred
• A function is written as a name followed by brackets, i.e. name( ).
Return:
• A function may return a value to the calling routine.
• The return type appears in front of the function name, this specifying the type of value to be
returned to the calling function when execution of the function is completed.
Example of a C program

• /*A simple program in C*/


• The statement int a, b, c, d; declares the variables a, b, c and d to be integer
types. The statements a= 4, b =3, c =5 assign initial values to the variables,
• the = sign being used to indicate assignment.
• The statement d = a * b * c directs that a is to be multiplied by b and then by c
and stored as d.
• The printf in the statement printf("a * b * c = %d\n", d) is the display on
screen function.
• The argument contains %d and this indicates that it is to be converted to a
decimal value for display.
• Thus it will print a * b * c = 60.
• The character \n at the end of the string is to indicate that a new line is to be
inserted at that point
Branches and loops
The term loop is used for the execution of a sequence of
statements until a particular condition reaches the
required condition of being true, or false.
Switch: The switch statement allows for the
selection between several alternatives, the test
condition being in brackets.
Examples of programs:
Arduino microcontroller.
Basically the sequence of operations is:
1. download the Arduino Development Environment into the
host computer from the Arduino website;
2. connect the Arduino board to the host computer via a USB
cable;
3. start the Arduino Development Environment;
4. type the C program into the computer;
5. select the Upload button on the screen;
6. the program then runs on the Arduino board.

You might also like