MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National...

94
MICROCONTROLLER-8051 MICROCONTROLLER-8051 Features & Applications Features & Applications Dr. Y .Narasimha Murthy Dr. Y .Narasimha Murthy Ph.D., Ph.D., Sri Saibaba National Sri Saibaba National College College (Autonomous) (Autonomous) ANANTAPUR-515001(A.P) ANANTAPUR-515001(A.P)

Transcript of MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National...

Page 1: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

MICROCONTROLLER-MICROCONTROLLER-80518051

Features & ApplicationsFeatures & Applications

Dr. Y .Narasimha Murthy Dr. Y .Narasimha Murthy Ph.D.,Ph.D.,

Sri Saibaba National Sri Saibaba National CollegeCollege

(Autonomous)(Autonomous)ANANTAPUR-515001(A.P) ANANTAPUR-515001(A.P)

Page 2: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

… ….. .. Man’s glory lies in his knowledge,Man’s glory lies in his knowledge,

his upright conduct, his praise-worthy his upright conduct, his praise-worthy character,character,

his wisdom, and not in his nationality or his wisdom, and not in his nationality or rankrank

--Baha’ullah--Baha’ullah

(From, the book The 8051 Microcontroller and Embedded systems- (From, the book The 8051 Microcontroller and Embedded systems- Mazidi ) Mazidi )

Page 3: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

OverviewOverview

IntroductionIntroductionBlock Diagram and Block Diagram and Pin Pin Description of the 8051Description of the 8051RegistersRegistersMemory mapping in 8051 Memory mapping in 8051 Stack in the 8051Stack in the 8051I/O Port ProgrammingI/O Port ProgrammingTimersTimersInterrupts &Interrupts &ApplicationsApplications

Page 4: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Its not an exaggeration if I say that ,today there is no electronic gadget on the earth which is designed without a Microcontroller. Ex: communication devices, digital entertainment, portable devices etc…

Not believable ??? See the next slide

Why do we need to learn Why do we need to learn Microcontrollers ?Microcontrollers ?

Page 5: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Personal information products: Cell phone, Personal information products: Cell phone, pager, watch, pocket recorder, calculatorpager, watch, pocket recorder, calculator

Laptop components: mouse, keyboard, Laptop components: mouse, keyboard, modem, fax card, sound card, battery modem, fax card, sound card, battery chargercharger

Home appliances: door lock, alarm clock, Home appliances: door lock, alarm clock, thermostat, air conditioner, TV remote, thermostat, air conditioner, TV remote, VCR, small refrigerator, exercise VCR, small refrigerator, exercise equipment, washer/dryer, microwave ovenequipment, washer/dryer, microwave oven

Industrial equipment: Industrial equipment: Temperature/pressure controllers, Temperature/pressure controllers, Counters, timers, RPM Controllers Counters, timers, RPM Controllers

Toys: video games, cars, dolls, etc. Toys: video games, cars, dolls, etc.

Page 6: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

So, A good designer should always know what type of controller he/she is using ,their architecture, advantages , disadvantages , ways to reduce production costs and product reliability etc….

O.K ????O.K ????

Page 7: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Then What is a Microcontroller ?

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

Zilog’s Z8 and PIC 16X

RAM ROM

I/O Port

TimerSerial COM Port

CPU

A single chip Microcontroller

Page 8: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

How is it different from a How is it different from a Microprocessor ??Microprocessor ??

General-purpose microprocessorCPU for ComputersNo RAM, ROM, I/O on CPU chip itselfExample : Intel’s x86, Motorola’s 680x0CPU

General-Purpose Micro-processor

RAM ROM I/O Port

TimerSerial COM Port

Data Bus

Address Bus

Page 9: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

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.

expansive versatility 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

• Highly bit addressable

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

• single-purpose

Microprocessor vs. Microcontroller

Page 10: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

EVOLUTIONEVOLUTION

Flashback !!!!Flashback !!!! In the year 1976, Motorola created a In the year 1976, Motorola created a

Microprocessor chip called 6801 which Microprocessor chip called 6801 which replaced its brother 6800 with certain add-replaced its brother 6800 with certain add-on chips to make a computer. This paved on chips to make a computer. This paved the way for the new revolution in the history the way for the new revolution in the history of chip design and gave birth to a new of chip design and gave birth to a new entity calledentity called

MICROCONTROLLER.MICROCONTROLLER.

The INTEL bagged the credit of producing The INTEL bagged the credit of producing the first Microcontroller 8048 with a CPU the first Microcontroller 8048 with a CPU and 1K bytes of EPROM, 64 Bytes of RAM and 1K bytes of EPROM, 64 Bytes of RAM an 8-Bit Timer and 27 I/O pins in 1976. an 8-Bit Timer and 27 I/O pins in 1976.

Page 11: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Evolution Evolution contdcontd……

Then followed the most popular Then followed the most popular controller 8051 in the year 1980 controller 8051 in the year 1980 with 4K bytes of ROM,128 Bytes of with 4K bytes of ROM,128 Bytes of RAM RAM , a serial port, two 16-bit Timers , a serial port, two 16-bit Timers , and 32 I/O pins., and 32 I/O pins.

The 8051 family has many additions The 8051 family has many additions and improvements over the years and improvements over the years and remains a most soughtafter tool and remains a most soughtafter tool for todays circuit designers.for todays circuit designers.

The same INTEL introduced a 16 bit The same INTEL introduced a 16 bit controller 8096 in the year 1982 controller 8096 in the year 1982

Page 12: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Later INTEL introduced 80c196 Later INTEL introduced 80c196 series of 16-bit microcontrollers for series of 16-bit microcontrollers for mainly industrial applicationsmainly industrial applications

Microchip, another company has Microchip, another company has introduced a microcontroller PIC introduced a microcontroller PIC 16C64 an 8-bit in the year 198516C64 an 8-bit in the year 1985..

32-bit microcontrollers have been 32-bit microcontrollers have been developed by IBM and Motorola-MPC 505 developed by IBM and Motorola-MPC 505 is a 32-bit RISC controller of Motorolais a 32-bit RISC controller of Motorola

The 403 GA is a 32 -bit RISC embedded The 403 GA is a 32 -bit RISC embedded controller of IBMcontroller of IBM

Page 13: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

ARM ControllersARM Controllers

In recent times ARM company In recent times ARM company (Advanced Risc machines) has (Advanced Risc machines) has developed and introduced 32 bit developed and introduced 32 bit controllers which are highend controllers which are highend application devices,especially application devices,especially communication devices like mobiles , communication devices like mobiles , ipods etc..(Refer www.arm.com)ipods etc..(Refer www.arm.com)

Page 14: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Types of Microcontrollers Types of Microcontrollers

Page 15: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Microcontrollers from different Microcontrollers from different manufacturersmanufacturers

•Atmel •ARM •Intel

•8-bit •8XC42 •MCS48 •MCS51 •8xC251

•16-bit •MCS96 •MXS296

•National Semiconductor •COP8

•Microchip •12-bit instruction PIC •14-bit instruction PIC

•PIC16F84 •16-bit instruction PIC

•NEC

•Motorola •8-bit

•68HC05 •68HC08 •68HC11

•16-bit •68HC12 •68HC16

•32-bit •683xx

•Texas Instruments •TMS370 •MSP430

•Zilog •Z8 •Z86E02

Page 16: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

MCS-51 “Family” of MCS-51 “Family” of MicrocontollersMicrocontollers

Feature 8031 8051 8052 Feature 8031 8051 8052 8751 8751

ROM ROM NONO 4kB 8kB 4kB UV 4kB 8kB 4kB UV EpromEprom

RAM (Bytes) 128 128 256 RAM (Bytes) 128 128 256 128128

TIMERS 2 2 3 2TIMERS 2 2 3 2

I/O PINS 32 32 32 32I/O PINS 32 32 32 32

SERIAL PORTS 1 1 1 1SERIAL PORTS 1 1 1 1

INTERRUPT INTERRUPT 6 6 8 66 6 8 6 SOURCESSOURCES

Page 17: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Microcontroller Microcontroller ArchitecturesArchitectures

CPUProgram + Data

Address Bus

Data Bus

Memory

Von NeumannArchitecture

CPUProgram

Address Bus

Data Bus

HarvardArchitecture

Memory

Data

Address Bus

Fetch Bus

0

0

0

2n

Page 18: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Important Features of Important Features of 80518051

4K bytes ROM4K bytes ROM 128 bytes RAM128 bytes RAM Four 8-bit I/O portsFour 8-bit I/O ports Two 16-bit timersTwo 16-bit timers Serial interfaceSerial interface 64K external code memory space64K external code memory space 64K data memory space64K data memory space

Page 19: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

““Original” 8051 Original” 8051 MicrocontrollerMicrocontroller

Oscillator and timing

4096 Bytes Program Memory

(ROM)

128 BytesData Memory

(RAM)

Two 16 Bit Timer/Event

Counters

8051 CPU

64 K Byte Bus Expansion

Control

Programmable I/O

Programmable Serial Port Full Duplex UART

Synchronous Shifter

Internal data bus

External interrupts

subsystem interrupts

Control Parallel portsAddress Data BusI/O pins

Serial InputSerial Output

Page 20: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Pin Description of the 8051Pin Description of the 8051 The 8051 is a 40 The 8051 is a 40

pin device, but pin device, but out of these 40 out of these 40 pins, 32 are used pins, 32 are used for I/O. for I/O.

24 of these are 24 of these are dual purpose, i.e. dual purpose, i.e. they can operate they can operate as I/O or a as I/O or a control line or as control line or as part of address part of address or date bus.or date bus.

Page 21: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

8051 CPU 8051 CPU RegistersRegisters

A (8-bit Accumulator)B (8-bit register for Mul &Div)PSW (8-bit Program Status Word)SP (8-bit Stack Pointer)PC (16-bit Program Counter)DPTR (16-bit Data Pointer)

Page 22: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Special Function RegistersSpecial Function Registers

DATA registers

CONTROL registers

•Timers

•Serial ports

•Interrupt system

•Analog to Digital converter•Digital to Analog converter etc..

Addresses 80h – FFh

Direct Addressing is used to access SFRs

Page 23: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

List of RegistersList of Registers(*Denotes the SFRs)(*Denotes the SFRs)

Page 24: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Contd…Contd…

Page 25: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

PSW REGISTERPSW REGISTER

Page 26: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Memory mapping in 8051 Memory mapping in 8051

ROM memory map in 8051 family

0000H

0FFFH

0000H

1FFFH

0000H

7FFFH

80518752

4k

DS5000-32

8k 32k

from Atmel Corporation

from Dallas Semiconductor

Page 27: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

RAM memory space allocation in the 8051

7FH

30H

2FH

20H

1FH

17H

10H

0FH

07H

08H

18H

00HRegister Bank 0

)Stack (Register Bank 1

Register Bank 2

Register Bank 3

Bit-Addressable RAM

Scratch pad RAM

Page 28: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

PORTS OF 8051PORTS OF 8051

8051 has 4 Ports. Port 0, Port1, 8051 has 4 Ports. Port 0, Port1, Port2 , Port3Port2 , Port3 Port 0 is a dual purpose port, it is located Port 0 is a dual purpose port, it is located

from pin 32 to pin 39 (8 pins). To use this from pin 32 to pin 39 (8 pins). To use this port as both input/output ports each pin port as both input/output ports each pin must be connected externally to a 10 k ohm must be connected externally to a 10 k ohm pull-up resistor.This is because Port 0 is an pull-up resistor.This is because Port 0 is an open drain. open drain.

Simple ex: Simple ex: MOV A, #22MOV A, #22

BACK BACK MOV P0 ,A P0 ,A

ACALL DELAYACALL DELAY

CPL ACPL A

SJMP BACK SJMP BACK

Page 29: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Port 0 with Pull-Up ResistorsPort 0 with Pull-Up Resistors

Page 30: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Port 1 is a dedicated I/O port from pin 1 to pin 8.Upon reset it is configured as outport. It is generally used for interfacing to external device thus if you need to connect to switches or LEDs, you could make use of these 8 pins,but it doesn’t need any pull-up resistors as it is having internally

Like port 0, port 2 is a dual-purpose port.Like port 0, port 2 is a dual-purpose port.(Pins 21 through 28) It can be used for (Pins 21 through 28) It can be used for general I/O or as the high byte of the general I/O or as the high byte of the address bus for designs with external address bus for designs with external code memorycode memory.Like P1 ,Port2 also doesn’t .Like P1 ,Port2 also doesn’t require any pull-up resistorsrequire any pull-up resistors

Ports….Ports….

Page 31: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Ports contd…Ports contd…

Port 3 is also dual purpose but designers Port 3 is also dual purpose but designers generally avoid using this port generally avoid using this port unnecessarily for I/O because the pins unnecessarily for I/O because the pins have alternate functions which are related have alternate functions which are related to special features of the 8051. to special features of the 8051. Indiscriminate use of these pins may Indiscriminate use of these pins may interfere with the normal operation of the interfere with the normal operation of the 8051.8051.

However, for a programmer, it is the same to program P0, P1, P2 and P3.

All the ports upon RESET are configured as output. To use any of the ports as an input port,it must be set(Programmed)

Page 32: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Alternate functions of P3Alternate functions of P3

Page 33: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

I/O Port structureI/O Port structure The internal circuitry for the I/O port is The internal circuitry for the I/O port is

shown in the next slideshown in the next slide If you want to read in from a pin, you If you want to read in from a pin, you

must first give a logic ‘1’ to the port latch must first give a logic ‘1’ to the port latch to turn off the FET otherwise the data to turn off the FET otherwise the data read in will always be logic ‘0’.read in will always be logic ‘0’.

When you write to the port you are When you write to the port you are actually writing to the latch e.g. a logic 0 actually writing to the latch e.g. a logic 0 given to the latch will be inverted and given to the latch will be inverted and turn on the FET which cause the port pin turn on the FET which cause the port pin to be connected to Gnd (logic 0).to be connected to Gnd (logic 0).

Page 34: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

I/O I/O Port contd…Port contd…

Page 35: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Timers /CountersTimers /Counters The 8051 has 2 timers/counters: The 8051 has 2 timers/counters:

Timer/Counter 0 Timer/Counter 0 Timer/Counter 1Timer/Counter 1

They can be used asThey can be used as

1.1. TheThe TimerTimer :Uused as a time delay generator. :Uused as a time delay generator. The clock source is the The clock source is the internal internal crystal frequency crystal frequency

of the 8051.of the 8051.

2.2. An event An event countercounter.. External inputExternal input from input pin to count the from input pin to count the

number of events on registers.number of events on registers. These clock pulses cold represent the number of These clock pulses cold represent the number of

people passing through an entrance, or the people passing through an entrance, or the number of wheel rotations, or any other event that number of wheel rotations, or any other event that can be converted to pulses.can be converted to pulses.

Page 36: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Timer Timer Set the initial value of registersSet the initial value of registers Start the timer and then the 8051 Start the timer and then the 8051

counts up.counts up. Input from internal system clock Input from internal system clock

(machine cycle)(machine cycle) When the registers equal to 0 and the When the registers equal to 0 and the

8051 sets a bit to denote time out8051 sets a bit to denote time outtoLCD

P1

8051

TL0

TH0

P2SetTimer 0

Page 37: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

CounterCounter Count the number of eventsCount the number of events

Show the number of events on registersShow the number of events on registers External input from T0 input pin (P3.4) External input from T0 input pin (P3.4)

for Counter 0for Counter 0 External input from T1 input pin (P3.5) External input from T1 input pin (P3.5)

for Counter 1for Counter 1 External inputExternal input from Tx input pin. from Tx input pin. We use Tx to denote T0 or T1.We use Tx to denote T0 or T1.

T0

toLCD

P3.4

P1

8051

a switch

TL0

TH0

Page 38: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

RegistersRegisters Used in Used in Timer/CounterTimer/Counter

8051 has two 16-bit Timer 8051 has two 16-bit Timer registers ,Timer 0 & Timer 1.registers ,Timer 0 & Timer 1.

As 8051 has 8-bit architecture , each As 8051 has 8-bit architecture , each Timer register is treated as two 8-bit Timer register is treated as two 8-bit registers namelyregisters namely

TH0, TL0, TH1, TL1. TH0, TL0, TH1, TL1. One 8-bit mode register -TMOD.One 8-bit mode register -TMOD. One 8-bit control register-TCON.One 8-bit control register-TCON.

Page 39: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

TMOD TMOD RegisterRegister

Both Timer 0 &Timer 1 use the same Mode Both Timer 0 &Timer 1 use the same Mode register TMOD.register TMOD.

It is an-8-bit register .The lower 4-bits are It is an-8-bit register .The lower 4-bits are meant for Timer 0 &the uooer 4-bits are meant meant for Timer 0 &the uooer 4-bits are meant for Timer 1for Timer 1

It is not bit addressible.It is not bit addressible. It is used similar to any other register of It is used similar to any other register of

8051 . For ex:8051 . For ex: MOV TMOD,#21HMOV TMOD,#21H

GATE C/T M1 M0 GATE C/T M1 M0Timer 1 Timer 0

(MSB) (LSB)

Page 40: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

GateGate Every timer has a mean of starting and stopping.Every timer has a mean of starting and stopping.

GATE=0GATE=0 InternalInternal control control The start and stop of the timer are controlled The start and stop of the timer are controlled

by way of by way of software.software. Set/clear the TR for start/stop timer.Set/clear the TR for start/stop timer. SETB TR0SETB TR0 CLR TR0CLR TR0

GATE=1GATE=1 ExternalExternal control control The hardware way of starting and stopping The hardware way of starting and stopping

the timer by the timer by softwaresoftware and and an external an external sourcesource..

Timer/counter is enabled only while the INT Timer/counter is enabled only while the INT pin is high and the TR control pin is set (TR).pin is high and the TR control pin is set (TR).

Page 41: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

TMod contd….TMod contd….

C/T :C/T : Timer or counter selected cleared for timer Timer or counter selected cleared for timer operation (input from internal system clock). Set operation (input from internal system clock). Set for counter operation (input from Tx input pin).for counter operation (input from Tx input pin).

M1,M0 : Used for mode selection.Because the Timers of Used for mode selection.Because the Timers of 8051 can be set in 4-different modes.8051 can be set in 4-different modes.

M1 M0 Mode OperationM1 M0 Mode Operation

0 0 0 0 00 1 13-bit timer 3-bit timer mode 8-bit THx + 5-bit TLx mode 8-bit THx + 5-bit TLx (x= 0 or 1)(x= 0 or 1)

00 1 1 1 1 16-bit timer16-bit timer mode 8-bit THx + 8-bit TLx mode 8-bit THx + 8-bit TLx 1 01 0 22 8-bit auto reload8-bit auto reload 8-bit auto reload 8-bit auto reload

timer/counter; timer/counter; THx holds a value which is to be reloaded THx holds a value which is to be reloaded

intointo TLx each time it overflows.TLx each time it overflows.

11 1 1 33 Split timer mode Split timer mode

Page 42: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

TMod contd…TMod contd…

Page 43: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Let us understand the working of Timer Let us understand the working of Timer Mode 1Mode 1

For this , let us consider timer 0 as an example.For this , let us consider timer 0 as an example.

16-16-bitbit timer (TH0 and TL0) timer (TH0 and TL0)

TH0-TL0 is incremented continuously when TR0 TH0-TL0 is incremented continuously when TR0 is set to 1. And the 8051 stops to increment TH0-is set to 1. And the 8051 stops to increment TH0-TL0 when TR0 is cleared.TL0 when TR0 is cleared.

The timer works with the internal system clock. The timer works with the internal system clock. In other words, the timer counts up each In other words, the timer counts up each machine cycle.machine cycle.

When the timer (TH0-TL0) reaches its maximum When the timer (TH0-TL0) reaches its maximum of FFFFH, it rolls over to 0000, and TF0 is raised.of FFFFH, it rolls over to 0000, and TF0 is raised.

Programmer should check TF0 and stop the timer Programmer should check TF0 and stop the timer 0. 0.

Page 44: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Steps of Mode 1Steps of Mode 1 1.1. Choose mode 1 timer 0Choose mode 1 timer 0

MOV TMOD,#01HMOV TMOD,#01H

2.2. Set the original value to TH0 and Set the original value to TH0 and TL0.TL0.

MOV TH0,#FFHMOV TH0,#FFH MOV TL0,#FCHMOV TL0,#FCH

3.3. You better to clear the TF: TF0=0.You better to clear the TF: TF0=0. CLR TF0CLR TF0

4.4. Start the timer.Start the timer. SETB TR0SETB TR0

Page 45: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Mode 1 Mode 1 contd…contd…

5.5. The 8051 starts to count up by The 8051 starts to count up by incrementing the TH0-TL0incrementing the TH0-TL0.. TH0-TL0= FFFCH,FFFDH,FFFEH,FFFFH,0000HTH0-TL0= FFFCH,FFFDH,FFFEH,FFFFH,0000H

FFFC FFFD FFFE FFFF 0000

TF = 0 TF = 0 TF = 0 TF = 0 TF = 1

TH0 TL0Start timerStop timer

Monitor TF until TF=1

TR0=1 TR0=0

TF

Page 46: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Mode 1 Mode 1 contd…contd…

6.6. When TH0-TL0 rolls over from FFFFH toWhen TH0-TL0 rolls over from FFFFH to 0000, the 8051 set TF0=1. 0000, the 8051 set TF0=1.

TH0-TL0= FFFE H, FFFF H, 0000 H (Now TH0-TL0= FFFE H, FFFF H, 0000 H (Now TF0=1)TF0=1)

7.7. Keep monitoring the timer flag (TF) to see Keep monitoring the timer flag (TF) to see if it is raised.if it is raised.

AGAIN: JNB TF0, AGAINAGAIN: JNB TF0, AGAIN

8.8. Clear TR0 to stop the process.Clear TR0 to stop the process.

CLR TR0CLR TR0

9.9. Clear the TF flag for the next round.Clear the TF flag for the next round.

CLR TF0CLR TF0

Page 47: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

TCON RegisterTCON Register

Timer control register TMOD is a 8-bit register which is bit addressable and in which Upper nibble is for timer/counter, lower nibble is for interrupts

Page 48: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Tcon Tcon contd…contd…

TR (Timer run control bit) TR0 for Timer/counter 0; TR1 for Timer/counter 1. TR is set by programmer to turn timer/counter on/off.

TR=0 : off (stop) TR=1 : on (start)

TF (timer flag, control flag) TF0 for timer/counter 0; TF1 for timer/counter 1. TF is like a carry. Originally, TF=0. When TH-TL

roll over to 0000 from FFFFH, the TF is set to 1. TF=0 : not reach TF=1: reach If we enable interrupt, TF=1 will trigger ISR.

Page 49: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Equivalent Instructions for the Equivalent Instructions for the Timer Control RegisterTimer Control Register

For timer 0For timer 0SETB TR0SETB TR0 == SETB TCON.4SETB TCON.4CLR TR0CLR TR0 == CLR TCON.4CLR TCON.4

SETB TF0SETB TF0 == SETB TCON.5SETB TCON.5CLR TF0CLR TF0 == CLR TCON.5CLR TCON.5

For timer 1For timer 1SETB TR1SETB TR1 == SETB TCON.6SETB TCON.6CLR TR1CLR TR1 == CLR TCON.6CLR TCON.6

SETB TF1SETB TF1 == SETB TCON.7SETB TCON.7CLR TF1CLR TF1 == CLR TCON.7CLR TCON.7

TF1 IT0IE0IT1IE1TR0TF0TR1

TCON: Timer/Counter Control Register

Page 50: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Simple applications using Simple applications using ports &Timersports &Timers

Using a port ,by a simple program you can Using a port ,by a simple program you can generate a Square wave of any duty cycle.generate a Square wave of any duty cycle.

HEREHERE : : SETB P1.0 (Make bit of Port 0 High)SETB P1.0 (Make bit of Port 0 High)

LCALL DELAYLCALL DELAY

CLR P1.0CLR P1.0

LCALL DELAYLCALL DELAY

SJMP HERE : Keep doing itSJMP HERE : Keep doing it

Here same delay is used for both Here same delay is used for both

High & lowHigh & low

Page 51: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Square-wave of 66%duty Square-wave of 66%duty cycle.cycle.

HEREHERE : SETB P1.0 ( Make bit of Port 0 High): SETB P1.0 ( Make bit of Port 0 High) LCALL DELAYLCALL DELAY LCALL DELAYLCALL DELAY CLR P1.0CLR P1.0 LCALL DELAYLCALL DELAY SJMP HERE : Keep doing itSJMP HERE : Keep doing it

Page 52: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Square-wave generation Square-wave generation using Timerusing Timer

DELAY: SETB TR0 ;start the timer 0AGAIN: JNB TF0,AGAIN CLR TR0 ;stop timer 0 CLR TF0 ;clear timer 0 flag RET

Square wave of 50% duty on P1.5 Timer 0 is used ; each loop is a half clock MOV TMOD,#01 ;Timer 0,mode 1(16-bit)HERE: MOV TL0,#0F2H ;Timer value = FFF2H MOV TH0,#0FFH CPL P1.5 ACALL DELAY SJMP HERE

Page 53: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

8051- SERIAL 8051- SERIAL COMMUNICATIONCOMMUNICATION

Page 54: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Basics of serial Basics of serial communicationcommunication

Page 55: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Types of Serial Types of Serial communicationscommunications

Page 56: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

RxD and TxD pins in the RxD and TxD pins in the 80518051

The 8051 has two pins for transferring The 8051 has two pins for transferring and receiving data by serial and receiving data by serial communication. These two pins are part communication. These two pins are part of the Port3(P3.0 &P3.1)of the Port3(P3.0 &P3.1)

These pins are TTL compatible and hence These pins are TTL compatible and hence they require a line driver to make them they require a line driver to make them RS232 compatible RS232 compatible

Max232 chip is one such line driver in Max232 chip is one such line driver in use. use.

Serial communication is controlled by an Serial communication is controlled by an 8-bit register called SCON register,it is a 8-bit register called SCON register,it is a bit addressable register.bit addressable register.

Page 57: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Interfacing to PCInterfacing to PC

Page 58: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

SCON (Serial control) SCON (Serial control) registerregister

Page 59: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

SM0 , SM1SM0 , SM1 These two bits of SCON register determine These two bits of SCON register determine

the framing of data by specifying the number the framing of data by specifying the number of bits per character and start bit and stop of bits per character and start bit and stop bits. There are 4 serial modes. bits. There are 4 serial modes.

SM0 SM1 0 0 Serial Mode 0 0 1 Serial Mode 1, 8 bit data, 1 stop bit, 1 start bit 1 0 Serial Mode 2 1 1 Serial Mode 3

Page 60: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

RENREN, , TI TI,, RI RI

REN (Receive Enable) also referred REN (Receive Enable) also referred as as SCON.4SCON.4. When it is high,it allows . When it is high,it allows the 8051 to receive data on the RxD the 8051 to receive data on the RxD pin. So to receive and transfer data pin. So to receive and transfer data REN must be set to 1.When REN must be set to 1.When REN=0,the receiver is disabled. This REN=0,the receiver is disabled. This is achieved as below is achieved as below

SETB SCON.4SETB SCON.4

& CLR SCON.4& CLR SCON.4

Page 61: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Contd…Contd…

TI (Transmit interrupt) is the D1 bit of SCON TI (Transmit interrupt) is the D1 bit of SCON register. When 8051 finishes the transfer of 8-register. When 8051 finishes the transfer of 8-bit character, it raises the TI flag to indicate bit character, it raises the TI flag to indicate that it is ready to transfer another byte. The TI that it is ready to transfer another byte. The TI bit is raised at the beginning of the stop bit. bit is raised at the beginning of the stop bit.

RI (Receive interrupt) is the D0 bit of the RI (Receive interrupt) is the D0 bit of the SCON register. When the 8051 receives data SCON register. When the 8051 receives data serially ,via RxD, it gets rid of the start and serially ,via RxD, it gets rid of the start and stop bits and places the byte in the SBUF stop bits and places the byte in the SBUF register.Then it raises the RI flag bit to indicate register.Then it raises the RI flag bit to indicate that a byte has been received and should be that a byte has been received and should be picked up before it is lost.RI is raised halfway picked up before it is lost.RI is raised halfway through the stop bit. through the stop bit.

Page 62: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

8051 Interrupts8051 Interrupts

An An interruptinterrupt is an external or internal event is an external or internal event that that disturbs the disturbs the microcontroller to inform microcontroller to inform it that a device needs its service.it that a device needs its service.

A A MM icrocontroller can serve icrocontroller can serve various various devices.devices.

ThThereere are two ways to do that: are two ways to do that: interrupts interrupts & & polling.polling.

The program which is associated with the The program which is associated with the interrupt is called the interrupt is called the interrupt service routineinterrupt service routine (ISR) or (ISR) or interrupt handlerinterrupt handler..

Page 63: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Steps in executing an Steps in executing an interruptinterrupt

Upon receiving the interrupt signal the Upon receiving the interrupt signal the Microcontroller , fMicrocontroller , finish inish current current instruction instruction and sand saaves the PC on stack.ves the PC on stack.

JJ umps to a fixed location in memory umps to a fixed location in memory depending on type of interruptdepending on type of interrupt

SStarts to execute the interrupt service tarts to execute the interrupt service routine until RETI (return from interrupt)routine until RETI (return from interrupt)

Upon executing the RETI the microcontroller Upon executing the RETI the microcontroller returns to the place where it was returns to the place where it was interrupted. Get interrupted. Get poppop PC from stack PC from stack

Page 64: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Interrupt SourcesInterrupt Sources Original 8051 has 6 sources of interruptsOriginal 8051 has 6 sources of interrupts

Reset Reset Timer 0 overflowTimer 0 overflow Timer 1 overflowTimer 1 overflow External Interrupt 0External Interrupt 0 External Interrupt 1External Interrupt 1 Serial Port events (buffer full, buffer empty, Serial Port events (buffer full, buffer empty,

etc)etc)

Enhanced version has 22 sourcesEnhanced version has 22 sources More timers, programmable counter array, More timers, programmable counter array,

ADC, more external interrupts, another serial ADC, more external interrupts, another serial port (UART)port (UART)

Page 65: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Each interrupt has a specific place in Each interrupt has a specific place in

code memory where program code memory where program execution (interrupt service routine) execution (interrupt service routine) begins.begins.

External Interrupt 0: External Interrupt 0: 0003h0003h Timer 0 overflow: Timer 0 overflow: 000Bh000Bh External Interrupt 1:External Interrupt 1: 0013h0013h Timer 1 overflow: Timer 1 overflow: 001Bh001Bh Serial : 0023hSerial : 0023h Timer 2 overflowTimer 2 overflow(8052+)(8052+) 002bh 002bh

Interrupt Vectors

Page 66: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Interrupt Enable Interrupt Enable RegisterRegister

Upon reset all Interrupts are disabled & do not respond to the Microcontroller

These interrupts must be enabled by software in order for the Microcontroller to respond to them.

This is done by an 8-bit register called Interrupt Enable Register (IE).

Page 67: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

EA : Global enable/disable. --- : Undefined. ET2 : Enable Timer 2 interrupt. ES : Enable Serial port

interrupt. ET1 : Enable Timer 1 interrupt. EX1 :Enable External 1 interrupt. ET0 : Enable Timer 0 interrupt. EX0 : Enable External 0

interrupt..

Page 68: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Enabling and disabling an interrupt

By bit operation

Recommended in the middle of programSETB EA ;Enable All

SETB ET0 ;Enable Timer0 ovrf SETB ET1 ;Enable Timer1 ovrfSETB EX0 ;Enable INT0SETB EX1 ;Enable INT1SETB ES ;Enable Serial port

By Mov instruction

Recommended in the first of programMOV IE, #10010110B

SETB IE.7SETB IE.1SETB IE.3SETB IE.0SETB IE.2 SETB IE.4

Page 69: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

What if two interrupt sources interrupt at What if two interrupt sources interrupt at the same time?the same time?

The interrupt with the highest PRIORITY The interrupt with the highest PRIORITY gets serviced first.gets serviced first.

All interrupts have a power on default All interrupts have a power on default priority order. priority order. 1.1. External interrupt 0 (INT0)External interrupt 0 (INT0)

2.2. Timer interrupt0 (TF0)Timer interrupt0 (TF0)

3.3. External interrupt 1 (INT1)External interrupt 1 (INT1)

4.4. Timer interrupt1 (TF1)Timer interrupt1 (TF1)

5.5. Serial communication (RI+TI)Serial communication (RI+TI) Priority can also be set to “high” or “low” by Priority can also be set to “high” or “low” by

IP reg.IP reg.

Interrupt Interrupt PrioritiesPriorities

Page 70: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Interrupt Priorities (IP) RegisterInterrupt Priorities (IP) Register

IP.7: reservedIP.7: reserved

IP.6: reservedIP.6: reserved

IP.5: Timer 2 interrupt priority bit (8052 only)IP.5: Timer 2 interrupt priority bit (8052 only)

IP.4: Serial port interrupt priority bitIP.4: Serial port interrupt priority bit

IP.3: Timer 1 interrupt priority bitIP.3: Timer 1 interrupt priority bit

IP.2: External interrupt 1 priority bitIP.2: External interrupt 1 priority bit

IP.1: Timer 0 interrupt priority bitIP.1: Timer 0 interrupt priority bit

IP.0: External interrupt 0 priority bitIP.0: External interrupt 0 priority bit

--- PX0PT0PX1PT1PSPT2---

Page 71: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Interrupt Priorities ExampleInterrupt Priorities Example

MOV IP , #00000100BMOV IP , #00000100B oror SETB IP.2SETB IP.2 gives gives priority orderpriority order

1.1. Int1Int1

2.2. Int0Int0

3.3. Timer0Timer0

4.4. Timer1Timer1

5.5. SerialSerial

MOV IP , #00001100BMOV IP , #00001100B gives priority ordergives priority order1.1. Int1Int1

2.2. Timer1Timer1

3.3. Int0Int0

4.4. Timer0Timer0

5.5. SerialSerial

--- PX0PT0PX1PT1PSPT2---

Page 72: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Interrupt inside an interruptInterrupt inside an interrupt

--- PX0PT0PX1PT1PSPT2---

A high-priority interrupt can interrupt a A high-priority interrupt can interrupt a low-priority interrupylow-priority interrupy

All interrupt are latched internallyAll interrupt are latched internally

Low-priority interrupt wait until 8051 has Low-priority interrupt wait until 8051 has finished servicing the high-priority finished servicing the high-priority interruptinterrupt

Page 73: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Applications of Applications of MicrocontrollersMicrocontrollers

Page 74: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Simple Interfacing Simple Interfacing ExamplesExamples

Page 75: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Seven segment Seven segment InterfacingInterfacing

Page 76: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Traffic light controllerTraffic light controller

Page 77: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 78: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Closed loop control system-Closed loop control system-Temperature control Temperature control

exampleexample

Page 79: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 80: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 81: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 82: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 83: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 84: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 85: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 86: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)
Page 87: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Recent Wonders

Page 88: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Recent Wonders Recent Wonders contd ........contd ........

Page 89: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Recent Wonders Recent Wonders contd ........contd ........

Page 90: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Books that have helped me to Books that have helped me to understand the Microcontrollers understand the Microcontrollers

& embedded systems & embedded systems

1)1) Barr, Michael, Programming embedded Barr, Michael, Programming embedded sytems in C and C++ - OReilly Publ.sytems in C and C++ - OReilly Publ.

2)2) Raj Kamal, Embedded systems, Raj Kamal, Embedded systems, TMGTMG

3)3) Mazidi and Mazidi, The 8051 Mazidi and Mazidi, The 8051 microcontroller and embedded sytems - microcontroller and embedded sytems - Pearson education.Pearson education.

4)4) Peatman,J.B. Design with Peatman,J.B. Design with microcontrollers and microcomputers, microcontrollers and microcomputers, McGraw HilMcGraw Hil

Page 91: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

5) 5) Sewart. J.W. The 8051 Sewart. J.W. The 8051 Microcontroller Hardware, Software Microcontroller Hardware, Software and Interfacing – Prentice Hall and Interfacing – Prentice Hall

6) Ayala Kenneth, The 8051 Ayala Kenneth, The 8051 Microntroller – Architecture, Microntroller – Architecture, Programming and Applications – Programming and Applications – Delmar Publ.Delmar Publ.

7)7) Ajay Deshmukh, Microcontrollers – Ajay Deshmukh, Microcontrollers – TATA McGraw HillTATA McGraw Hill

8)8) Rajkamal, Microcontrollers - Rajkamal, Microcontrollers - Architecture, Programming – Pearson Architecture, Programming – Pearson Publ.Publ.

9) Myke Predko, Programming the 8051 Myke Predko, Programming the 8051 Microcontroller – McGraw HillMicrocontroller – McGraw Hill

10)10) Michael J. Pont, Embedded C - Michael J. Pont, Embedded C - Addison Wesely Publ.Addison Wesely Publ.

Page 92: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Useful websitesUseful websites

Page 93: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

Useful websites Useful websites contd…contd…

1.1. http://www.eg3.comhttp://www.eg3.com

2.2. http://www.ARM.MCU.comhttp://www.ARM.MCU.com

3.3. http://www.mcjournal.comhttp://www.mcjournal.com

4.4. http://www.iar.comhttp://www.iar.com

5.5. http://http://http://www.embedded.comhttp://www.embedded.com

6.6. http://http://www.powersoftsystems.comwww.powersoftsystems.com

Page 94: MICROCONTROLLER-8051 Features & Applications Dr. Y.Narasimha Murthy Ph.D., Sri Saibaba National College (Autonomous)ANANTAPUR-515001(A.P)

EpilogueEpilogue

The woods are lovely, dark and deep, But I have promises to keep,And miles to go before I sleep,And miles to go before I sleep. ---- Robert Frost

GOOD LUCK!