Upload
yogesh-misra
View
219
Download
12
Embed Size (px)
DESCRIPTION
8051 Basics
Citation preview
Orientation
To
8051Programming
Yogesh MisraMody Institute of Technology & Science(Deemed University)Faculty of Engineering & TechnologySikar [Raj.]
Sensor ADC Processor ActuatorDAC
Embedded System Structure
Essential Components
• Processor (µP, µC , DSP or ASIC)
• Sensor (it convert a physical quantity into electrical signal)
• Converters (ADC and DAC)
• Actuator (it transforms electrical energy into mechanical energy)
• Memory (On-chip / Off chip)
• Communication path with the interacting environment
DEVELOPMENT OF MICROPROCESSORFirst Generation (1940-1956) Vacuum Tubes
First generation computers relied on machine language
Back section of ENIAC showing vaccum tubesThe 1946 ENIAC computer used 17,468 vacuum tubes and consumed 150kW of power
Second Generation (1956-1963) Transistors
The transistor was invented in 1947
Vaccum tubes of first generation computer are now replaced by semiconductor devices.
Second-generation computers moved from machine language to assembly languages.
DEVELOPMENT OF MICROPROCESSOR
Third Generation (1964-1971) Integrated Circuits
The first integrated circuit (IC) was developed in the 1950s by Jack Kilby of Texas Instruments and Robert Noyce of Fairchild Semiconductor.
Fourth Generation (1971-Present) Microprocessors
The microprocessor brought the fourth generation of computers, as thousands of integrated circuits were built onto a single silicon chip.
The Intel 4004 chip, developed in 1971
DEVELOPMENT OF MICROPROCESSOR
Accumulator Flags
B C
D E
H L
Program Counter
Stack Pointer
Timing & Control
Unit
ALU Address Lines
Data Lines
Timing & Control Signals
INSIDE MICROPROCESSOR
MICROPROCESSOR BASED SYSTEM
EXPANDED MICROPROCESSOR BASED SYSTEM
MEMORY
LANGUAGE
Machine Language: Instructions in binary form.
Assembly language: Instructions in mnemonic form.
High-Level language: Program is written using statements.
PROGRAMMING EXAMPLE
Program Explanation Hex Code Binary Code
MVI A , 04H A = 04H 45H , 04H 01000101 00000100
MVI B , 05H B = 05H 59H , 05H 01011001 00000101
ADD B A = A + B 24H 00100100
OUT 20 H Send the content of register A to output device whose address is 20H
29H , 20H 00101001 00100000
HLT Stop 76H 01110110
Memory Address Binary Information
0000H MVI A [01000101]
0001H 04H [00000100]
0002H MVI B [01011001]
0003H 05H [00000101]
0004H ADD B [00100100]
0005H OUT [00101001]
0006H 20 H [00100000]
0007H HLT [01110110]
0008H
FFFFH
PROGRAMMING EXAMPLE
MICROCONTROLLER
First microcontroller By Intel In 1976 4 bit 8048
First 8 bit microcontroller by Intel was 8051 (reffered as MCS-51) in 1981
Vcc(+5volt)Pin - 40
Ground(0 volt)Pin-20
Pin Description
Pin Description
Port 0 fromPin-39 to pin-32
Used to excess bothdata & address
Dual functional
Microcontroller 8051Pin Description
Port 1 fromPin-1 to pin-8
Used as I/O port
Pin Description
Port 2 fromPin-21 to pin-28
Used to excessaddress & as I/O port
Microcontroller 8051Pin Description
Port 3 from Pin-10 to Pin-17
P3.0 RXDP3.1 TXDP3.2 IN T0P3.3 IN T1P3.4 T0
P3.5 T1P3.6 WRP3.7 RD
Pin Description
reset
crystal
External memory
Add. Latch enable
Program Store Enable
Tools for developing Assembly Language Programs
Integrated Development Environment
Development Processor
Target Processor
Editor Program
Assembler Program
Debugger
Loader / Linker Program
Editor Assembler LinkerSource file (.a51)
Program Object file (.obj), List file (.LST), check syntax errors
Hex file (.hex)
MICROCONTROLLER
Loader
Demo of downloading of a program in microcontrollerAIM: Write a program for traffic light control. The microcontroller AT89C51-20P is operated by a XTAL of frequency 11.0592 Mhz.
STEPS GREEN YELLOW RED
1 ON OFF OFF
2 ON ON OFF
3 OFF OFF ON
4 OFF ON ON
AT89C51
P2.2
P2.1
P2.0
RED
YELLOW
GREEN
Reset
PINS OF INTERESTP2.0 Pin no. 20
P2.1 Pin no. 21
P2.2 Pin no. 22
Reset Pin no. 9
XTAL2 Pin no. 18
XTAL2 Pin no. 19
GND Pin no. 20
Pin no. 40 Vcc
Pin no. 31 EA
HEX FILE
:10000000B29012000780F97B207AFF79FFC055D0AB:0C00100055C055D055D9F6DAF2DBEE22CF:00000001FF
• Red color hexadecimal number tells the loader how many bytes are in the line. (number of bytes in a line range from 00H to 10H)
• Blue color hexadecimal number is 16 bit ROM address where loader will load the first byte.
• Green color digits are either “00” or “10”.
“00” means is more line to come after this line.
“01” means this is last line and the loading should stop after this line.
Black Color this is hex code of the program
Brown Color last byte in the line is checksum byte used for error checking
Thank You