basics of embedded systems

41
Introduction To Embedded System AR LABS (A TRAINING UNIT OF METACORTEX TECHNOLOGIES)

Upload: arlabstech

Post on 20-Jun-2015

1.237 views

Category:

Education


1 download

DESCRIPTION

The Presentation is basically made to give the overview of embedded systems try to implement this knowledge to make your own small embedded systems.

TRANSCRIPT

Page 1: Basics Of Embedded Systems

Introduction To Embedded System

AR LABS(A TRAINING UNIT OF METACORTEX

TECHNOLOGIES)

Page 2: Basics Of Embedded Systems

EMBEDDED SYSTEMS ??

Page 3: Basics Of Embedded Systems

LITERAL MEANING

EMBEDDED SYSTEM

Page 4: Basics Of Embedded Systems

BASIC DEFINTION

EMBEDDED SYSTEM: Combination of computer hardware & software, that is specifically designed for a particular kind of application device.

Page 5: Basics Of Embedded Systems

APPLICATIONS ARE NUMEROUS

Page 6: Basics Of Embedded Systems

APPLICATIONS OF EMBEDDED SYSTEM

Automotive electronics

Aircraft

Trains

Telecommunication

Page 7: Basics Of Embedded Systems
Page 8: Basics Of Embedded Systems

Specialties Of Embedded Systems

Performance

HIGH

Power Consumption

LOW

Cost

CHEAP

Size

SMALL

Software Up gradation capability

HIGH

Page 9: Basics Of Embedded Systems

BLOCK DIAGRAM OF EMBEDDED SYSTEM

Page 10: Basics Of Embedded Systems

Brain is the main part of the EMBEDDED SYSTEM or main centre of information processing.

For an embedded system designer knowledge of controlling unit or processor is a must.

The brain is often a microprocessor or microcontrollers.

CONTROLLING UNIT/BRAIN

Page 11: Basics Of Embedded Systems

BRAIN

Microprocessors Microcontrollers

32 bit 8 bit

DSPs, PC

16 bit 32 bit64 bit

CISC RISC

BRAIN

Page 12: Basics Of Embedded Systems

CPUGeneral-Purpose Micro-

processorRAM ROM I/O

PortTimer

Serial COM Port

Data Bus

Address Bus

General-Purpose Microprocessor System

CPU for ComputersNo RAM, ROM, I/O on CPU chip itself

Many chips on mother board

MICROPROCESSORS

Page 13: Basics Of Embedded Systems

Where to find microprocessors

Page 14: Basics Of Embedded Systems

What is a Microcontroller????????

Page 15: Basics Of Embedded Systems

Where To Find Microcontrollers?

• Microcontroller are found everywhere!• uC’s are considered embedded systems

Page 16: Basics Of Embedded Systems

Microprocessor

CPU is stand-alone, RAM, ROM, I/O,

timer are separate

designer can decide on the amount of ROM, RAM and I/O ports.

expensive

general-purpose

Microcontroller

CPU, RAM, ROM, I/O and timer are all on a

single chip

fix amount of on-chip ROM, RAM, I/O ports

for applications in which cost, power and space

are critical

single-purpose

v/s

Page 17: Basics Of Embedded Systems

COMMONLY USED CONTROLLERS..

8051 CONTROLLER BY INTEL / AT89C51

<< ADVANCED VIRTUAL RISC –AVR

PERIPHERAL INTERFACE CONTROLLER (PIC)

ADVANCE RISC MACHINE (ARM)

Page 18: Basics Of Embedded Systems

MICROCONTROLLER MANUFACTURERSo ATMEL

o MICROCHIP

o TEXAS INSTRUMENTS

o INTEL

o FREESCALE

Page 19: Basics Of Embedded Systems

PIC 16F877A

Owned & Developed By Microchip

Page 20: Basics Of Embedded Systems
Page 21: Basics Of Embedded Systems

Pic16f877a

8 bit uc

Analog features• 10 bit ADC• Brownout

reset

Memory feature• 368 bytes

of RAM • 256 bytes

of EEPROM• 8K FLASH

PROGRAM MEMORY

Peripheral• USART• 8 & 16 bit

Timer Counter

Special UC• IN Circuit

Serial Programming

Page 22: Basics Of Embedded Systems

368 x 8 bytes

(Data Memory)

256 x 8 bytes EEPROM

20 Mhz Clock Input

8K x 14 words

40/44-pin

3 TIMERS

T0,T2(8bit)

T1(16 bit)

Page 23: Basics Of Embedded Systems

PIC16F877A

RB7

RB6

RB5

RB3

RB4

RB1

RB2

Vdd

RB0

Vss

RD5

RD6

RD7

RD4

RC7

RC6

RC4

RC5

RD3

RD2

Vss

CLK1

CLK0

RD1

RD0

RC2

RC3

RC0

RC1

Vdd

RE2

RA2

RE1

RA3

RA4

RA5

RE0

RA0

Vpp

RA1

1

4

2

5

3

6

7

8

16

15

14

13

1211

10

9

18

17

20

19

21

23

22

27

29

28

26

25

24

35

34

33

32

31

30

40

39

38

37

36

PORT BRB0 - RB7

PORT CRC4-RC7

Higher Nibble

PORT CRC0-RC4

Lower Nibble

PORT DRD0 - RD3

Lower Nibble

PORT DRD7 – RD4

Higher Nibble

PORT ARA0-RA5

PORT ERE0 – RE1

SHOWING FIVE PORTS in uc

Oscillator

Page 24: Basics Of Embedded Systems

Programming

Page 25: Basics Of Embedded Systems

Write the program in PIC C.

Now burn the hex file using pic downloader.

Give Connections of Led’s on one port.

Steps to perform

Page 26: Basics Of Embedded Systems

Points To Remember

We have 5 bidirectional PORTS in our controller.

Any peripheral will be connected to these ports only.

The value on these ports decides the functionality of peripheral

Page 27: Basics Of Embedded Systems

Points To Remember

There are some predefined functions under the header file <pic16f877a.h> which we use

1.output_low(pin_x): Used to make particular pin low(0)

2.output_high(pin_x):Used to make particular pin high(1)

3.Output_port(value): using this function ,value is loaded on the port.

Page 28: Basics Of Embedded Systems

For e.g. we want to send a value like 15 on port B

In binary It means 00001111

We will writeOutput_port(15)

1=ON

0=Off

Red = on =1Blue =Off=0

Page 29: Basics Of Embedded Systems

another e.g. we want to send value

now 116 on port D

In binary It means 01110100

We will writeOutput_port(116)

Red = on =1Blue =Off=0

Page 30: Basics Of Embedded Systems

# include Header files#Use clock

Void main() {WHILE(1)

{

Output_port(y)

} while loop END

Main loop end

Page 31: Basics Of Embedded Systems

Body of Program

1. Include Header FILE2. Specify Clock

3. Void main() {4. Infinite LOOP {

Output_port( x)} }

Page 32: Basics Of Embedded Systems

To Blink a Single LED

#include<16f877a.h> //Header file to specify device#use delay(clock=20000000) //Definition of frequencyvoid main(){int x = 0; // Variable initializationwhile(1){output_high(pin_a0); //sets the pin a0delay_ms(400); // delay of 400msoutput_low(pin_a0); //clears the specified pin. a0 in this casedelay_ms(400); }

Page 33: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

After coming to while(1), it

stuck in infinite loop

Page 34: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

Page 35: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

Used to make pin a0 high

i.e., to glow led

Page 36: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

Used to generate delay of 400ms.

Page 37: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

Used to make pin a0 low

i.e., to off led

Page 38: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

Page 39: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

Page 40: Basics Of Embedded Systems

How Program Actually Works

#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }

& so on..

Page 41: Basics Of Embedded Systems

TO Blink ALL LED

#include<16f877a.h> // Header file to add the device#use delay(clock=20000000) // defination of frequencyvoid main(){int x = 0; // port data variable initialization while (1){output_b(x); // data sent to port bdelay_ms(400); // delay of 400msx= x^255; // XOR with 225 to complement the

} // data}