embedded system ppt

52
Compiled By : Surender singh Dept. –ECE(Electronics & comm. Roll no. – 09-ece-57

Upload: surender-singh

Post on 09-Nov-2014

65 views

Category:

Documents


2 download

DESCRIPTION

this is ppt for introduction about embedded systems and microconttroller & microprocessor

TRANSCRIPT

Page 1: embedded system ppt

Compiled By :Surender singhDept. –ECE(Electronics & comm.Roll no. – 09-ece-57

Page 2: embedded system ppt

• The embedded system is a combination of computer hardware, software additional electrical & mechanical parts

• A computer is used in such devices primarily as a means to simplify the system design and to provide flexibility.

• Embedded systems employ the use of a RTOS (Real-Time Operating System).

Page 3: embedded system ppt

Block Diagram of Block Diagram of Embedded SystemEmbedded System

Page 4: embedded system ppt

Microcontroller

RAM ROM

I/O Port

TimerSerial COM Port

CPU

• A smaller computer.• On-chip RAM, ROM, I/O ports...• Example:- Motorola’s 6811, Intel’s 8051 and PIC 16X

A single chip

Microcontroller Microcontroller

Page 5: embedded system ppt
Page 6: embedded system ppt

The 8051 MicrocontrollerThe 8051 Microcontroller : :

• The 8051 is the first microcontroller of the MCS-51 family introduced by Intel Corporation at the end of the 1970’s.

• The 8051 family characteristics:

○ The 8051 family characteristics:○ 4K Bytes ROM○ 128 Bytes RAM○ two timer/counters (16 bit)○ A serial port○ 32 input/output port○ Interrupt controller

Page 7: embedded system ppt

8051 Internal Architecture8051 Internal Architecture

Page 8: embedded system ppt

IC 8051 Pin DescriptionIC 8051 Pin Description

Ground

Voltage Supply

(+5V)

Page 9: embedded system ppt

IC 8051 Pin DescriptionIC 8051 Pin Description

Port 0 from Pin-39 to Pin-32

An 8-bit open drain bidirectional port.

DUAL FUNCTION

Used to access both data and address

Page 10: embedded system ppt

IC 8051 Pin DescriptionIC 8051 Pin Description

Port 1 fromPin-1 to pin-8

8-bit bidirectional I/O port with internal pull-ups

Page 11: embedded system ppt

IC 8051 Pin DescriptionIC 8051 Pin Description

Port 2 fromPin-21 to pin-28

Used to access address and I/O

Page 12: embedded system ppt

IC 8051 Pin DescriptionIC 8051 Pin Description

Port 3 from Pin-10 to Pin-17

P3.0 : RxD(serial input port)P3.1 :TxD (serial output port)P3.2 :INT0 (external interrupt 0)P3.3 :INT1 (external interrupt 1)P3.4 :T0 (timer 0 external input)P3.5 :T1 (timer 1 external input)P3.6 :WR (external data memory write strobe)P3.7 :RD (external data memory read strobe)

Page 13: embedded system ppt

crystal

reset

External memory

Add. Latch enable

Program Store Enable

IC 8051 Pin DescriptionIC 8051 Pin Description

Page 14: embedded system ppt

IC 8051 Daily ApplicationsIC 8051 Daily Applications

Moving message displayDigital clock

Traffic Light7 segment display

Page 15: embedded system ppt

•Immediate addressing modesADD A, #23h (Add immediate data to Acc)

•Register addressing modesADD A, R2 (Add register to Accumulator)

•Direct addressing modesADD A, 40h (Add data at location 40h to

Accumulator)

•Register Indirect addressing modesADD A,@R2 (Add indirect RAM to Acc)

IC 8051 Addressing ModesIC 8051 Addressing Modes

Page 16: embedded system ppt

Interrupts in 8051Interrupts in 8051

• An interrupt is an external or internal event that interrupts the microcontroller to inform it that a device needs its service

• The advantage of interrupts is that the microcontroller can serve many devices (not all at the same time)

time

Interrupt serviceInterrupt serviceProgram Program

Page 17: embedded system ppt

Interrupts in 8051Interrupts in 8051EA - ET2 ES ET1 EX1 ET0 EX0

Internal Interrupts

EX0 Enables or disables external interrupt ET0 Enables or disables timer 0 overflow interruptEX1 Enables or disables external interrupt 1ET1 Enables or disables timer 1 overflow interruptES Enables or disables the serial port interruptET2 Enables or disables timer 2 overflow or capture interrupt -- Not implemented, reserved for future useEA Disables all interrupts

External Interrupts

P3.2 :INT0 (external interrupt 0)P3.3 :INT1 (external interrupt 1)

Page 18: embedded system ppt

CPUGeneral-Purpose Micro-

processorRAM ROM I/O

PortTimer

Serial COM Port

Data Bus

Address Bus

General-Purpose Microprocessor System

• CPU for Computers• No RAM, ROM, I/O on CPU chip itself• Example--Intel’s x86: 8086,8088,80386,80486, Pentium

Many chips on mother board

General Purpose General Purpose MicroprocessorMicroprocessor

Page 19: embedded system ppt
Page 20: embedded system ppt

The 8085 Microprocessor :The 8085 Microprocessor :

• The features of INTEL 8085 are :

• It is an 8 bit processor.• It is a single chip N-MOS

device with 40 pins.• It has multiplexed address

and data bus.(AD0-AD7).• It works on 5 Volt dc power

supply.• The maximum clock

frequency is 3 MHz while minimum frequency is 500kHz.

• It provides 74 instructions with 5 different addressing modes.

Page 21: embedded system ppt

IC 8085 Pin DescriptionIC 8085 Pin Description

Page 22: embedded system ppt

•AD0-AD7: Multiplexed Address and data lines.

•A8-A15: Tri-stated higher order address lines.

•ALE: Address latch enable is an output signal.It goes high when operation is started by processor .

•S0,S1: These are the status signals used to indicate type of operation.

•RD¯: Read is active low input signal used to read data from I/O device or memory.

•WR¯: Write is an active low output signal used write data on memory or an I/O device.

IC 8085 Pin DescriptionIC 8085 Pin Description

Page 23: embedded system ppt

• READY: This an output signal used to check the status of output device.If it is low, µP will WAIT until it is high.

• TRAP: It is an Edge triggered highest priority , non mask able interrupt. After TRAP, restart occurs and execution starts from address 0024H.

• RST 5.5,6.5,7.5: These are maskable interrupts and have low priority than TRAP.

• INTR¯&INTA: INTR is a interrupt request signal after which µP generates INTA or interrupt acknowledge signal.

•IO/M¯: This is output pin or signal used to indicate whether 8085 is working in I/O mode(IO/M¯=1) or Memory mode(IO/M¯=0 ).

IC 8085 Pin DescriptionIC 8085 Pin Description

Page 24: embedded system ppt

•HOLD&HLDA: HOLD is an input signal .When µP receives HOLD signal it completes current machine cycle and stops executing next instruction. In response to HOLD µP generates HLDA that is HOLD Acknowledge signal.

•RESET IN¯: This is input signal. When RESET IN¯ is low µp restarts and starts executing from location 0000H.

•SID: Serial input data is input pin used to accept serial 1 bit data .

•X1 & X2 : These are clock input signals and are connected to external LC,or RC circuit.These are divide by two so if 6 MHz is connected to X1X2, the operating frequency becomes 3 MHz.

•VCC & VSS: Power supply VCC=+ -5Volt& VSS=-GND reference.

IC 8085 Pin DescriptionIC 8085 Pin Description

Page 25: embedded system ppt

Microprocessor v/s MicrocontrollerMicroprocessor

• CPU is stand-alone, RAM, ROM, I/O, timer are separate

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

• expansive• versatility • general-purpose

Microcontroller

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

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

• for applications in for applications in which cost, power and which cost, power and space are criticalspace are critical

• single-purposesingle-purpose

Page 26: embedded system ppt

8085 Internal Architecture8085 Internal Architecture

Page 27: embedded system ppt

Accumulator: Accumulator: It is 8 bit general purpose register.It is connected to ALU. So most of the operations are done in

Acc.

Temporary register: Temporary register: All the arithmetic and logical operations are done in the

temporary register but user can’t access it.

Flag: Flag: It is a group of 5 flip flops used to know status of various

operations done.

The Flag Register along with Accumulator is called PSWor Program Status Word.

Arithmetic and Logical Arithmetic and Logical GroupGroup

Page 28: embedded system ppt

S: S: Sign flag is set when result of an operation is negative.

ZZ: Zero flag is set when result of an operation is 0.

AcAc: Auxiliary carry flag is set when there is a carry out of lower nibble or lower four bits of the operation.

CY: CY: Carry flag is set when there is carry generated by an operation.

P: P: Parity flag is set when result contains even number of 1’s.Rest are don’t care flip flops.

Arithmetic and Logical Arithmetic and Logical GroupGroup

SS ZZ -- ACAC -- PP -- CYCY

Flag is given by :Flag is given by :

Page 29: embedded system ppt

Temporary registers (W,Z): Temporary registers (W,Z): These are not available for user. These are loaded only when there is an operation being performed.

General purpose: General purpose: There are six general purpose registers in 8085 namely

B,C,D,E,H,L These are used for various data manipulations.

Special purposeSpecial purpose : There are two special purpose registers in 8085:

SP : (SP : (Stack Pointer) This is a temporary storage memory 16 bit register. Since there are only 6 general purpose registers, there is a need to reuse them

PC: (PC: (Program Counter) It is 16 bit register used to point the location from which the next instruction is to be fetched.

Register GroupRegister Group

Page 30: embedded system ppt

Immediate addressing:Immediate addressing:Immediate data is transferred to address or register.Example : MVI A,20H

Register addressing:Register addressing:Data is transferred from one register to other.Example : MOV A, C

Indirect addressing:Indirect addressing:Data is transferred from address pointed by the data in a register to other register or vice-versa.Example: MOV A, M

Implied addressing:Implied addressing:These doesn’t require any operand. The data is specified in Opcode itself.Example: RAL: Rotate left with carry.

IC 8085 Addressing modesIC 8085 Addressing modes

Page 31: embedded system ppt

Interrupts in 8085Interrupts in 8085

• An interrupt is considered to be an emergency signal that may be serviced. The Microprocessor may respond to it as soon as possible.

Interrupts can also be classified into:• Maskable InterruptsMaskable Interrupts (Can be delayed or Rejected)

• Non-Maskable InterruptsNon-Maskable Interrupts (Can not be delayed or Rejected)

The 8085 has 5 interrupt inputs.

The INTR input :The INTR input : INTR is mask-able using the EI/DI instruction pair.

RST 5.5, RST 6.5, RST 7.5 :RST 5.5, RST 6.5, RST 7.5 : They are all mask-able.TRAPTRAP : is the only non-mask-able interrupt in the 8085

Page 32: embedded system ppt

Interrupts in 8085Interrupts in 8085

The 8085 recognizes 8 RESTART instructions: RST0 - RST7 . Each of these would send the execution to a predetermined hard-wired memory location:

Restart Instruction

Equivalent to

RST0 CALL 0000H

RST1 CALL 0008H

RST2 CALL 0010H

RST3 CALL 0018H

RST4 CALL 0020H

RST5 CALL 0028H

RST6 CALL 0030H

RST7 CALL 0038H

Page 33: embedded system ppt

• The µP operates with reference to clock signal. The rise and fall of the pulse of the clock gives one clock cycle.

• Each clock cycle is called a T state and a collection of several T states gives a machine cycle.

• Important machine cycles are :

1. Op-code fetch.2. Memory read.3. Memory write. 4. I/Op-read.5. I/O write.

Timing and State DiagramTiming and State Diagram

Page 34: embedded system ppt

Timing and State DiagramTiming and State DiagramOp-code fetch cycle :

Page 35: embedded system ppt

Seven segments are electronic components that can be used to displaying alphanumeric characters, 7 LED are used (as shown in figure) and is designed from a dot-point with the size.

pin configuration of seven segment

Seven Segment DisplaySeven Segment Display

Page 36: embedded system ppt

Port Relations Microcontroller with pin 7 Segment

7 pins of the microcontroller are used to shape the character of your LED display

Seven Segment DisplaySeven Segment Display

Page 37: embedded system ppt

Table 1. Configuring the Character 7 Segment Data

Seven Segment DisplaySeven Segment Display

Page 38: embedded system ppt

8051 Microcontroller

Design Softwares

Page 39: embedded system ppt

Software’sSoftware’s UsedUsed

Keil µVisionTop View Simulator

Express PCB

Page 40: embedded system ppt

Keil µVision IDEThe µVision IDE from Keil

combines project management, make facilities, source code editing, program debugging, and complete simulation in one powerful environment. The µVision development platform is easy-to-use and helping you quickly create embedded programs that work. The µVision editor and debugger are integrated in a single application that provides a seamless embedded project development environment.

Page 41: embedded system ppt
Page 42: embedded system ppt

Top View Simulator• Topview Simulator gives

an excellent simulation environment for MCS 51 Microcontroller. 

A beginner can learn about 8051 based embedded solutions without any hardware. An experienced designer, you may find most of the required facilities built in the simulator that enabling  you to complete your next project without waiting for the target hardware. 

Page 43: embedded system ppt

Top View Simulator

A Top View Simulator Program

Page 44: embedded system ppt

Express PCBExpress PCB allows you to design schematics and PCB's. It is ideal for those that are looking to design anywhere from a two to four layer circuit board. A drop and drag design allows users to pick the components of the circuit board and drop it onto the circuit board in the software program. The designer can then place various pins in the circuit board to show where things need to be connected. It also has the ability of the program to show the designer where there are flaws in their design.

Page 45: embedded system ppt

This way we can include resistors

This way we can include different

kind of IC’s

Express PCB

Page 46: embedded system ppt

DC Motor interfacing with MicrocontrollersDC motors are always preffered over stepper motors.

There are many things which we can do with our DC motor when interfaced with microcontroller.

For example: we can control the speed of motor, we can control the direction of rotation, we can also do encoding of the rotation made by DC motor i.e.

keeping track of how many turns are made by our motors etc.

Usually H-bridge is preffered way of interfacing a DC motor.L293D is most used H-Bridge driver IC.

Page 47: embedded system ppt

Working of H-BridgeThe name "H-Bridge" is derived from the actual shape of the

switching circuit which control the motion of the motor. It is also known as "Full Bridge". Basically there are four switching elements in the H-Bridge as shown

Page 48: embedded system ppt

Truth Table For H-Bridge

Truth Table

High Left High Right Low Left Low Right Description

On Off Off OnMotor runs clockwise

Off On On OffMotor runs

anti-clockwise

On On Off OffMotor

stops or decelerates

Off Off On OnMotor

stops or decelerates

Page 49: embedded system ppt

Stepper MotorOf all motors, step motor is the easiest to

control. It's handling simplicity is really hard to deny - all there is to do is to bring the sequence of rectangle impulses to one input of step controller and direction information to another input. Direction information is very simple and comes down to "left" for logical one on that pin and "right" for logical zero.

Motor control  is also very simple - every impulse makes the motor operating for one step and if there is no impulse the motor won't start. Pause between impulses can be shorter or longer and it defines revolution rate. This rate cannot be infinite because the motor won't be able to "catch up" with all the impulses (documentation on specific motor should contain such information)..

Page 50: embedded system ppt

Interfacing of Stepper motor with 8051

Page 51: embedded system ppt

Clock-wise Rotation of the Coils

1 2 3 4

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

Truth table

Page 52: embedded system ppt