SlideShare ist ein Scribd-Unternehmen logo
1 von 41
INTRODUCTION TO
MICROCONTROLLER
RAVI DADSENA
Microcontroller 8051
• A microcontroller is a highly integrated single chip, which consists of on
chip CPU (Central Processing Unit), RAM (Random Access Memory),
EPROM/PROM/ROM (Erasable Programmable Read Only Memory), I/O
(input/output) – serial and parallel, timers, interrupt controller,analog to
digital converter,digital to analog converter,serial interfacing
ports,oscillatory circuits.
• A microcontroller internally consist of all features required for computing
system and functions as a computer without adding any external digital
parts in it.
• Most of the pins in the uc chip can be made programmable by the user.
• It is capable of handling boolean functions and it has many bit handling
instructions that can be easily understood by programmer.
• Easy to design,small size,low cost and high speed performance.
• Microcontroller are used in automatically controlled products and
devices,such as automobile engine control systems,implantable medical
devices,remote controls,office machines,appliances,toys and other
embeded systems.
ADDRESSING MODES OF 8051
The way in which the data operands are accessed by different instructions is
known as the addressing modes. There are various methods of denoting the data
operands in the instruction. The 8051 microcontroller supports mainly 5
addressing modes. They are
1.Immediate addressing mode
2.Direct Addressing mode
3.Register addressing mode
4. Register Indirect addressing mode
5.Indexed addressing mode
• Immediate addressing mode : The addressing mode in which the data
operand is a constant and it is a part of the instruction itself is known as
Immediate addressing mode. Normally the data must be preceded by a # sign.
This addressing mode can be used to transfer the data into any of the registers
including DPTR.
Eg: MOV A , # 27 H : The data (constant) 27 is moved to the accumulator register
ADD R1 ,#45 H : Add the constant 45 to the contents of the accumulator
• Direct addressing mode: The addressing mode in which the data operand is in
the RAM location (00 -7FH) and the address of the data operand is given in
the instruction is known as Direct addressing mode. The direct addressing
mode uses the lower 128 bytes of Internal RAM and the SFRs. Eg-(a)MOV R1,
42H Move the contents of RAM location 42 into R1 register, (b) MOV 49H,A :
Move the contents of the accumulator into the RAM location 49.
• Register addressing mode :The addressing mode in which the data operand to
be manipulated lies in one of the registers is known as register addressing
mode. Eg-(a) MOV A,R0 : Move the contents of the register R0 to the
accumulator, (b)ADD A,R6 :Add the contents of R6 register to the accumulator.
• Register Indirect addressing mode :The addressing mode in which a register is
used as a pointer to the data memory block is known as Register indirect
addressing mode. Eg-(a) MOV @ R1 , B : Move the contents of B into RAM
location whose address is held by R1.
One of the advantages of register indirect addressing mode is that it makes
accessing the data more dynamic than static as in the case of direct
addressing mode.
• Indexed addressing mode : This addressing mode is used in accessing the
data elements of lookup table entries located in program ROM space of 8051.
Eg-(a) MOVC A,@ A+DPTR (The 16-bit register DPTR and register A are used to
form the address of the data element stored in on-chip ROM. Here C denotes
code .In this instruction the contents of A are added to the 16-bit DPTR
register to form the 16-bit address of the data operand)
BLOCK DIAGRAM OF A MICROCONTROLLER
Operation of microcontroller
• Power supply is turned off and then load the program in the microcontroller
chip and then wait what is about to come.
• Now switch on the power supply and evrything starts with a high speed,the
control logic unit keeps everything under control.The control logic disables all
other circuits except quartz crystal to operate.
• As the power supply voltage reached to its maximum value then oscillator
frequency becomes stable.SFRs are being filled with bits reflecting the state of
all circuits within the uc.Now all pins are configured as inputs and then overall
electronics starts operation in rhythm with pulse sequence and on time is
measured in nano and micro seconds.
• The value of program counter is initially set to zero and instruction from the
address is send to the instruction decoder which recognizes it and program
execution takes place.
• After the execution of program the value of program counter is incremented by
1 and whole process is repeated again and again ,several million times per
second.
Salient features of 8051 uc
• 4 KB on chip program memory (ROM or EPROM)).
• 128 bytes on chip data memory(RAM).
• 8-bit data bus
• 16-bit address bus
• 32 general purpose registers each of 8 bits
• Two -16 bit timers T0 and T1
• Five Interrupts (3 internal and 2 external).
• Four Parallel ports each of 8-bits (PORT0, PORT1,PORT2,PORT3) with a
total of 32 I/O lines.
• One 16-bit program counter and One 16-bit DPTR ( data pointer)
• One 8-bit stack pointer.
• One Microsecond instruction cycle with 12 MHz Crystal.
• One full duplex serial communication port.
Criteria for selecting uc
1. Meeting the computing needs of the task efficiently and cost
effectively
• speed, the amount of ROM and RAM, the number of I/O ports
and timers, size, packaging, power consumption
• easy to upgrade,cost per unit,power consumption,packaging,no
of I/O pins and timer on chip.
2. Availability of software development tools
• assemblers, debuggers, C compilers, emulator, simulator,
technical support
3. Wide availability and reliable sources of the microcontrollers.
A single chip
RAM ROM
I/O
Port
Timer
Serial
COM
Port
Microcontroller
CPU
TYPES OF MICROCONTROLLERS
Microcontrollers can be classified on the basis of internal bus width,
architecture, memory and instruction set as 4-bit,8-bit,16-bit and 32-bit
micrcontrollers.
• 4-bit Microcontrollers: These 4-bit microcontrollers are small size,
minimum pin count and low cost controllers which are widely used for
low end applications like LED & LCD display drivers ,portable battery
chargers etc.. Their power consumption is also low. The popular 4-bit
controllers are Renasa M34501 which is a 20 pin DIP chip with 4kB of
ROM,256 Bytes of RAM,2-Counters and 14 I/O Pins. Similarly ATAM862
series from ATMEL.
• 8-bit Microcontrollers : These are the most popular and widely used
microcontrollers .About 55% of all CPU sold in the world are 8-bit
microcontrollers only.The 8-bit microcontroller has 8-bitinternal bus and
the ALU performs all the arithmetic and logical operations on a byte
instruction. The well known 8-bit microcontroller is 8051 which was
designed by Intel in the year 1980 for the use in embedded systems. Other
8-bit microcontrollers are Intel 8031/8052 and Motorola MC68HC11 and
AVR Microcontrollers, Microchip’s PIC Microcontrollers 12C5XX ,16C5X
and 16C505 etc
• 16-bit Microcontrollers : When the microcontroller performs 16-bit
arithmetic and logical operations at an instruction, the microcontroller is
said to be a 16-bit microcontroller. The internal bus width of 16-bit
microcontroller is of 16-bit. These microcontrollers are having increased
memory size and speed of operation when compared to 8-bit
microcontrollers.These are most suitable for programming in Highlevel
languages like C or C++ .They find applications in disk
drivers,modems,printers,scanners and servomotor control. Examples of
16-bit microcontrollers are Intel 8096 family and Motorola MC68HC12 and
MC68332 families, The performance and computing capability of 16 bit
microcontrollers are enhanced with greater precision as compared to the
8-bit microcontrollers.
• 32-Bit Microcontrollers :These microcontrollers used in highend
applications like Automative control, Communication
networks,Robotics,Cell phones ,GPRS & PDAs etc..For EX:PIC32,ARM
7,ARM9 ,SHARP LH79520 ,ATMEL 32 (AVR) ,Texas Instrument’s –.
TMS320F2802x/2803x etc..are some of the popular 32-bit
microcontrollers.
Advantages of uc
• Microcontroller act as a microcomputer without any digital parts.
• Easily interface additional RAM,ROM,I/O ports.
• Low time required for performing operations.
• Most of the pins are programmed by user for performing different
functions.
• Usage is simple,easy for troubleshoot and system maintaining.
Disadvantages of uc
• Microcontroller got more complex arhitectur then that of up.
• Mostly used in uequipment.
• Only perform limited no of executions simultaneusly.
• Cannot interface high power device directly.
Applications of uc
• Home appliances - Intercom, telephones, security systems, garage door
openers, answering machines, fax machines, home computers, TVs, cable
TV tuner, VCR, camcorder, remote controls, video games, cellular phones,
musical instruments, sewing machines, lighting control, paging, camera,
pinball machines, toys, exercise equipment etc.
• Office Equipments - Telephones, computers, security systems, fax
machines, microwave, copier, laser printer, color printer, paging etc.
• Automobiles - Trip computer, engine control, air bag, ABS,
instrumentation, security system, transmission control, entertainment,
climate control, cellular phone, keyless entry,flight control
systems,printers etc.
• Industrial Applications – Industrial controllers,DAS etc.
• Used in biomedical equipments, communication systems, robotics,
peripheral control in pc.
• Military applications.
Need of uc over up
• Microprocessor is an IC which has only the CPU inside them i.e. only the
processing powers such as Intel’s Pentium 1,2,3,4, core 2 duo, i3, i5 etc.
These microprocessors don’t have RAM, ROM, and other peripheral on
the chip. A system designer has to add them externally to make them
functional. Application of microprocessor includes Desktop PC’s, Laptops,
notepads etc.
• But this is not the case with Microcontrollers. Microcontroller has a CPU,
in addition with a fixed amount of RAM, ROM and other peripherals all
embedded on a single chip. At times it is also termed as a mini computer
or a computer on a single chip. Today different manufacturers produce
microcontrollers with a wide range of features available in different
versions. Some manufacturers are ATMEL, Microchip, TI, Freescale, Philips,
Motorola etc.
• Microprocessor find applications where tasks are unspecific like
developing software, games, websites, photo editing, creating
documents etc. In such cases the relationship between input and
output is not defined. They need high amount of resources like RAM,
ROM, I/O ports etc. The clock speed of the microprocessor is quite
high as compared to the microcontroller. Whereas the ucontrollers
operate from a few mhz to 30 to 50 mhz, today’s uprocessor operate
above 1ghz as they perform complex tasks.
• Microcontrollers are designed to perform specific tasks. Specific means
applications where the relationship of input and output is defined.
Depending on the input, some processing needs to be done and output is
delivered. For example, keyboards, mouse, washing machine, digicam,
pendrive, remote, microwave, cars, bikes, telephone, mobiles, watches,
etc. Since the applications are very specific, they need small resources like
RAM, ROM, I/O ports etc and hence can be embedded on a single chip.
This in turn reduces the size and the cost.
• So to make a complete ucomputer system only up is not sufficent.It is
necessary to add other peripherals such as ROM,RAM,I/O
PORTS,DECODERS,DRIVERS to make a complete ucomputer system.Also some
special purpose devices such as interrupt controller programmable
timers,programmable input device may be added to improve the capacity
performance and flexibility of ucomputer system.Basically we have to design a
ucomputer based computer system to design a system with greater
flexibility.So that to configure a large or small system by adding peripherals.
• While microcontroller incorporates all the features that found in up.It has also
added features to make a complete ucomputer system on its own.The uc has
built in ROM,RAM,I/O PORTS,TIMER,COUNTER,INTERRUPT CONTROL,CLOCK
CIRCUIT.
The 8051 family has the largest number of diversified
(multiple source) suppliers
• Intel (original)
• Atmel
• Philips/Signetics
• AMD
• Infineon (formerly Siemens)
• Matra
• Dallas Semiconductor/Maxim
Difference uc & up
up
a) Up contains ALU,general
purpose register,stack
pointer,program counter,clock
timing ckt and interupt ckt.
b) Many inst to move data
between memory and cpu
c) One or 2 bit handling inst.
d) More accsess time for memory
and input devices
e) System requires more hardware.
f) System is more flexible in design
point of view.
g) Single memory map for data &
code.
h) Less no of pins are
multifunctioned.
i) System is bulky.
uc
a) Uc contains the circuitry of up
and in addition it has built in
ROM,RAM,input device,timers
and counters.
b) 1 or 2 inst to move data
batween memory and cpu.
c) Many bit handling inst.
d) Less access time.
e) Less hardware.
f) Less flexible.
g) Separate memory map for data
and code.
h) More no of pins
i) Simple
a) Boolean operation is not
possible directly.
b) It takes many instructions to
read and write data from
external memory.
c) 16 bit stack pointer.
d) Down counter are used in up so
that after each clock pulse the
count value decreases.
a) Boolean operation is directly
possible.
b) Onlt takes few inst.
c) 8bit stack pointer.
d) Up counters are used so that
after each clock pulse count
value increases.
Block diagragm of uc 8051
Microcontroller consist of 4 basic functional blocks:
a) Main CPU.
b) Data memory-RAM & memory for monitoring the program which is to be
stored in ROM/EPROM or flash memory.
c) Timers/counters.
d) I/O ports to interface with external peripheral components.
The uc has on chip(built in) peripheral devices.These on chip peripherals make to
possible to have a single chip ucomputer system.Advantages of built in
peripherals are:
a) Built in peripherals have similar access time hence speed is more.
b) Hardware reduces due to single chip ucomputer system.
c) Less hardware reduces PCB size and increase reliability of system.
The CPU of 8051 consists of 8 bit ALU with associated registers like A,B,PWS,SP, 16
bit program counter & data pointer registers it has a set of special functn
registers.Unique feature of this architecture is that ALU can manipulate 1 bit as 8
bit data types.
a) This 8bit uc which was developed by intel in 1981 has 128 bytes of RAM for
storing data called data memory & 4k bytes of on-chip ROM for program
storation called code memory.
b) One serial port for performing serial or parallel communication and 2 timers
which can be used as timer as well as counter.
a) 4 bidirectional I/O ports are used each 8 bit wide,all these are in a single
chip.
b) This 8051 is an 8bit processor i.e. CPU can work on only 8 bits of data at
a time,if data is larger than 8 bits then it is to be broken into 8 pieces to
be processed by CPU.Whereas 8051 can have max of 64k bytes of on-
chip ROM,many manufacturers have put only 4k bytes on the chip.
Pin Diagram of 8051
• The 8051 is a 40 pin configuration.It is imp that many pins of 8051 are
used for more than one function.
• It has 32 I/O pins configured as 4 eight bit parellel ports(P0,P1,P2,P3).All
are bidirectional i.e configured as both input and output.
• All port pins are multiplexed except the port pin 1.Each port consists of a
latch,an output driver and an input buffer.
Pin Description of the 8051
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
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)
• 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)
• 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.
• /PSEN(pin 29):program store enable(It is a active low o/p control
signal used to activate the enable signal of the external ROM/EPROM)
– This is an output pin and is connected to the OE pin of the ROM.
• /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.
• ALE(pin 30):address latch enable
– It is an output pin and is active high.
– 8051 port 0 provides both address and data.
– The ALE pin is used for de-multiplexing the address and data by
connecting to the G pin of the 74LS373 latch.
• I/O port pins
– The four ports P0, P1, P2, and P3.
– Each port uses 8 pins.
– All I/O pins are bi-directional.
• Using a quartz crystal oscillator
• We can observe the frequency on the XTAL2 pin.
XTAL Connection to 8051 Power-On RESET Circuit
C2
30p
F
C1
30p
F
XTAL2
XTAL1
GND
Vc
c
30
pF
30
pF
8.2
K
10
uF
+
11.0592
MHz
EA/VP
PX1
X2
RST
31
19
18
9
Pins of I/O ports
• The 8051 has four I/O ports
– Port 0 (pins 32-39):P0(P0.0~P0.7)
– Port 1(pins 1-8) :P1(P1.0~P1.7)
– Port 2(pins 21-28):P2(P2.0~P2.7)
– Port 3(pins 10-17):P3(P3.0~P3.7)
– Each port has 8 pins.
• Named P0.X (X=0,1,...,7), P1.X, P2.X, P3.X
• Ex:P0.0 is the bit 0(LSB)of P0
• Ex:P0.7 is the bit 7(MSB)of P0
• These 8 bits form a byte.
• Each port can be used as input or output (bi-direction).
Port 0
(1). Port 0 is 8-bitbidirectional I/O port.
(2). Port 0 pins can be used as high-impedance inputs.
(3). Port 0 is also the multiplexed low-order address and data bus during
accesses to external program and data memory.
(4). We r using pins no. from 32 to 39.
(5). When used as an output the pin latches are programmed to 0.
(5). When used as an input the pin latches are programmed to 1.
Port 1
(1). Port 1 is an 8-bit bidirectional I/0 port.
(2). We r using pins no. from 1 to 9.
(3). Port 1 have no dual functions.
(4). When used as an output the pin latches are
programmed to 0.
(5). When used as an input the pin latches are
programmed to 1.
Port 2
(1). Port 2 is an 8-bit bidirectional I/O port.
(2). Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that use
16-bit addresses (MOVX @DPTR).
(3). When used as an output the pin latches are programmed to 0.
(4). When used as an input the pin latches are programmed to 1.
(5). We r using pins no. from 21 to 28.
Port 3
(1). Port 3 is an 8-bit bi-directional I/0 port.
(2). We r using pins no. from 10 to 17.
• RXD (P3.0): Serial input port,
• TXD (P3.1): Serial output port,
• INT0 (P3.2): External interrupt,
• INT1 (P3.3): External interrupt,
• T0 T0 (P3.4): Timer 0 external input,
• T1 (P3.5): Timer 1 external input,
• WR (P3.6): External data memory write strobe,
• RD (P3.7): External data memory read strobe,
8051 family members
Feature 8051 8052 8031
ROM(on chip program space in bytes) 4k 8k 0k
RAM(bytes) 128 256 128
Timers 2 3 2
I/O pins 32 32 32
Serial port 1 1 1
Interrupt sources 6 8 6
Comparasion AT89C51,8751 & DS5000
Feature AT89C51 8751 DS5000
ROM(on chip) 4 KB (flash) 4 KB (UV-ROM) 8 KB (NV-RAM)
RAM 128 BYTES 128 BYTES 128 BYTES
Timers 2 2 2
I/O pins 32 32 32
Serial port 1 1 1
Inrerrupt sources 6 6 8
Memory structure of 8051
Program Memory(on-chip ROM)
Data Memory(RAM)
RAM Allocation in 8051
The 8051 has 128 byte internal RAM used for storing data.These internal RAM
memory is organized into 3 categories:
a) Register bank
b) Bit addressable
c) General purpose
a) Register bank
• The 1st 32 byte from address 00H to 1FH of internal RAM constitute 32
working registers.They are organized int 4 banks of 8 registers each.These
4 banks are no from 0-3 and named as R0 to R7.
• Each register can be addressed by its name or RAM address.
• At a time only one register bank is in use.Bits RS0 to RS7 in PSW determine
which bank is currently in use.And on reset bank 0 is selected therfore it is
a default register bank.When register banks are not selected then it can be
used as general purpose RAM.
RS1(PSW.4) RSO(PSW.3) BANK SELECTION
0 0 Bank 0
0 1 Bank 1
1 0 Bank 2
1 1 Bank 3
a) Bit/byte addressable - Its location is from 20H to 2FH i.e. 16 bytes
provides 128 bits,16*8=128,i.e. from 0 to 127 in decimal or 00-7FH.
b) General purpose RAM-The RAM area above bit addressable area from
30H-7FH calles general purpose RAM.It is addressable as byte.
7FH
30H
2FH
20H
1FH
17H
10H
0FH
07H
08H
18H
00H
Register Bank 0
(Stack) Register Bank 1
Register Bank 2
Register Bank 3
Bit-Addressable RAM
Scratch pad RAM
Crystal Oscillator Circuit
OTP 8051
OTP means one time programmable.Thus when the application is loaded into the
device,it cannot be changed anymore.
Advantages of OTP :
• Lowest prices than their flash counterparts.
• Not possible to re-program thus a device can’t be hacked by malicious software
updates.
EPROM & UV-EPROM :
• EPROM was invented to allow malikg chaqnges in the contents pf PROM after it is
burned .In EPROM, one can program the memory chip and erase it thousands of
time.This is especially needed during the design of any microprocessro based
project.
• A widely used EPROM is called UV-EPROM where UV stands for ultraviolet.The
only problem with UV-EPROM is that it takes upto 20 min for erasing the
contents.
• All UV-EPROM chips have a window through which the programmer can shine UV
radiation to erase its contents for the reason,EPROM is also reffered to as UV
erasable EPROM or simply UV-EPROM.
• For programming into a UV-EPROM following steps are :
• Its contents must be erased.To erase a chip, remove it from its socket on the
system board and place it in EPROM erasure equipment to expose it to UV
radiation for 15-20 min.
• Program the chip.To program a UV-EPROM chip,place it in the ROM
burner(programmer).To burn code or data into EPROM,the ROM burner uses 12.5
volts or higher,depending on the EPROM type.This voltage is reffered to as Vpp in
the UV-EPROM data sheet.
• Now place the chip back into its socket on the system board.
8751 uc
• It has 4k bytes of on-chip UV-EPROM.Using this chip for the development access
to a PROM burner,as well as a UV-EPROM insid the 8751 chip because we can
program it again.Because the on-chip ROM for 8751 is UV-EPROM, it takes
around 20 min to erase the 8751 before it can be programed again
• 8751 uses 128 bytes on-chip RAM.
• 1 serial & 4 parallel ports.
• 2 timer/counter.
• 6 interrupts.
• 32 bit input/output pins.
8051 Stack
• The register used to access the stack is called SP (stack pointer) register.
• The stack pointer in the 8051 is only 8 bits wide, which means that it can
take value 00 to FFH. When 8051 powered up, the SP register contains
value 07.
• The storing of a CPU register in the stack is called a PUSH
– SP is pointing to the last used location of the stack
– As we push data onto the stack, the SP is incremented by one
– This is different from many microprocessors.eg-MOV SP,#13H
• Loading the contents of the stack back into a CPU register is called a POP
– With every pop, the top byte of the stack is copied to the register
specified by the instruction and the stack pointer is decremented once
Address of special function registersS.No Symbol Name of SFR Address (Hex)
1 ACC* Accumulator 0E0
2 B* B-Register 0F0
3 PSW* Program Status word register 0DO
4 SP Stack Pointer Register 81
5
DPTR
DPL Data pointer low byte 82
DPH Data pointer high byte 83
6 P0* Port 0 80
P1* Port 1 90
8 P2* Port 2 0A
9 P3* Port 3 0B
10 IP* Interrupt Priority control 0B8
11 IE* Interrupt Enable control 0A8
12 TMOD Tmier mode register 89
13 TCON* Timer control register 88
14 TH0 Timer 0 Higher byte 8C
15 TL0 Timer 0 Lower byte 8A
16 TH1 Timer 1Higher byte 8D
17 TL1 Timer 1 lower byte 8B
18 SCON* Serial control register 98
19 SBUF Serial buffer register 99
20 PCON Power control register 87

Weitere ähnliche Inhalte

Was ist angesagt?

8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
8051 Assembly Language Programming
8051 Assembly Language Programming8051 Assembly Language Programming
8051 Assembly Language ProgrammingRavikumar Tiwari
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller NotesDr.YNM
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to MicrocontrollerNikhil Sharma
 
microprocessor-and-microcontroller
microprocessor-and-microcontrollermicroprocessor-and-microcontroller
microprocessor-and-microcontrollerjhcid
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controllerOm Bheda
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessorsvishi1993
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontrollerSiva Kumar
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller Nitesh Kumar
 
The 8051 microcontroler based embedded systems
The 8051 microcontroler based embedded systemsThe 8051 microcontroler based embedded systems
The 8051 microcontroler based embedded systemsmanishpatel_79
 

Was ist angesagt? (20)

8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
8051 Assembly Language Programming
8051 Assembly Language Programming8051 Assembly Language Programming
8051 Assembly Language Programming
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to Microcontroller
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
microprocessor-and-microcontroller
microprocessor-and-microcontrollermicroprocessor-and-microcontroller
microprocessor-and-microcontroller
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controller
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
MICROCONTROLLER - INTEL 8051
MICROCONTROLLER - INTEL 8051MICROCONTROLLER - INTEL 8051
MICROCONTROLLER - INTEL 8051
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessors
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
8051 memory
8051 memory8051 memory
8051 memory
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
8051 timer counter
8051 timer counter8051 timer counter
8051 timer counter
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller
 
Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051
 
The 8051 microcontroler based embedded systems
The 8051 microcontroler based embedded systemsThe 8051 microcontroler based embedded systems
The 8051 microcontroler based embedded systems
 

Ähnlich wie INTRODUCTION TO MICROCONTROLLER

Embeded system by Mitesh Kumar
Embeded system by Mitesh KumarEmbeded system by Mitesh Kumar
Embeded system by Mitesh KumarMitesh Kumar
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf818Farida
 
Unit 2 - Microprocessor & Microcontroller.pptx
Unit 2 -  Microprocessor & Microcontroller.pptxUnit 2 -  Microprocessor & Microcontroller.pptx
Unit 2 - Microprocessor & Microcontroller.pptxCharunnath S V
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
 
micro controllers 1.ppt
micro controllers 1.pptmicro controllers 1.ppt
micro controllers 1.pptsiminkhan
 
8051 microcontroller and embedded training (sahil gupta 9068557926)
8051 microcontroller and embedded training  (sahil gupta   9068557926)8051 microcontroller and embedded training  (sahil gupta   9068557926)
8051 microcontroller and embedded training (sahil gupta 9068557926)Sahil Gupta
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 MicrocontrollersSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 MicrocontrollersArti Parab Academics
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerAmandeep Alag
 
8051 microcontroller and it’s interface
8051 microcontroller and it’s interface8051 microcontroller and it’s interface
8051 microcontroller and it’s interfaceAbhishek Choksi
 
Embedded training report(mcs 51)
Embedded training report(mcs 51)Embedded training report(mcs 51)
Embedded training report(mcs 51)Gurwinder Singh
 
UNIT 2 8086 System Bus Structure.pptx
UNIT 2 8086 System Bus Structure.pptxUNIT 2 8086 System Bus Structure.pptx
UNIT 2 8086 System Bus Structure.pptxGowrishankar C
 
UNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxUNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxGowrishankar C
 
Solution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsSolution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsmanishpatel_79
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentseceprinter6
 

Ähnlich wie INTRODUCTION TO MICROCONTROLLER (20)

Embeded system by Mitesh Kumar
Embeded system by Mitesh KumarEmbeded system by Mitesh Kumar
Embeded system by Mitesh Kumar
 
microcontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdfmicrocontroller 8051 17.07.2023.pdf
microcontroller 8051 17.07.2023.pdf
 
Unit 2 - Microprocessor & Microcontroller.pptx
Unit 2 -  Microprocessor & Microcontroller.pptxUnit 2 -  Microprocessor & Microcontroller.pptx
Unit 2 - Microprocessor & Microcontroller.pptx
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
 
12 mt06ped005
12 mt06ped005 12 mt06ped005
12 mt06ped005
 
micro controllers 1.ppt
micro controllers 1.pptmicro controllers 1.ppt
micro controllers 1.ppt
 
8051 basics
8051 basics8051 basics
8051 basics
 
8051 microcontroller and embedded training (sahil gupta 9068557926)
8051 microcontroller and embedded training  (sahil gupta   9068557926)8051 microcontroller and embedded training  (sahil gupta   9068557926)
8051 microcontroller and embedded training (sahil gupta 9068557926)
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 MicrocontrollersSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
 
002079
002079002079
002079
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontroller
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
8051 microcontroller and it’s interface
8051 microcontroller and it’s interface8051 microcontroller and it’s interface
8051 microcontroller and it’s interface
 
Ppt embedded
Ppt embeddedPpt embedded
Ppt embedded
 
Embedded training report(mcs 51)
Embedded training report(mcs 51)Embedded training report(mcs 51)
Embedded training report(mcs 51)
 
UNIT 2 8086 System Bus Structure.pptx
UNIT 2 8086 System Bus Structure.pptxUNIT 2 8086 System Bus Structure.pptx
UNIT 2 8086 System Bus Structure.pptx
 
UNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxUNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptx
 
89s52 2
89s52 289s52 2
89s52 2
 
Solution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systemsSolution manual the 8051 microcontroller based embedded systems
Solution manual the 8051 microcontroller based embedded systems
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
 

Kürzlich hochgeladen

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 

INTRODUCTION TO MICROCONTROLLER

  • 2. Microcontroller 8051 • A microcontroller is a highly integrated single chip, which consists of on chip CPU (Central Processing Unit), RAM (Random Access Memory), EPROM/PROM/ROM (Erasable Programmable Read Only Memory), I/O (input/output) – serial and parallel, timers, interrupt controller,analog to digital converter,digital to analog converter,serial interfacing ports,oscillatory circuits. • A microcontroller internally consist of all features required for computing system and functions as a computer without adding any external digital parts in it. • Most of the pins in the uc chip can be made programmable by the user. • It is capable of handling boolean functions and it has many bit handling instructions that can be easily understood by programmer. • Easy to design,small size,low cost and high speed performance. • Microcontroller are used in automatically controlled products and devices,such as automobile engine control systems,implantable medical devices,remote controls,office machines,appliances,toys and other embeded systems.
  • 3. ADDRESSING MODES OF 8051 The way in which the data operands are accessed by different instructions is known as the addressing modes. There are various methods of denoting the data operands in the instruction. The 8051 microcontroller supports mainly 5 addressing modes. They are 1.Immediate addressing mode 2.Direct Addressing mode 3.Register addressing mode 4. Register Indirect addressing mode 5.Indexed addressing mode • Immediate addressing mode : The addressing mode in which the data operand is a constant and it is a part of the instruction itself is known as Immediate addressing mode. Normally the data must be preceded by a # sign. This addressing mode can be used to transfer the data into any of the registers including DPTR. Eg: MOV A , # 27 H : The data (constant) 27 is moved to the accumulator register ADD R1 ,#45 H : Add the constant 45 to the contents of the accumulator
  • 4. • Direct addressing mode: The addressing mode in which the data operand is in the RAM location (00 -7FH) and the address of the data operand is given in the instruction is known as Direct addressing mode. The direct addressing mode uses the lower 128 bytes of Internal RAM and the SFRs. Eg-(a)MOV R1, 42H Move the contents of RAM location 42 into R1 register, (b) MOV 49H,A : Move the contents of the accumulator into the RAM location 49. • Register addressing mode :The addressing mode in which the data operand to be manipulated lies in one of the registers is known as register addressing mode. Eg-(a) MOV A,R0 : Move the contents of the register R0 to the accumulator, (b)ADD A,R6 :Add the contents of R6 register to the accumulator. • Register Indirect addressing mode :The addressing mode in which a register is used as a pointer to the data memory block is known as Register indirect addressing mode. Eg-(a) MOV @ R1 , B : Move the contents of B into RAM location whose address is held by R1. One of the advantages of register indirect addressing mode is that it makes accessing the data more dynamic than static as in the case of direct addressing mode. • Indexed addressing mode : This addressing mode is used in accessing the data elements of lookup table entries located in program ROM space of 8051. Eg-(a) MOVC A,@ A+DPTR (The 16-bit register DPTR and register A are used to form the address of the data element stored in on-chip ROM. Here C denotes code .In this instruction the contents of A are added to the 16-bit DPTR register to form the 16-bit address of the data operand)
  • 5. BLOCK DIAGRAM OF A MICROCONTROLLER
  • 6. Operation of microcontroller • Power supply is turned off and then load the program in the microcontroller chip and then wait what is about to come. • Now switch on the power supply and evrything starts with a high speed,the control logic unit keeps everything under control.The control logic disables all other circuits except quartz crystal to operate. • As the power supply voltage reached to its maximum value then oscillator frequency becomes stable.SFRs are being filled with bits reflecting the state of all circuits within the uc.Now all pins are configured as inputs and then overall electronics starts operation in rhythm with pulse sequence and on time is measured in nano and micro seconds. • The value of program counter is initially set to zero and instruction from the address is send to the instruction decoder which recognizes it and program execution takes place. • After the execution of program the value of program counter is incremented by 1 and whole process is repeated again and again ,several million times per second.
  • 7. Salient features of 8051 uc • 4 KB on chip program memory (ROM or EPROM)). • 128 bytes on chip data memory(RAM). • 8-bit data bus • 16-bit address bus • 32 general purpose registers each of 8 bits • Two -16 bit timers T0 and T1 • Five Interrupts (3 internal and 2 external). • Four Parallel ports each of 8-bits (PORT0, PORT1,PORT2,PORT3) with a total of 32 I/O lines. • One 16-bit program counter and One 16-bit DPTR ( data pointer) • One 8-bit stack pointer. • One Microsecond instruction cycle with 12 MHz Crystal. • One full duplex serial communication port.
  • 8. Criteria for selecting uc 1. Meeting the computing needs of the task efficiently and cost effectively • speed, the amount of ROM and RAM, the number of I/O ports and timers, size, packaging, power consumption • easy to upgrade,cost per unit,power consumption,packaging,no of I/O pins and timer on chip. 2. Availability of software development tools • assemblers, debuggers, C compilers, emulator, simulator, technical support 3. Wide availability and reliable sources of the microcontrollers. A single chip RAM ROM I/O Port Timer Serial COM Port Microcontroller CPU
  • 9. TYPES OF MICROCONTROLLERS Microcontrollers can be classified on the basis of internal bus width, architecture, memory and instruction set as 4-bit,8-bit,16-bit and 32-bit micrcontrollers. • 4-bit Microcontrollers: These 4-bit microcontrollers are small size, minimum pin count and low cost controllers which are widely used for low end applications like LED & LCD display drivers ,portable battery chargers etc.. Their power consumption is also low. The popular 4-bit controllers are Renasa M34501 which is a 20 pin DIP chip with 4kB of ROM,256 Bytes of RAM,2-Counters and 14 I/O Pins. Similarly ATAM862 series from ATMEL. • 8-bit Microcontrollers : These are the most popular and widely used microcontrollers .About 55% of all CPU sold in the world are 8-bit microcontrollers only.The 8-bit microcontroller has 8-bitinternal bus and the ALU performs all the arithmetic and logical operations on a byte instruction. The well known 8-bit microcontroller is 8051 which was designed by Intel in the year 1980 for the use in embedded systems. Other 8-bit microcontrollers are Intel 8031/8052 and Motorola MC68HC11 and AVR Microcontrollers, Microchip’s PIC Microcontrollers 12C5XX ,16C5X and 16C505 etc
  • 10. • 16-bit Microcontrollers : When the microcontroller performs 16-bit arithmetic and logical operations at an instruction, the microcontroller is said to be a 16-bit microcontroller. The internal bus width of 16-bit microcontroller is of 16-bit. These microcontrollers are having increased memory size and speed of operation when compared to 8-bit microcontrollers.These are most suitable for programming in Highlevel languages like C or C++ .They find applications in disk drivers,modems,printers,scanners and servomotor control. Examples of 16-bit microcontrollers are Intel 8096 family and Motorola MC68HC12 and MC68332 families, The performance and computing capability of 16 bit microcontrollers are enhanced with greater precision as compared to the 8-bit microcontrollers. • 32-Bit Microcontrollers :These microcontrollers used in highend applications like Automative control, Communication networks,Robotics,Cell phones ,GPRS & PDAs etc..For EX:PIC32,ARM 7,ARM9 ,SHARP LH79520 ,ATMEL 32 (AVR) ,Texas Instrument’s –. TMS320F2802x/2803x etc..are some of the popular 32-bit microcontrollers.
  • 11. Advantages of uc • Microcontroller act as a microcomputer without any digital parts. • Easily interface additional RAM,ROM,I/O ports. • Low time required for performing operations. • Most of the pins are programmed by user for performing different functions. • Usage is simple,easy for troubleshoot and system maintaining. Disadvantages of uc • Microcontroller got more complex arhitectur then that of up. • Mostly used in uequipment. • Only perform limited no of executions simultaneusly. • Cannot interface high power device directly.
  • 12. Applications of uc • Home appliances - Intercom, telephones, security systems, garage door openers, answering machines, fax machines, home computers, TVs, cable TV tuner, VCR, camcorder, remote controls, video games, cellular phones, musical instruments, sewing machines, lighting control, paging, camera, pinball machines, toys, exercise equipment etc. • Office Equipments - Telephones, computers, security systems, fax machines, microwave, copier, laser printer, color printer, paging etc. • Automobiles - Trip computer, engine control, air bag, ABS, instrumentation, security system, transmission control, entertainment, climate control, cellular phone, keyless entry,flight control systems,printers etc. • Industrial Applications – Industrial controllers,DAS etc. • Used in biomedical equipments, communication systems, robotics, peripheral control in pc. • Military applications.
  • 13. Need of uc over up • Microprocessor is an IC which has only the CPU inside them i.e. only the processing powers such as Intel’s Pentium 1,2,3,4, core 2 duo, i3, i5 etc. These microprocessors don’t have RAM, ROM, and other peripheral on the chip. A system designer has to add them externally to make them functional. Application of microprocessor includes Desktop PC’s, Laptops, notepads etc. • But this is not the case with Microcontrollers. Microcontroller has a CPU, in addition with a fixed amount of RAM, ROM and other peripherals all embedded on a single chip. At times it is also termed as a mini computer or a computer on a single chip. Today different manufacturers produce microcontrollers with a wide range of features available in different versions. Some manufacturers are ATMEL, Microchip, TI, Freescale, Philips, Motorola etc.
  • 14. • Microprocessor find applications where tasks are unspecific like developing software, games, websites, photo editing, creating documents etc. In such cases the relationship between input and output is not defined. They need high amount of resources like RAM, ROM, I/O ports etc. The clock speed of the microprocessor is quite high as compared to the microcontroller. Whereas the ucontrollers operate from a few mhz to 30 to 50 mhz, today’s uprocessor operate above 1ghz as they perform complex tasks. • Microcontrollers are designed to perform specific tasks. Specific means applications where the relationship of input and output is defined. Depending on the input, some processing needs to be done and output is delivered. For example, keyboards, mouse, washing machine, digicam, pendrive, remote, microwave, cars, bikes, telephone, mobiles, watches, etc. Since the applications are very specific, they need small resources like RAM, ROM, I/O ports etc and hence can be embedded on a single chip. This in turn reduces the size and the cost.
  • 15. • So to make a complete ucomputer system only up is not sufficent.It is necessary to add other peripherals such as ROM,RAM,I/O PORTS,DECODERS,DRIVERS to make a complete ucomputer system.Also some special purpose devices such as interrupt controller programmable timers,programmable input device may be added to improve the capacity performance and flexibility of ucomputer system.Basically we have to design a ucomputer based computer system to design a system with greater flexibility.So that to configure a large or small system by adding peripherals. • While microcontroller incorporates all the features that found in up.It has also added features to make a complete ucomputer system on its own.The uc has built in ROM,RAM,I/O PORTS,TIMER,COUNTER,INTERRUPT CONTROL,CLOCK CIRCUIT. The 8051 family has the largest number of diversified (multiple source) suppliers • Intel (original) • Atmel • Philips/Signetics • AMD • Infineon (formerly Siemens) • Matra • Dallas Semiconductor/Maxim
  • 16. Difference uc & up up a) Up contains ALU,general purpose register,stack pointer,program counter,clock timing ckt and interupt ckt. b) Many inst to move data between memory and cpu c) One or 2 bit handling inst. d) More accsess time for memory and input devices e) System requires more hardware. f) System is more flexible in design point of view. g) Single memory map for data & code. h) Less no of pins are multifunctioned. i) System is bulky. uc a) Uc contains the circuitry of up and in addition it has built in ROM,RAM,input device,timers and counters. b) 1 or 2 inst to move data batween memory and cpu. c) Many bit handling inst. d) Less access time. e) Less hardware. f) Less flexible. g) Separate memory map for data and code. h) More no of pins i) Simple
  • 17. a) Boolean operation is not possible directly. b) It takes many instructions to read and write data from external memory. c) 16 bit stack pointer. d) Down counter are used in up so that after each clock pulse the count value decreases. a) Boolean operation is directly possible. b) Onlt takes few inst. c) 8bit stack pointer. d) Up counters are used so that after each clock pulse count value increases.
  • 18. Block diagragm of uc 8051
  • 19. Microcontroller consist of 4 basic functional blocks: a) Main CPU. b) Data memory-RAM & memory for monitoring the program which is to be stored in ROM/EPROM or flash memory. c) Timers/counters. d) I/O ports to interface with external peripheral components. The uc has on chip(built in) peripheral devices.These on chip peripherals make to possible to have a single chip ucomputer system.Advantages of built in peripherals are: a) Built in peripherals have similar access time hence speed is more. b) Hardware reduces due to single chip ucomputer system. c) Less hardware reduces PCB size and increase reliability of system. The CPU of 8051 consists of 8 bit ALU with associated registers like A,B,PWS,SP, 16 bit program counter & data pointer registers it has a set of special functn registers.Unique feature of this architecture is that ALU can manipulate 1 bit as 8 bit data types. a) This 8bit uc which was developed by intel in 1981 has 128 bytes of RAM for storing data called data memory & 4k bytes of on-chip ROM for program storation called code memory. b) One serial port for performing serial or parallel communication and 2 timers which can be used as timer as well as counter.
  • 20. a) 4 bidirectional I/O ports are used each 8 bit wide,all these are in a single chip. b) This 8051 is an 8bit processor i.e. CPU can work on only 8 bits of data at a time,if data is larger than 8 bits then it is to be broken into 8 pieces to be processed by CPU.Whereas 8051 can have max of 64k bytes of on- chip ROM,many manufacturers have put only 4k bytes on the chip. Pin Diagram of 8051 • The 8051 is a 40 pin configuration.It is imp that many pins of 8051 are used for more than one function. • It has 32 I/O pins configured as 4 eight bit parellel ports(P0,P1,P2,P3).All are bidirectional i.e configured as both input and output. • All port pins are multiplexed except the port pin 1.Each port consists of a latch,an output driver and an input buffer.
  • 21. Pin Description of the 8051 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 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)
  • 22. • 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) • 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. • /PSEN(pin 29):program store enable(It is a active low o/p control signal used to activate the enable signal of the external ROM/EPROM) – This is an output pin and is connected to the OE pin of the ROM.
  • 23. • /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. • ALE(pin 30):address latch enable – It is an output pin and is active high. – 8051 port 0 provides both address and data. – The ALE pin is used for de-multiplexing the address and data by connecting to the G pin of the 74LS373 latch. • I/O port pins – The four ports P0, P1, P2, and P3. – Each port uses 8 pins. – All I/O pins are bi-directional.
  • 24. • Using a quartz crystal oscillator • We can observe the frequency on the XTAL2 pin. XTAL Connection to 8051 Power-On RESET Circuit C2 30p F C1 30p F XTAL2 XTAL1 GND Vc c 30 pF 30 pF 8.2 K 10 uF + 11.0592 MHz EA/VP PX1 X2 RST 31 19 18 9
  • 25. Pins of I/O ports • The 8051 has four I/O ports – Port 0 (pins 32-39):P0(P0.0~P0.7) – Port 1(pins 1-8) :P1(P1.0~P1.7) – Port 2(pins 21-28):P2(P2.0~P2.7) – Port 3(pins 10-17):P3(P3.0~P3.7) – Each port has 8 pins. • Named P0.X (X=0,1,...,7), P1.X, P2.X, P3.X • Ex:P0.0 is the bit 0(LSB)of P0 • Ex:P0.7 is the bit 7(MSB)of P0 • These 8 bits form a byte. • Each port can be used as input or output (bi-direction).
  • 26. Port 0 (1). Port 0 is 8-bitbidirectional I/O port. (2). Port 0 pins can be used as high-impedance inputs. (3). Port 0 is also the multiplexed low-order address and data bus during accesses to external program and data memory. (4). We r using pins no. from 32 to 39. (5). When used as an output the pin latches are programmed to 0. (5). When used as an input the pin latches are programmed to 1.
  • 27. Port 1 (1). Port 1 is an 8-bit bidirectional I/0 port. (2). We r using pins no. from 1 to 9. (3). Port 1 have no dual functions. (4). When used as an output the pin latches are programmed to 0. (5). When used as an input the pin latches are programmed to 1.
  • 28. Port 2 (1). Port 2 is an 8-bit bidirectional I/O port. (2). Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX @DPTR). (3). When used as an output the pin latches are programmed to 0. (4). When used as an input the pin latches are programmed to 1. (5). We r using pins no. from 21 to 28.
  • 29. Port 3 (1). Port 3 is an 8-bit bi-directional I/0 port. (2). We r using pins no. from 10 to 17. • RXD (P3.0): Serial input port, • TXD (P3.1): Serial output port, • INT0 (P3.2): External interrupt, • INT1 (P3.3): External interrupt, • T0 T0 (P3.4): Timer 0 external input, • T1 (P3.5): Timer 1 external input, • WR (P3.6): External data memory write strobe, • RD (P3.7): External data memory read strobe,
  • 30. 8051 family members Feature 8051 8052 8031 ROM(on chip program space in bytes) 4k 8k 0k RAM(bytes) 128 256 128 Timers 2 3 2 I/O pins 32 32 32 Serial port 1 1 1 Interrupt sources 6 8 6
  • 31. Comparasion AT89C51,8751 & DS5000 Feature AT89C51 8751 DS5000 ROM(on chip) 4 KB (flash) 4 KB (UV-ROM) 8 KB (NV-RAM) RAM 128 BYTES 128 BYTES 128 BYTES Timers 2 2 2 I/O pins 32 32 32 Serial port 1 1 1 Inrerrupt sources 6 6 8
  • 32. Memory structure of 8051 Program Memory(on-chip ROM)
  • 34. RAM Allocation in 8051 The 8051 has 128 byte internal RAM used for storing data.These internal RAM memory is organized into 3 categories: a) Register bank b) Bit addressable c) General purpose a) Register bank • The 1st 32 byte from address 00H to 1FH of internal RAM constitute 32 working registers.They are organized int 4 banks of 8 registers each.These 4 banks are no from 0-3 and named as R0 to R7. • Each register can be addressed by its name or RAM address. • At a time only one register bank is in use.Bits RS0 to RS7 in PSW determine which bank is currently in use.And on reset bank 0 is selected therfore it is a default register bank.When register banks are not selected then it can be used as general purpose RAM. RS1(PSW.4) RSO(PSW.3) BANK SELECTION 0 0 Bank 0 0 1 Bank 1 1 0 Bank 2 1 1 Bank 3
  • 35. a) Bit/byte addressable - Its location is from 20H to 2FH i.e. 16 bytes provides 128 bits,16*8=128,i.e. from 0 to 127 in decimal or 00-7FH. b) General purpose RAM-The RAM area above bit addressable area from 30H-7FH calles general purpose RAM.It is addressable as byte. 7FH 30H 2FH 20H 1FH 17H 10H 0FH 07H 08H 18H 00H Register Bank 0 (Stack) Register Bank 1 Register Bank 2 Register Bank 3 Bit-Addressable RAM Scratch pad RAM
  • 37. OTP 8051 OTP means one time programmable.Thus when the application is loaded into the device,it cannot be changed anymore. Advantages of OTP : • Lowest prices than their flash counterparts. • Not possible to re-program thus a device can’t be hacked by malicious software updates. EPROM & UV-EPROM : • EPROM was invented to allow malikg chaqnges in the contents pf PROM after it is burned .In EPROM, one can program the memory chip and erase it thousands of time.This is especially needed during the design of any microprocessro based project. • A widely used EPROM is called UV-EPROM where UV stands for ultraviolet.The only problem with UV-EPROM is that it takes upto 20 min for erasing the contents. • All UV-EPROM chips have a window through which the programmer can shine UV radiation to erase its contents for the reason,EPROM is also reffered to as UV erasable EPROM or simply UV-EPROM.
  • 38. • For programming into a UV-EPROM following steps are : • Its contents must be erased.To erase a chip, remove it from its socket on the system board and place it in EPROM erasure equipment to expose it to UV radiation for 15-20 min. • Program the chip.To program a UV-EPROM chip,place it in the ROM burner(programmer).To burn code or data into EPROM,the ROM burner uses 12.5 volts or higher,depending on the EPROM type.This voltage is reffered to as Vpp in the UV-EPROM data sheet. • Now place the chip back into its socket on the system board. 8751 uc • It has 4k bytes of on-chip UV-EPROM.Using this chip for the development access to a PROM burner,as well as a UV-EPROM insid the 8751 chip because we can program it again.Because the on-chip ROM for 8751 is UV-EPROM, it takes around 20 min to erase the 8751 before it can be programed again • 8751 uses 128 bytes on-chip RAM. • 1 serial & 4 parallel ports. • 2 timer/counter. • 6 interrupts. • 32 bit input/output pins.
  • 39. 8051 Stack • The register used to access the stack is called SP (stack pointer) register. • The stack pointer in the 8051 is only 8 bits wide, which means that it can take value 00 to FFH. When 8051 powered up, the SP register contains value 07. • The storing of a CPU register in the stack is called a PUSH – SP is pointing to the last used location of the stack – As we push data onto the stack, the SP is incremented by one – This is different from many microprocessors.eg-MOV SP,#13H • Loading the contents of the stack back into a CPU register is called a POP – With every pop, the top byte of the stack is copied to the register specified by the instruction and the stack pointer is decremented once
  • 40.
  • 41. Address of special function registersS.No Symbol Name of SFR Address (Hex) 1 ACC* Accumulator 0E0 2 B* B-Register 0F0 3 PSW* Program Status word register 0DO 4 SP Stack Pointer Register 81 5 DPTR DPL Data pointer low byte 82 DPH Data pointer high byte 83 6 P0* Port 0 80 P1* Port 1 90 8 P2* Port 2 0A 9 P3* Port 3 0B 10 IP* Interrupt Priority control 0B8 11 IE* Interrupt Enable control 0A8 12 TMOD Tmier mode register 89 13 TCON* Timer control register 88 14 TH0 Timer 0 Higher byte 8C 15 TL0 Timer 0 Lower byte 8A 16 TH1 Timer 1Higher byte 8D 17 TL1 Timer 1 lower byte 8B 18 SCON* Serial control register 98 19 SBUF Serial buffer register 99 20 PCON Power control register 87