SlideShare a Scribd company logo
INTRODUCTION TO THE CONTROLLER AT89C51
(8051)
Objectives of the Lab
 To learn the functionality of different ports and pins of
8051 µcontroller.
 To discuss the circuits that make 8051 works.
 To learn the ‘KEIL’ software to create a ‘HEX’ file for the
8051 controller.
Pins and Ports of 8051
Use with
caution
If EA high
Internal Block Diagram of 8051
Once Around the Pins
 Power: VCC,VSS (GND)
 Reset:RST
 Crystal:XTAL1,2
 External Device Interfacing: EA,ALE,PSEN,WR,RD
 I/O Port: P0-P3 [7:0]
 P3: Shared with control lines: Serial RxD TxD, Counter
control T0, T1, External Interrupts INT0, INT1
 P0 and P2 are multiplexed with data bus.
 P1 can only be used as I/O port.
Circuits that make 8051 work
2 mc
Crystal Frequency and Machine
Cycle
 Crystal Frequency used is 11.0592MHz or 11059200 Hz.
 The oddball frequency is used to synchronize the serial baud
rates.
 At this frequency, the time period of one wave will be
1/11059200 seconds.
 The ‘time unit’ for 8051 is known as Machine Cycle.
 And one machine cycle equals 12 waves of crystal frequency.
 So the time period of 1 machine cycle will be 12 times the
time-period of one wave i.e. 12/11059200 sec
 This comes out to be approximately 1.085 µs.
Logic Levels & Ports for I/O
Operation Always write ‘high’ to ports for input
Program Structure (Directives)
org 00h
Coding instructions here
delay: ;subroutine
ret
end
Registers (Naming) Normally Used
Accumulator (A or ACC) Base (B)
Ports (P0,P1,P2,P3 & Px.y) PSW (For Flags & Register Banks)
R0,R1,…,R7 SP(Stack Pointer)
DPTR(Data Pointer) Timer Registers
Serial Port Registers Interrupt Registers
PCON (Power Control
Register)
IP (Instruction Pointer)
Legend:
* Frequently used
* Special Functions
* Occasionally
* Used automatically
How to work with ‘KEIL’
1. Locate the ‘Keil uVision2’ icon on the screen.
2. Run the program and go to Project>Close Project if a previous
project file is open otherwise go to Project> New Project.
3. The program will ask for the file name. Give any location in the
directory and write any program name you like. (Remember:
Create a folder before creating program)
4. After step 3, another window will open namely ‘Select Device for
Target’. Expand Atmel and click ‘AT89c51’. Also check ‘ Use
extended linker LX51 instead of BL51’ and click ‘OK’
How to work with ‘KEIL’
5. Now create a new file. Go to File>New.
6. Save this file by any name but give the extension
‘.asm’ e.g. firstprog.asm.
7. On the leftmost side, expand ‘Target1’ to ‘Source
Group 1’. Right click on ‘Source Group1’ and
select ‘Add files to Group’. A window will appear.
Select file type ‘Asm Source File’ and add the just
made file and close the window.
How to work with ‘KEIL’
9. Now go to Project>Options for Target. A new window will
appear. On the ‘Target tab’, modify the xtal frequency to
11.0592. Then go to ‘Output tab’ and check ‘Create HEX
File’.
10. Then write the code for the program. After writing code, save
it. Then go to Project>Build Target. In the lower box, if there
are no errors in the file, ‘creating hex file’ will be written.
This means the HEX file is created.
Lab Task
 Create HEX file of a blank program.

More Related Content

PPTX
Systemcall
PPTX
Reactive programming with RxAndroid
PPTX
Rxandroid
PPTX
07 windows runtime app lifecycle
PDF
Reactive computing
PPTX
Servlet Filters
PPTX
Reactive Programming no Android
DOCX
Scene manager
Systemcall
Reactive programming with RxAndroid
Rxandroid
07 windows runtime app lifecycle
Reactive computing
Servlet Filters
Reactive Programming no Android
Scene manager

What's hot (6)

PPT
Evolution of asynchrony in (ASP).NET
PPTX
Reactive Extensions: classic Observer in .NET
PPTX
Reactive Programming on Android
PPTX
Asynchronous Programming in ASP.NET
PDF
Servlet Filter
PDF
Architecture
Evolution of asynchrony in (ASP).NET
Reactive Extensions: classic Observer in .NET
Reactive Programming on Android
Asynchronous Programming in ASP.NET
Servlet Filter
Architecture
Ad

Viewers also liked (13)

PDF
Micro-C introduce
PDF
Microprocessor and Microcontroller Lab Manual!
PDF
Mp lab manual
PDF
microprocessor 8086 lab manual !!
PDF
8051 assembly programming
PPTX
8051 Assembly Language Programming
PDF
8086 microprocessor lab manual
PDF
Solution manual 8051 microcontroller by mazidi
PPT
Assembly language programming_fundamentals 8086
PDF
MD51 Lab Manual
PDF
8051 experiments1
PPT
1347 Assembly Language Programming Of 8051
Micro-C introduce
Microprocessor and Microcontroller Lab Manual!
Mp lab manual
microprocessor 8086 lab manual !!
8051 assembly programming
8051 Assembly Language Programming
8086 microprocessor lab manual
Solution manual 8051 microcontroller by mazidi
Assembly language programming_fundamentals 8086
MD51 Lab Manual
8051 experiments1
1347 Assembly Language Programming Of 8051
Ad

Similar to Micro c lab1(intro to 8051) (20)

PPTX
8051 microcontroller
PDF
Getting started with 8051 at89 c51 using keil uvision 4 and proteus
PDF
Micrcontroller iv sem lab manual
PPTX
Unit -2 and 3 mekirirygiygyuguiguihiiqio
PDF
Micro Processor & Micro Controller Practical Notes_Electrical Engineering GTU...
PPT
4221-Microcontroller-8051 89c52 51-1.ppt
PDF
Cp e 214_appendix_c
PPT
Emb day2 8051
PPT
Introduction-to-Keil.ppt
PPT
8051-MICROCONTROLLER all contents with diagram.ppt
PPTX
8051 Programing in C.pptx this is ppt on 8051 programming
PPT
Sourabh ppt.
PPTX
Embedded system
PPT
PPTX
Unit two and unit three pptx for btech ece
PDF
8051_microcontroller_unit4 Presentation.pdf
DOCX
Architecture of 8051
PPT
Ch3 ppt
PDF
MT2301_Unit II.pdf
PPTX
8051 Microcontroller
8051 microcontroller
Getting started with 8051 at89 c51 using keil uvision 4 and proteus
Micrcontroller iv sem lab manual
Unit -2 and 3 mekirirygiygyuguiguihiiqio
Micro Processor & Micro Controller Practical Notes_Electrical Engineering GTU...
4221-Microcontroller-8051 89c52 51-1.ppt
Cp e 214_appendix_c
Emb day2 8051
Introduction-to-Keil.ppt
8051-MICROCONTROLLER all contents with diagram.ppt
8051 Programing in C.pptx this is ppt on 8051 programming
Sourabh ppt.
Embedded system
Unit two and unit three pptx for btech ece
8051_microcontroller_unit4 Presentation.pdf
Architecture of 8051
Ch3 ppt
MT2301_Unit II.pdf
8051 Microcontroller

More from Mashood (12)

PPTX
Patience (1).pptx
PPTX
Micro c lab8(serial communication)
PPTX
Micro c lab7(timers)
PPTX
Micro c lab6(lcd)
PPTX
Micro c lab5(stepper-motor)
PPTX
Micro c lab4(keypad)
PPTX
Micro c lab3(ssd)
PPTX
Micro c lab2(led patterns)
PPT
Amplifiers (analog electronics ii lab)
PDF
Pcb design using proteus
PPT
Function Generator
PPT
Speed Measuring Circuit
Patience (1).pptx
Micro c lab8(serial communication)
Micro c lab7(timers)
Micro c lab6(lcd)
Micro c lab5(stepper-motor)
Micro c lab4(keypad)
Micro c lab3(ssd)
Micro c lab2(led patterns)
Amplifiers (analog electronics ii lab)
Pcb design using proteus
Function Generator
Speed Measuring Circuit

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Insiders guide to clinical Medicine.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Institutional Correction lecture only . . .
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
Supply Chain Operations Speaking Notes -ICLT Program
01-Introduction-to-Information-Management.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Insiders guide to clinical Medicine.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
RMMM.pdf make it easy to upload and study
Institutional Correction lecture only . . .
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
VCE English Exam - Section C Student Revision Booklet
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPH.pptx obstetrics and gynecology in nursing
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Anesthesia in Laparoscopic Surgery in India
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O5-L3 Freight Transport Ops (International) V1.pdf

Micro c lab1(intro to 8051)

  • 1. INTRODUCTION TO THE CONTROLLER AT89C51 (8051)
  • 2. Objectives of the Lab  To learn the functionality of different ports and pins of 8051 µcontroller.  To discuss the circuits that make 8051 works.  To learn the ‘KEIL’ software to create a ‘HEX’ file for the 8051 controller.
  • 3. Pins and Ports of 8051 Use with caution If EA high
  • 5. Once Around the Pins  Power: VCC,VSS (GND)  Reset:RST  Crystal:XTAL1,2  External Device Interfacing: EA,ALE,PSEN,WR,RD  I/O Port: P0-P3 [7:0]  P3: Shared with control lines: Serial RxD TxD, Counter control T0, T1, External Interrupts INT0, INT1  P0 and P2 are multiplexed with data bus.  P1 can only be used as I/O port.
  • 6. Circuits that make 8051 work 2 mc
  • 7. Crystal Frequency and Machine Cycle  Crystal Frequency used is 11.0592MHz or 11059200 Hz.  The oddball frequency is used to synchronize the serial baud rates.  At this frequency, the time period of one wave will be 1/11059200 seconds.  The ‘time unit’ for 8051 is known as Machine Cycle.  And one machine cycle equals 12 waves of crystal frequency.  So the time period of 1 machine cycle will be 12 times the time-period of one wave i.e. 12/11059200 sec  This comes out to be approximately 1.085 µs.
  • 8. Logic Levels & Ports for I/O Operation Always write ‘high’ to ports for input
  • 9. Program Structure (Directives) org 00h Coding instructions here delay: ;subroutine ret end
  • 10. Registers (Naming) Normally Used Accumulator (A or ACC) Base (B) Ports (P0,P1,P2,P3 & Px.y) PSW (For Flags & Register Banks) R0,R1,…,R7 SP(Stack Pointer) DPTR(Data Pointer) Timer Registers Serial Port Registers Interrupt Registers PCON (Power Control Register) IP (Instruction Pointer) Legend: * Frequently used * Special Functions * Occasionally * Used automatically
  • 11. How to work with ‘KEIL’ 1. Locate the ‘Keil uVision2’ icon on the screen. 2. Run the program and go to Project>Close Project if a previous project file is open otherwise go to Project> New Project. 3. The program will ask for the file name. Give any location in the directory and write any program name you like. (Remember: Create a folder before creating program) 4. After step 3, another window will open namely ‘Select Device for Target’. Expand Atmel and click ‘AT89c51’. Also check ‘ Use extended linker LX51 instead of BL51’ and click ‘OK’
  • 12. How to work with ‘KEIL’ 5. Now create a new file. Go to File>New. 6. Save this file by any name but give the extension ‘.asm’ e.g. firstprog.asm. 7. On the leftmost side, expand ‘Target1’ to ‘Source Group 1’. Right click on ‘Source Group1’ and select ‘Add files to Group’. A window will appear. Select file type ‘Asm Source File’ and add the just made file and close the window.
  • 13. How to work with ‘KEIL’ 9. Now go to Project>Options for Target. A new window will appear. On the ‘Target tab’, modify the xtal frequency to 11.0592. Then go to ‘Output tab’ and check ‘Create HEX File’. 10. Then write the code for the program. After writing code, save it. Then go to Project>Build Target. In the lower box, if there are no errors in the file, ‘creating hex file’ will be written. This means the HEX file is created.
  • 14. Lab Task  Create HEX file of a blank program.