8051 Programming
8051 Programming
To
8051Programming
Yogesh Misra Mody Institute of Technology & Science (Deemed University) Faculty of Engineering & Technology Sikar [Raj.]
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
Back section of ENIAC showing vaccum tubes The 1946 ENIAC computer used 17,468 vacuum tubes and consumed 150kW of power
DEVELOPMENT OF MICROPROCESSOR
DEVELOPMENT OF MICROPROCESSOR
INSIDE MICROPROCESSOR
ALU
Accumulator Flags
Address Lines
Data Lines
Program Counter
Stack Pointer
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
ADD B OUT 20 H HLT
A = 04H
A=A+ B Send the content of register A to output device whose address is 20H Stop
45H , 04H
59H , 05H 24H 29H , 20H 76H
01000101 00000100
01011001 00000101 00100100 00101001 00100000 01110110
PROGRAMMING EXAMPLE
Binary Information MVI A 04H MVI B 05H ADD B [01000101] [00000100] [01011001] [00000101] [00100100]
0005H
0006H 0007H 0008H
OUT
20 H HLT
[00101001]
[00100000] [01110110]
FFFFH
MICROCONTROLLER
First microcontroller
By Intel
In 1976
4 bit
8048
Pin Description
Vcc(+5volt) Pin - 40
Pin Description
Port 0 from Pin-39 to pin-32
Microcontroller 8051
Pin Description Port 1 from Pin-1 to pin-8
Pin Description
Microcontroller 8051
Pin Description
Port 3 from Pin-10 to Pin-17
P3.0 RXD P3.1 TXD P3.2 IN T0 P3.3 IN T1 P3.4 T0 P3.5 T1 P3.6 WR P3.7 RD
Pin Description
crystal
Editor Program
Assembler Program Debugger
Editor
Program Source file (.a51)
Assembler
Object file (.obj), List file (.LST), check syntax errors
Linker
Hex file (.hex)
Loader
M I C R O C O N T R O L L E R
STEPS
GREEN
YELLOW
RED
ON
OFF
OFF
ON
ON
OFF
OFF
OFF
ON
OFF
ON
ON
Pin no. 20 Pin no. 21 Pin no. 22 Pin no. 9 Pin no. 18 Pin no. 19 Pin no. 20
PINS OF INTEREST
Reset
A T 8 9 C 5 1
P2.2 RED
P2.1 YELLOW
P2.0 GREEN
Thank You