Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

mazzidi-the 8051 microcontroller and embedded system, Study Guides, Projects, Research of Microcontrollers

very nic book for deep knowledge of 8051. this book also useful for learn programming of embedded system

Typology: Study Guides, Projects, Research

2017/2018

Uploaded on 01/12/2018

ayushri-srivastva
ayushri-srivastva 🇮🇳

2.5

(4)

2 documents

1 / 617

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download mazzidi-the 8051 microcontroller and embedded system and more Study Guides, Projects, Research Microcontrollers in PDF only on Docsity!

The 8051 Microcontroller and Embedded Using Assembly and C Muhammad Ali Mazidi Janice Gillispie Mazidi Second EditionSystems CONTENTS ˆ ˆ Introduction to ComputingThe 8051 Microcontrollers^ Rolin D. McKinlay ˆ ˆ ˆ ˆ^ ˆ ˆ ˆ ˆ^^8051 Branch InstructionsI/O Port Programming (^8051) Arithmetic & Logic Instructions 805180518051 Assembly Language ProgrammingAddressing ModesProgramming in CHardware Connection and Hex FileTimer/Counter Programming And Programs in Assembly and C ˆ ˆ ˆ ˆ^ ˆ ˆ^^8051 Interrupts Programming (^8051) 8051 Real World Interfacing I: LCD,ADC AND SENSORSLCD and Keyboard 8051 Serial Port ProgrammingInterfacing to External MemoryInterfacing with 8255 Interfacing in Assembly and C^ in Assembly and C

‰^ OUTLINES HANEL

Numbering and coding systems ‰ Digital primer ‰ Inside the computer

‰^ NUMBERINGAND CODINGSYSTEMSDecimal andBinary NumberSystems HANEL

Human beings use base 10 (

decimal)

arithmetic^ ¾^ There are 10 distinct symbols, 0, 1, 2,

9 ‰ Computers use base 2 (

binary) system

¾^ There are only 0 and 1 ¾^ These two binary digits are commonlyreferred to as

bits

‰^ NUMBERINGAND CODINGSYSTEMSConvertingfrom Binary toDecimal HANEL

Know the weight of each bit in a binarynumber ‰ Add them together to get its decimalequivalentEx. Convert 11001 ‰ Use the concept of weight to convert adecimal number to a binary directly

to decimal 2 Weight:^

4 3 22

2 1 22

(^02)

Digits:^

Sum:^

16 +^ 8 +^

0 +^ 0 +^

1 = 25^10

Ex. Convert 39

to binary (^10) 32 + 0 + 0 + 4 + 2 + 1 = 39 Therefore, 39

‰^ NUMBERINGAND CODINGSYSTEMSHexadecimalSystem HANEL

Base 16, thehexadecimal system,is used as aconvenientrepresentation ofbinary numbers^ ¾^ ex.It is much easier torepresent a string of 0sand 1s such as100010010110 as itshexadecimal equivalent of896H

F 1111 15

E 1110 14

D 1101 13

C 1100 12

B 1011 11

A 1010 10

(^91001) 9

(^81000) 8

(^70111) 7

(^60110) 6

(^50101) 5

(^40100) 4

(^30011) 3

(^20010) 2

(^10001) 1

(^00000) 0

HexBinary Decimal

‰^ NUMBERINGAND CODINGSYSTEMSConvertingfrom Decimalto Hex HANEL

Convert to binary first and thenconvert to hex ‰ Convert directly from decimal to hexby repeated division, keeping track ofthe remaindersEx. Convert 45^10

to hex 32 16 8 4 2

45 = 0010 1101^10

= 2D^2

Ex. Convert 629

to hex 10 512 256 128 64

629 =^ 512+64+32+16+4+1^10

‰^ NUMBERINGAND CODINGSYSTEMSConvertingfrom Hex toDecimal HANEL

Convert from hex to binary and then todecimal ‰ Convert directly from hex to decimalby summing the weight of all digitsEx. 6B2= 0110 1011 0010^16

2 1024 512 256

10

‰^ NUMBERINGAND CODINGSYSTEMSSubtraction ofHex Numbers HANEL

If the second digit is greater than thefirst, borrow 16 from the precedingdigitEx. Perform hex subtraction: 59F – 2B859F^ LSD: 15 – 8 = 7– 2B^

9 + 16 – 11 = 14 = E

16 2E^

‰^ NUMBERINGAND CODINGSYSTEMSASCII Code HANEL

The ASCII (pronounced

“ask-E”) code

assigns binary patterns for^ ¾^ Numbers 0 to 9^ ¾^ All the letters of English alphabet,uppercase and lowercase^ ¾^ Many control codes and punctuationmarks ‰ The ASCII system uses 7 bits torepresent each code

z7A Z5A

y 79 Y 59

…... ......

d 64 D 44

c 63 C 43

b 62 B 42

a 61 A 41

SymbolHex SymbolHex Selected ASCII codes

‰^ DIGITALPRIMERLogic Gates HANEL

AND gate Computer Science Illuminated, Dale and Lewis ‰ OR gate Computer Science Illuminated, Dale and Lewis

‰^ DIGITALPRIMERLogic Gates(cont’) HANEL

Tri-state buffer ‰ Inverter Computer Science Illuminated, Dale and Lewis ‰ XOR gate Computer Science Illuminated, Dale and Lewis

Department of Computer Science and Information EngineeringNational Cheng Kung University, TAIWAN

DIGITALPRIMERLogic DesignUsing Gates^ HANEL

Half adder Full adder

Digital Design, Mano

Department of Computer Science and Information EngineeringNational Cheng Kung University, TAIWAN

DIGITALPRIMERLogic DesignUsing Gates(cont’)^ HANEL

4-bit adder

Digital Design, Mano