SlideShare a Scribd company logo
1 of 35
ATMEL MICROCONTROLLERS
(89C51 & 89C2051)
Dr.Y.NARASIMHA MURTHY Ph.D
yayavaram@yahoo.com
INTRODUCTION
 Atmel introduced its first 8-bit Flash microcontroller
AT89C51 in 1993, based on the 8051 core
 The AT89C51 is a low-power high performance CMOS 8-
bit Microcontroller with 4 k.bytes of flash programmable
and erasable read only memory(PEROM).It is compatible
with the INTEL’S industry standard MCS51 instruction set
and pin-out.
 The device is manufactured using Atmel’s high-density
nonvolatile memory technology
Dr.YNM 2
Introduction Contd….
 The on-chip flash allows the program memory
to be reprogrammed in-system.
 By combining a versatile 8-bit CPU with Flash
on a monolithic chip, the Atmel AT89C51 is a
powerful microcomputer which provides a
highly-flexible and cost-effective solution to
many embedded control applications.
Dr.YNM 3
Contd
 The flash memory on the chip is a non-volatile
memory, which can be electrically erased for
lines and blocks.
 The mechanism foe erasing the memory is
easier than that for EEPROM.
 Typically 1000 write/erase cycles are possible
which is more than sufficient for any
embedded application.
 The registers and memory organisation is same
as that of the MCS 51.The pin functions of
Atmel 89C51 are same as that of MCS-51.
. Dr.YNM 4
Features of 89c51
Dr.YNM 5
contd
 The only difference between the two is
that 89C51 has on-chip ‘‘flash’’ program
memory and the MCS51 has normal
PROM
Dr.YNM 6
PIN DIAGRAMS
Dr.YNM 7
Dr.YNM 8
Block diagram -89C51
Dr.YNM 9
ATMEL 89C2051
 The AT89C2051 is a low voltage , high performance,
CMOS 8-bit microcontroller with 2K bytes of Flash
programmable and erasableread only memory.
 The device is manufactured using Atmel’s high
density non-volatile memory technology and is
compatible with the industry standard MCS51
instruction set.
 By combining a versatile 8-bit CPU with flash on a
monolithic chip ,the Atmel AT89C2051 is a powerful
microcomputer which provides a highly flexible and
cost-effective solution to many embedded control
applications.
Dr.YNM 10
89C2051 - Features
 The AT89C2051 provides 2K bytes of Flash,
128 bytes of RAM, 15 I/O lines, two 16-bit
timer/counters, a five vector two-level interrupt
architecture, a full duplex serial port, a
precision analog comparator, on-chip oscillator
and clock circuitry.
 In addition, the AT89C2051 is designed with
static logic for operation down to zero
frequency and supports two software selectable
power saving modes.
Dr.YNM 11
contd…..
 The Idle Mode stops the CPU while allowing
the RAM, timer/counters, serial port and
interrupt system to continue functioning.
 The power-down mode saves the RAM
contents but freezes the oscillator disabling all
other chip functions until the next hardware
reset. 8-bit Microcontroller with 2K Bytes
Flash AT89C2051 0368H
Dr.YNM 12
contd
 It has an static processor core, ie. there is
no minimum clock frequency. the
maximum clock frequency is 24 MHz. Of
course the AT89C2051-24PC can also be
run at 11.0592 MHz.
Dr.YNM 13
Program Memory Lock Bits
 There are two on-chip lock bits which can be
left unprogrammed (U) or can be programmed
(P) to obtain the additional features shown in
the next slide.
 They provide a kind of security for the data.
 The Lock Bits can only be erased with the
Chip Erase operation.
Dr.YNM 14
Lock Bit Protection Modes
 Program Lock Bits
LB1 LB2 Protection Type
1 U U No program lock features
2 P U Further programming of
the Flash is disabled
3 P P Same as mode 2, also
verify is disabled
Dr.YNM 15
Block diagram-89C2051
Dr.YNM 16
Pin diagram
 It is available as
20-lead PDIP/SOIC
chip which normally
works at +5V D.C
Dr.YNM 17
Pin Description
 VCC Supply voltage.
 GND Ground.
 Port 1 -The Port 1 is an 8-bit bi-directional I/O
port. Port pins P1.2 to P1.7 provide internal
pull-ups. P1.0 and P1.1 require external pull-
ups. P1.0 and P1.1 also serve as the positive
input (AIN0) and the negative input (AIN1),
respectively, of the on-chip precision analog
comparator.
Dr.YNM 18
Contd….
 The Port 1 out-put buffers can sink 20 mA and
can drive LED displays directly. When 1s are
written to Port 1 pins, they can be used as
inputs.
 When pins P1.2 to P1.7 are used as inputs and
are externally pulled low, they will source
current (IIL) because of the internal pull-ups.
 Port 1 also receives code data during Flash
programming and verification.
Dr.YNM 19
Contd….
 Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional
I/O pins with internal pull-ups. P3.6 is hard-wired as
an input to the output of the on-chip comparator and
is not accessible as a general-purpose I/O pin. The
Port 3 output buffers can sink 20 mA. When 1s are
written to Port 3 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will
source current (IIL) because of the pull-ups.
 Port 3 also receives some control signals for Flash
programming and verification.
Dr.YNM 20
The functions of various special features of the
PORT3 are as follows:
Port Pin Alternate Functions
 P3.0 RXD (serial input port)
 P3.1 TXD (serial output port)
 P3.2 INT0 (external interrupt 0)
 P3.3 INT1 (external interrupt 1)
 P3.4 T0 (timer 0 external input)
 P3.5 T1 (timer 1 external input)
Dr.YNM 21
Contd….
 RST -Reset input. All I/O pins are reset to 1s
as soon as RST goes high. Holding the RST
pin high for two machine cycles while the
oscillator is running resets the device. Each
machine cycle takes 12 oscillator or clock
cycles.
 XTAL1 Input to the inverting oscillator
amplifier and input to the internal clock
operating circuit.
 XTAL2 Output from the inverting oscillator
amplifier.
Dr.YNM 22
Oscillator Characteristics
 The XTAL1 and XTAL2 are the input and output,
respectively, of an inverting amplifier which can be
configured for use as an on-chip oscillator, as shown in
Figure 5-1.
 Either a quartz crystal or ceramic resonator may be used.
To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is
driven as shown in next slide.
 There are no requirements on the duty cycle of the
external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop,
but minimum and maximum voltage high and low time
specifications must be observed.
Dr.YNM 23
Contd….
 Oscillator connections External clock drive connections
C1, C2 = 30 pF ± 10 pF for Crystals &
40 pF ± 10 pF for Ceramic Resonators Dr.YNM 24
Idle Mode
 In idle mode, the CPU puts itself to sleep while all the
on-chip peripherals remain active. The mode is
invoked by software.
 The content of the on-chip RAM and all the special
functions registers remain unchanged during this
mode.
 The idle mode can be terminated by any enabled
interrupt or by a hardware reset. The P1.0 and P1.1
should be set to “0” if no external pull-ups are used,
or set to “1” if external pull-ups are used. It should be
noted that when idle is terminated by a hardware
reset, the device normally resumes program
execution, from where it left off, up to two machine
cycles before the internal reset algorithm takes
control.
Dr.YNM 25
Contd….
 On-chip hardware inhibits access to internal
RAM in this event, but access to the port pins
is not inhibited.
 To eliminate the possibility of an unexpected
write to a port pin when Idle is terminated by
reset, the instruction following the one that
invokes Idle should not be one that writes to a
port pin or to external memory.
Dr.YNM 26
Power-down Mode
 In the power-down mode the oscillator is stopped, and
the instruction that invokes power-down is the last
instruction executed.
 The on-chip RAM and Special Function Registers
retain their values until the power-down mode is
terminated.
 The only exit from power-down is a hardware reset.
Reset redefines the SFRs but does not change the on-
chip RAM. The reset should not be activated before
VCC is restored to its normal operating level and must
be held active long enough to allow the oscillator to
restart and stabilize. The P1.0 and P1.1 should be set to
“0” if no external pull-ups are used, or set to “1” if
external pull-ups are used.
Dr.YNM 27
Restrictions on Certain Instructions
 The AT89C2051 and is an economical and
cost-effective member of Atmel’s growing
family of microcontrollers. It contains 2K
bytes of Flash program memory. It is fully
compatible with the MCS-51 architecture,
and can be programmed using the MCS-
51 instruction set. However, there are a
few considerations one must keep in mind
when utilizing certain instructions to
program this device.
Dr.YNM 28
 All the instructions related to jumping or
branching should be restricted such that the
destination address falls within the physical
program memory space of the device, which is
2K for the AT89C2051.
 So, the programmer must be careful while
writing the programs. For example, LJMP
7E0H would be a valid instruction for the
AT89C2051 (with 2K of memory), whereas
LJMP 900H would not.
Dr.YNM 29
contd
Branching Instructions
 LCALL, LJMP, ACALL, AJMP, SJMP, JMP
@A+DPTR – These unconditional branching
instructions will execute correctly as long as the
programmer keeps in mind that the destination
branching address must fall within the physical
boundaries of the program memory size (loca-
tions 00H to 7FFH for the 89C2051). Violating
the physical space limits may cause unknown
program behavior.
Dr.YNM 30
contd
 CJNE [...], DJNZ [...], JB, JNB, JC, JNC, JBC,
JZ, JNZ – With these conditional branching
instructions the same rule above applies.
Again, violating the memory boundaries may
cause erratic execution.
Dr.YNM 31
Basic differences between 89C51 & 89C2051
 89C2051 is having additionally an on chip precision
analog comparator.
 89C2051 has only 15 I/O lines so, port1 and port3 are
only available on it.
 The architecture of 89C2051 does not support any
external address/data bus and therefore RD,WR
signals are absent .
 Similar to 89C51 ,the 89C2051 also supports full-
duplex serial communication and six interrupt
sources.
Dr.YNM 32
 Similar to 89C51 ,two power saving modes namely
“Idle mode and power down modes are also available
in 89C2051 .
 The 89C51 has 4Kb of flash memory where as
89C2051 is having only 2Kb of flash memoey
 ALE,PSEN,EA signals are not available in 89C2051
chip.
 The analog precision comparator on the 89C2051
may be used along with RC components to build a
simple comparator type ADC.
 Though there are certain differences ,still 89C2051
provides cost effective ,compact and flexible
solutions for many industrial applications.
Dr.YNM 33
 The advantage of having internal analog
comparator is that ,it saves a lot of board space
and the designer is free from doing additional
work of selection of op-amps and other
components.
Dr.YNM 34
contd
Applications
 The Atmel controllers have wide spread
industrial & Scientific applications which
include
 Industrial automation
 Low power based applications
 Wave form generation
 Frequency counters
 Sensor interfaced applications …
Dr.YNM 35

More Related Content

Similar to Atmel.ppt

Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheetAtmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Arpan Saha
 

Similar to Atmel.ppt (20)

Electronic voting machine using mcu 89s52
Electronic voting machine using mcu 89s52Electronic voting machine using mcu 89s52
Electronic voting machine using mcu 89s52
 
Electronic voting machine presentation
Electronic voting machine  presentationElectronic voting machine  presentation
Electronic voting machine presentation
 
Datasheet8951
Datasheet8951Datasheet8951
Datasheet8951
 
At89s52
At89s52At89s52
At89s52
 
At89 c51
At89 c51At89 c51
At89 c51
 
At 89s52
At 89s52At 89s52
At 89s52
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
 
Atmega 32
Atmega 32Atmega 32
Atmega 32
 
At 89c51
At 89c51At 89c51
At 89c51
 
Introduction to PIC.pptx
Introduction to PIC.pptxIntroduction to PIC.pptx
Introduction to PIC.pptx
 
Microcontroller at89 s52 datasheet
Microcontroller at89 s52 datasheetMicrocontroller at89 s52 datasheet
Microcontroller at89 s52 datasheet
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)
 
dspAt89 s52
dspAt89 s52dspAt89 s52
dspAt89 s52
 
Atmega32
Atmega32Atmega32
Atmega32
 
Atemega saya
Atemega sayaAtemega saya
Atemega saya
 
janakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiraman I msc 4 unit
janakiraman I msc 4 unit
 
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheetAtmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
 
A tmega8 l
A tmega8 lA tmega8 l
A tmega8 l
 
Doc2502
Doc2502Doc2502
Doc2502
 
89s52 2
89s52 289s52 2
89s52 2
 

More from Dr.YNM

More from Dr.YNM (20)

Introduction to DSP.ppt
Introduction to DSP.pptIntroduction to DSP.ppt
Introduction to DSP.ppt
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.ppt
 
Crystalstructure-.ppt
Crystalstructure-.pptCrystalstructure-.ppt
Crystalstructure-.ppt
 
Basics of OS & RTOS.ppt
Basics of OS & RTOS.pptBasics of OS & RTOS.ppt
Basics of OS & RTOS.ppt
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptx
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
Introduction to ASICs.pptx
Introduction to ASICs.pptxIntroduction to ASICs.pptx
Introduction to ASICs.pptx
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.ppt
 
Basics of data communications.pptx
Basics of data communications.pptxBasics of data communications.pptx
Basics of data communications.pptx
 
CPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxCPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptx
 
Transient response of RC , RL circuits with step input
Transient response of RC , RL circuits  with step inputTransient response of RC , RL circuits  with step input
Transient response of RC , RL circuits with step input
 
CISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESCISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURES
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURE
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-III
 
LECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSLECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORS
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture II
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 

Recently uploaded

Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 

Atmel.ppt

  • 1. ATMEL MICROCONTROLLERS (89C51 & 89C2051) Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.com
  • 2. INTRODUCTION  Atmel introduced its first 8-bit Flash microcontroller AT89C51 in 1993, based on the 8051 core  The AT89C51 is a low-power high performance CMOS 8- bit Microcontroller with 4 k.bytes of flash programmable and erasable read only memory(PEROM).It is compatible with the INTEL’S industry standard MCS51 instruction set and pin-out.  The device is manufactured using Atmel’s high-density nonvolatile memory technology Dr.YNM 2
  • 3. Introduction Contd….  The on-chip flash allows the program memory to be reprogrammed in-system.  By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. Dr.YNM 3
  • 4. Contd  The flash memory on the chip is a non-volatile memory, which can be electrically erased for lines and blocks.  The mechanism foe erasing the memory is easier than that for EEPROM.  Typically 1000 write/erase cycles are possible which is more than sufficient for any embedded application.  The registers and memory organisation is same as that of the MCS 51.The pin functions of Atmel 89C51 are same as that of MCS-51. . Dr.YNM 4
  • 6. contd  The only difference between the two is that 89C51 has on-chip ‘‘flash’’ program memory and the MCS51 has normal PROM Dr.YNM 6
  • 10. ATMEL 89C2051  The AT89C2051 is a low voltage , high performance, CMOS 8-bit microcontroller with 2K bytes of Flash programmable and erasableread only memory.  The device is manufactured using Atmel’s high density non-volatile memory technology and is compatible with the industry standard MCS51 instruction set.  By combining a versatile 8-bit CPU with flash on a monolithic chip ,the Atmel AT89C2051 is a powerful microcomputer which provides a highly flexible and cost-effective solution to many embedded control applications. Dr.YNM 10
  • 11. 89C2051 - Features  The AT89C2051 provides 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and clock circuitry.  In addition, the AT89C2051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. Dr.YNM 11
  • 12. contd…..  The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning.  The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. 8-bit Microcontroller with 2K Bytes Flash AT89C2051 0368H Dr.YNM 12
  • 13. contd  It has an static processor core, ie. there is no minimum clock frequency. the maximum clock frequency is 24 MHz. Of course the AT89C2051-24PC can also be run at 11.0592 MHz. Dr.YNM 13
  • 14. Program Memory Lock Bits  There are two on-chip lock bits which can be left unprogrammed (U) or can be programmed (P) to obtain the additional features shown in the next slide.  They provide a kind of security for the data.  The Lock Bits can only be erased with the Chip Erase operation. Dr.YNM 14
  • 15. Lock Bit Protection Modes  Program Lock Bits LB1 LB2 Protection Type 1 U U No program lock features 2 P U Further programming of the Flash is disabled 3 P P Same as mode 2, also verify is disabled Dr.YNM 15
  • 17. Pin diagram  It is available as 20-lead PDIP/SOIC chip which normally works at +5V D.C Dr.YNM 17
  • 18. Pin Description  VCC Supply voltage.  GND Ground.  Port 1 -The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide internal pull-ups. P1.0 and P1.1 require external pull- ups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog comparator. Dr.YNM 18
  • 19. Contd….  The Port 1 out-put buffers can sink 20 mA and can drive LED displays directly. When 1s are written to Port 1 pins, they can be used as inputs.  When pins P1.2 to P1.7 are used as inputs and are externally pulled low, they will source current (IIL) because of the internal pull-ups.  Port 1 also receives code data during Flash programming and verification. Dr.YNM 19
  • 20. Contd….  Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a general-purpose I/O pin. The Port 3 output buffers can sink 20 mA. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups.  Port 3 also receives some control signals for Flash programming and verification. Dr.YNM 20
  • 21. The functions of various special features of the PORT3 are as follows: Port Pin Alternate Functions  P3.0 RXD (serial input port)  P3.1 TXD (serial output port)  P3.2 INT0 (external interrupt 0)  P3.3 INT1 (external interrupt 1)  P3.4 T0 (timer 0 external input)  P3.5 T1 (timer 1 external input) Dr.YNM 21
  • 22. Contd….  RST -Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high for two machine cycles while the oscillator is running resets the device. Each machine cycle takes 12 oscillator or clock cycles.  XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.  XTAL2 Output from the inverting oscillator amplifier. Dr.YNM 22
  • 23. Oscillator Characteristics  The XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 5-1.  Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in next slide.  There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. Dr.YNM 23
  • 24. Contd….  Oscillator connections External clock drive connections C1, C2 = 30 pF ± 10 pF for Crystals & 40 pF ± 10 pF for Ceramic Resonators Dr.YNM 24
  • 25. Idle Mode  In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. The mode is invoked by software.  The content of the on-chip RAM and all the special functions registers remain unchanged during this mode.  The idle mode can be terminated by any enabled interrupt or by a hardware reset. The P1.0 and P1.1 should be set to “0” if no external pull-ups are used, or set to “1” if external pull-ups are used. It should be noted that when idle is terminated by a hardware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. Dr.YNM 25
  • 26. Contd….  On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited.  To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory. Dr.YNM 26
  • 27. Power-down Mode  In the power-down mode the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed.  The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated.  The only exit from power-down is a hardware reset. Reset redefines the SFRs but does not change the on- chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. The P1.0 and P1.1 should be set to “0” if no external pull-ups are used, or set to “1” if external pull-ups are used. Dr.YNM 27
  • 28. Restrictions on Certain Instructions  The AT89C2051 and is an economical and cost-effective member of Atmel’s growing family of microcontrollers. It contains 2K bytes of Flash program memory. It is fully compatible with the MCS-51 architecture, and can be programmed using the MCS- 51 instruction set. However, there are a few considerations one must keep in mind when utilizing certain instructions to program this device. Dr.YNM 28
  • 29.  All the instructions related to jumping or branching should be restricted such that the destination address falls within the physical program memory space of the device, which is 2K for the AT89C2051.  So, the programmer must be careful while writing the programs. For example, LJMP 7E0H would be a valid instruction for the AT89C2051 (with 2K of memory), whereas LJMP 900H would not. Dr.YNM 29 contd
  • 30. Branching Instructions  LCALL, LJMP, ACALL, AJMP, SJMP, JMP @A+DPTR – These unconditional branching instructions will execute correctly as long as the programmer keeps in mind that the destination branching address must fall within the physical boundaries of the program memory size (loca- tions 00H to 7FFH for the 89C2051). Violating the physical space limits may cause unknown program behavior. Dr.YNM 30
  • 31. contd  CJNE [...], DJNZ [...], JB, JNB, JC, JNC, JBC, JZ, JNZ – With these conditional branching instructions the same rule above applies. Again, violating the memory boundaries may cause erratic execution. Dr.YNM 31
  • 32. Basic differences between 89C51 & 89C2051  89C2051 is having additionally an on chip precision analog comparator.  89C2051 has only 15 I/O lines so, port1 and port3 are only available on it.  The architecture of 89C2051 does not support any external address/data bus and therefore RD,WR signals are absent .  Similar to 89C51 ,the 89C2051 also supports full- duplex serial communication and six interrupt sources. Dr.YNM 32
  • 33.  Similar to 89C51 ,two power saving modes namely “Idle mode and power down modes are also available in 89C2051 .  The 89C51 has 4Kb of flash memory where as 89C2051 is having only 2Kb of flash memoey  ALE,PSEN,EA signals are not available in 89C2051 chip.  The analog precision comparator on the 89C2051 may be used along with RC components to build a simple comparator type ADC.  Though there are certain differences ,still 89C2051 provides cost effective ,compact and flexible solutions for many industrial applications. Dr.YNM 33
  • 34.  The advantage of having internal analog comparator is that ,it saves a lot of board space and the designer is free from doing additional work of selection of op-amps and other components. Dr.YNM 34 contd
  • 35. Applications  The Atmel controllers have wide spread industrial & Scientific applications which include  Industrial automation  Low power based applications  Wave form generation  Frequency counters  Sensor interfaced applications … Dr.YNM 35