You are on page 1of 26

Introduction to

Embedded System &


PIC Programming in C

We cannot solve our problems with the same thinking


we used when we created them
- Albert Einstein

1
Introduction to Embedded System

Objective:

Understand the concept of embedded system

2
Introduction to Embedded System

What is Embedded System ?

- Special purpose computer : usually with one specific task or application.


ex: you cannot watch television on microwave

- Usually embedded in a device which often has other electronic and


mechanical parts.
ex : mouse, display card, sound card, camera, robot

- Usually optimized for the specific task in a larger system.


ex: display card in computer or oil injection system in car

- Has usual basic computer components : CPU, memory, inputs & outputs.

3
Introduction to Embedded System

Characteristics
Embedded systems have several common characteristics:

- Low cost, simple and reliable.

- Single Functioned

- Reactive and Real Time

- Tightly Constrained

4
Introduction to Embedded System

Constrains
An embedded system has hardware designed to keep in view three
constrained:

- System memory

- Processing power

- Power consumption

5
Introduction to Embedded System

Block Diagram
The block diagram of embedded system:

Bus Analog input


Central Controller
Processing
Unit Analog output

Digital I/O

Storage Bus
(Memory) Controller Counter

Timer

Human Machine Interface(HMI)

6
Introduction to Embedded System

Example of embedded system


The block diagram of embedded system digital thermostat:

Bus Analog Digital Thermostat Circuit


Controller Converter
Central
Processing Digital Analog Heater / AC
Unit Converter Control

Digital I/O

Storage Bus
(Memory) Controller Counter

Timer

Display
Keypad
panel

7
Introduction to Embedded System

Example:
Application of Embedded System in Real Application
Area / Product Example

1 Personal information products Cell phones, pager, watch, pocket recorder, calculator

2 Laptop components Mouse, keyboard, modem, fax card, sound card, battery charger

3 Home appliances Door lock, alarm lock, thermostat, air conditioner, TV remote, VCR

4 Toys Video games, dolls, robot, remote car control

5 Military Air guided missile, GPS, tacking system, viewfinder

8
Introduction to Embedded System

Microcontroller

- It is a full computer system on the chip, even it resources far more limited
than personal desktop computer.

- Design for stand alone operations.

9
Introduction to Embedded System

Characteristic of PIC Microcontroller

- RISC (Reduced Instruction Set Computer) design, only 37 instructions to


remember. It is code efficient allowing microcontroller PIC to run typically
less program memory than its larger competitors.

- Harvard Architecture : Program memory and data memory are separated


memories and they accessed from separated buses.

10
Introduction to Embedded System

Von Neumann Versus Harvard architecture

Central Central
Processing RAM
Processing
Unit + ROM
Unit
ROM (Program RAM
(Program )
)

Von Neumann Architecture Harvard Architecture


Used in 8086,8051 Use most RISC CPU
Only one bus between CPU and Separated program and data bus
memory thus can have different bus.
RAM and program share the same For example : Data memory (RAM)
bus and the same memory and bit 8bit
width For example : program memory
Problem : getting instruction (ROM) 12bit,14bit,16bit wide in
interferes accessing RAM EEPROM.

11
Introduction to Embedded System

Microcontroller (Block diagram)

Central
Processing RAM ROM
Unit

Input/ output Timer Serial Com

All features in one chip

12
Introduction to Embedded System

Microcontroller Versus Microprocessor

Microcontroller
Microprocessor

CPU RAM ROM

Input/
Timer Serial Com Input/ Serial
output CPU ROM RAM Timer
output Com

All features in one chip

Ex: Microprocessor Intel

Ex: Microcontroller
PIC18F4550

13
Introduction to Embedded System

Microcontroller Versus Microprocessor

14
Introduction to Embedded System

Microcontroller Versus Microprocessor

Advantages Disadvantages

It is cheaper to purchase a microcontroller than all of Microcontroller are less flexible than microprocessor as
the components required for a microprocessors individual components cannot be replaced
Reduced number of components make production Microprocessor can be easily upgraded with higher
easier and reliable specification
Specific task only Microprocessor used for general purpose or multasking

Reduced power consumption

15
Introduction to Embedded System

Microcontroller Advantages Developers View

General Advantages Among Developers

Low cost

wide availability

Larger user base

Extensive collection of application notes

Availability of low cost or free development tools

Serial programming capability

16
Introduction to Embedded System

Developing Embedded System

Embedded System

Software Development Hardware Development

Writing required algorithm using Choosing MCU for project


high level language or low level Number of I/O ports
language Serial communication ports
Using a compiler or assembler Peripheral such timer, ADC
Debugging code to hex file Memory requirement
MDE LAB Processing speed
Power consumption
Proteus (Virtual Hardware)

17
Introduction to Embedded System

Developing Embedded System


Software
Development
(MDE LAB)

High Level Language Low Level Language

Using C programming Using Assembly language


Using Compiler to create Hex File Instruction Code
Using Assembler to create Hex File

Hex Code

Program Memory
Microcontroller

18
Application

We cannot solve our problems with the same thinking


we used when we created them
- Albert Einstein

19
Real Time Application

Objectives:

The importance of real Time Application


Design Real Time Application
Other microcontroller

20
Real Time Application

What is Real Time Application

A real-time application (RTA) is an application program that functions within a time frame that
the user senses as immediate or current.
The latency must be less than a defined value, usually measured in seconds.
Whether or not a given application qualifies as an RTA depends on the worst-case execution time
(WCET), the maximum length of time a defined task or set of tasks requires on a given hardware
platform.
The use of RTAs is called real-time computing (RTC).

Design Real Time Embedded System

Real-time systems are computer systems that monitor, respond to, or control an external
environment.
This environment is connected to the computer system through sensors, actuators, and other
input-output interfaces.
It may consist of physical or biological objects of any form and structure.
Often humans are part of the connected external world, but a wide range of other natural and
artificial objects, as well as animals, are also possible.

21
Real Time Application

Design Real Time Embedded System

Applications and examples of real-time systems are ubiquitous and proliferating, appearing as
part of our commercial, government, military, medical, educational, and cultural infrastructures.
The Example of RTES:

Autonomous Line Follower


Mobile Robot with Obstacle Avoidance
Temperature Control System
LCD Dislay
Password Door Security

22
Real Time Application

Design Real Time Embedded System

Autonomous Line Follower

23
Real Time Application

Design Real Time Embedded System

Temperature Control System

24
Real Time Application

Design Real Time Embedded System

Password Door Security

25
Real Time Application

Design Real Time Embedded System

Other Microcontroller

26

You might also like