a presentation on microcontroller 8051

22
A presentation on microcontroller 8051 Presented by- YASH VIJAYVERGIYA Roll no.0112ec061107

Upload: praveen-shrivastava

Post on 26-Oct-2014

115 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Presentation on Microcontroller 8051

A presentation on microcontroller 8051

Presented by-

YASH VIJAYVERGIYA

Roll no.0112ec061107

Page 2: A Presentation on Microcontroller 8051

INTRODUCTION:

8051 belongs to MCS-51 family of microcontrollers• MCS-51 was developed by Intel but othermanufacturers (e.g., Siemens, Philips) are secondsources of this family.

Features of the standard 8051

– 4K bytes internal ROM (program)– 128 bytes internal RAM (data)– Four 8-bit I/O ports– Two 16-bit timers– Serial interface– 64K external code memory space– 64K external data memory space– 210 bit-addressable locations

Page 3: A Presentation on Microcontroller 8051

Microprocessors vs. Microcontrollers

• Microprocessors are single-chip CPUs used in microcomputers

• Microcontrollers and microprocessors are different in three main aspects: hardware architecture, applications, and instruction set features

• Hardware architecture: A microprocessor is a single chip CPU while a microcontroller is a single IC contains a CPU and much of remaining circuitry of a complete computer (e.g., RAM, ROM, serial interface, parallel interface, timer, interrupt handling circuit)

• Applications: Microprocessors are commonly used as a CPU in computers while microcontrollers are found in small, minimum component designs performing control oriented

activities.

Page 4: A Presentation on Microcontroller 8051

Instruction set: Microprocessor instruction sets are processingIntensive

• Their instructions operate on nibbles, bytes, words, oreven double words.

• Addressing modes provide access to large arrays of datausing pointers and offsets.

– Microcontroller instruction sets cater to control ofinputs and outputs

• They have instructions to set and clear individual bits andperform bit operations.

• They have instructions for input/output operations, eventtiming, enabling and setting priority levels for interruptscaused by external stimuli.

• Processing power of a microcontroller is much lessthan a microprocessor

Page 5: A Presentation on Microcontroller 8051

8051 implements a separate memory space for programs(code) and data.• Both code and data may be internal, however, both expandusing external components to a maximum of 64K codememory and 64K data memory.• Internal memory consists of on-chip ROM and on-chip dataRAM.• On-chip RAM contains a rich arrangement of generalpurpose storage, bit addressable storage, register banks,and special function registers.• In the 8051, the registers and input/output ports arememory mapped and accessible like any other memorylocation.• In the 8051, the stack resides within the internal RAM,rather than in external RAM.

Page 6: A Presentation on Microcontroller 8051
Page 7: A Presentation on Microcontroller 8051

Bit Addressable RAM• Individual accessing of bits is a powerful feature of microcontrollers• Bits can be set, cleared, ANDed, ORed etc, with a single instruction• 8051 ports are bit-addressable, simplifying the interface to single bit inputs and outputs. • The 8051 contains 210 bit-addressable locations• 128 of these locations are at addresses 20H to 2FH and the rest are in the special function registers

Register Banks• The bottom 32 locations of internal memory contain theregister banks• 8051 supports 8 registers R0 to R7 and after a system reset(default) the registers are at address 00H to 07H• MOV A, R5: reads the content of address 05H into theaccumulator• MOV A,05H will do the same thing• The active register bank may be altered by changing theregister bank select bits in the Program Status Word (PSW)• Idea of register banks permits fast and effective contextswitching

Page 8: A Presentation on Microcontroller 8051

Special Function Registers

• 8051 has 21 special function registers (SFRs) at the

top of internal RAM from address 80H to FFH.

• Most of the addresses from 80H to FFH are not defined,

except for 21 of them.

• Some SFR’s are both bit-addressable and byte

addressable, depending on the instruction accessing

the register

Page 9: A Presentation on Microcontroller 8051

Block Diagram

CPU

On-chip RAM

On-chip ROM for program code

4 I/O Ports

Timer 0

Serial PortOSC

Interrupt Control

External interrupts

Timer 1

Timer/Counter

Bus Control

TxD RxDP0 P1 P2 P3

Address/Data

Counter Inputs

Page 10: A Presentation on Microcontroller 8051
Page 11: A Presentation on Microcontroller 8051

Pin Description of the 8051

PDIP/Cerdip

1234567891011121314151617181920

4039383736353433323130292827262524232221

P1.0

P1.1

P1.2

P1.3

P1.4

P1.5

P1.6

P1.7

RST

(RXD)P3.0

(TXD)P3.1

(T0)P3.4

(T1)P3.5

XTAL2

XTAL1

GND

(INT0)P3.2

(INT1)P3.3

(RD)P3.7

(WR)P3.6

Vcc

P0.0(AD0)

P0.1(AD1)

P0.2(AD2)

P0.3(AD3)

P0.4(AD4)

P0.5(AD5)

P0.6(AD6)

P0.7(AD7)

EA/VPP

ALE/PROG

PSEN

P2.7(A15)

P2.6(A14)

P2.5(A13)

P2.4(A12)

P2.3(A11)

P2.2(A10)

P2.1(A9)

P2.0(A8)

8051(8031)

1234567891011121314151617181920

4039383736353433323130292827262524232221

P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7RST

(RXD)P3.0(TXD)P3.1

(T0)P3.4(T1)P3.5

XTAL2XTAL1

GND

(INT0)P3.2(INT1)P3.3

(RD)P3.7(WR)P3.6

VccP0.0(AD0)P0.1(AD1)P0.2(AD2)P0.3(AD3)P0.4(AD4)P0.5(AD5)P0.6(AD6)P0.7(AD7)EA/VPPALE/PROGPSENP2.7(A15)P2.6(A14)P2.5(A13)P2.4(A12)P2.3(A11)P2.2(A10)P2.1(A9)P2.0(A8)

8051(8031)

Page 12: A Presentation on Microcontroller 8051

Vcc ( pin 40 ): Vcc provides supply voltage to the chip. The voltage source is +5V.

GND ( pin 20 ): ground XTAL1 and XTAL2 ( pins 19,18 ):

These 2 pins provide external clock. Way 1 : using a quartz crystal oscillator Way 2 : using a TTL oscillator Example 4-1 shows the relationship between XTAL and the

machine cycle.

Page 13: A Presentation on Microcontroller 8051

RST ( pin 9 ): reset It is an input pin and is active high ( normally low ) .

The high pulse must be high at least 2 machine cycles. It is a power-on reset.

Upon applying a high pulse to RST, the microcontroller will reset and all values in registers will be lost.

Reset values of some 8051 registers Way 1 : Power-on reset circuit Way 2 : Power-on reset with debounce

Page 14: A Presentation on Microcontroller 8051

/EA ( pin 31 ): external access There is no on-chip ROM in 8031 and 8032 . The /EA pin is connected to GND to indicate the code

is stored externally. /PSEN & ALE are used for external ROM. For 8051, /EA pin is connected to Vcc. “/” means active low.

/PSEN ( pin 29 ): program store enable This is an output pin and is connected to the OE pin of

the ROM.

Page 15: A Presentation on Microcontroller 8051

RST ( pin 9 ): reset It is an input pin and is active high ( normally low ) .

The high pulse must be high at least 2 machine cycles. It is a power-on reset.

Upon applying a high pulse to RST, the microcontroller will reset and all values in registers will be lost.

Reset values of some 8051 registers Way 1 : Power-on reset circuit Way 2 : Power-on reset with debounce

Page 16: A Presentation on Microcontroller 8051

Important features :-

8-bit ALU, Accumulator and Registers; hence it is an 8-bit microcontroller

8-bit It provides many functions (CPU, RAM, ROM, I/O, interrupt logic, timer, etc.) in a single package

data bus - It can access 8 bits of data in one operation 16-bit address bus - It can access 216 memory locations - 64 kB

( 65536 locations ) each of RAM and ROM On-chip RAM - 128 bytes ("Data Memory") On-chip ROM - 4 kB ("Program Memory") Four byte bi-directional input/output port UART (serial port) Two 16-bit Counter/timers Two-level interrupt priority Power saving mode

Page 17: A Presentation on Microcontroller 8051

Addressing Modes

RegisterDirect Register Indirect ImmediateRelativeAbsoluteLong Indexed

Page 18: A Presentation on Microcontroller 8051

Interrupts

1. Enabling and Disabling Interrupts

2. Interrupt Priority

3. Writing the ISR (Interrupt Service Routine)

Page 19: A Presentation on Microcontroller 8051
Page 20: A Presentation on Microcontroller 8051

Advantages

Popular - readily available and widely supported, a full range of free and commercial support products is available

Low cost - high level of system integration within one component, only a handful of components needed to create a working system.

Constant improvements - improvements in silicon/design increase speed

Page 21: A Presentation on Microcontroller 8051

Wide range - One set of tools covers the greatest horsepower range of any microcontroller family, the 8051 provides a real cost savings in tools, training, and software support.

- Compatibility - opcodes and binaries are the SAME for all 80x51 variants (unlike most other microcontroller families).

Multi-sourced - over 12 manufacturers, hundreds of varieties, something for everyone with the security of ready availability.

Page 22: A Presentation on Microcontroller 8051

Applications:- Engine management systems in automobiles.

Keyboard of a PC.

Electronic measurement instruments (such as digital multimeters, frequency synthesisers, and oscilloscopes)

Printers. Mobile phones. Televisions, radios, CD players, tape recording

equipment. Hearing aids. Security alarm systems, fire alarm systems, and building

services systems