Example: bachelor of science

THE 8051/8052 MICROCONTROLLER - Official Site

THE 8051 /8052 MICROCONTROLLER Architecture, Assembly Language, and Hardware Interfacing Craig Steiner Universal Publishers Boca Raton, Florida USA 2005 The 8051 /8052 MicrocontrollerArchitecture, Assembly Language, and Hardware InterfacingISBN: 1-58112-459-7 Author: Craig SteinerCover Photo and Design: Erika Oliden Gonz lez ,storedina retrievalsystem,ortransmitted,inanyformo rbyanymeans,electronic,mechanical,photoc opying,recording, or otherwise, without the prior written permission of the ,brandnames,trademarks,servicemarks,logo s,orregisteredtrademarksusedinthisbook are the property of their respective owners and are hereby acknowledged. Universal PublishersBoca Raton, FL USA ErikaPrefaceDespiteitsrelativelyoldage,t heMCS-51(8052) andarecompatiblewith animportantskillforanyonethatplansto develop MICROCONTROLLER -based ,hobbyist, you'llbedevelopingyourprogramin'C',a workingknowledgeoftheunderlyingarchitect ureaswellasthemicrocontroller'sassemblyl anguageis extremelyimportantinwritingefficientcode thatwil

THE 8051/8052 MICROCONTROLLER Architecture, Assembly Language, and Hardware Interfacing Craig Steiner Universal Publishers Boca Raton, Florida

Tags:

  Microcontrollers, 5820, The 8051 8052 microcontroller, 8051

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of THE 8051/8052 MICROCONTROLLER - Official Site

1 THE 8051 /8052 MICROCONTROLLER Architecture, Assembly Language, and Hardware Interfacing Craig Steiner Universal Publishers Boca Raton, Florida USA 2005 The 8051 /8052 MicrocontrollerArchitecture, Assembly Language, and Hardware InterfacingISBN: 1-58112-459-7 Author: Craig SteinerCover Photo and Design: Erika Oliden Gonz lez ,storedina retrievalsystem,ortransmitted,inanyformo rbyanymeans,electronic,mechanical,photoc opying,recording, or otherwise, without the prior written permission of the ,brandnames,trademarks,servicemarks,logo s,orregisteredtrademarksusedinthisbook are the property of their respective owners and are hereby acknowledged. Universal PublishersBoca Raton, FL USA ErikaPrefaceDespiteitsrelativelyoldage,t heMCS-51(8052)

2 Andarecompatiblewith animportantskillforanyonethatplansto develop MICROCONTROLLER -based ,hobbyist, you'llbedevelopingyourprogramin'C',a workingknowledgeoftheunderlyingarchitect ureaswellasthemicrocontroller'sassemblyl anguageis extremelyimportantinwritingefficientcode thatwillseparatea typical'C'programmerfroma farmoreversatileembedded 8052 software book will explain the 8052 architecture step by step so that someone just beginning to use the 8052 maygeta usefulreferencethatwillassistboththenovi ceprogrammer as well as the experienced developer long after the architecture has been specific knowledge of the 8052 is required but the book does assume the general and conceptual knowledge of understanding of decimal, hexadecimal, and binary number systems.

3 ,thoughnopriorknowledgeofthe8052 IC is microcontrolleris,thenfocusonthedetailso fthe8052microcontroller, 'llthenprovidea designfora workingsingle-boardcomputer(SBC) the SBC's hardware and describe a "monitor program" which can be used to control it. Thereissomeoverlap,however, ,thereferencestoassemblylanguageinstruct ionswillbebrief,well-commented,and,hopef ully,understandableinthecontextofthearch itecturethatis anassemblylanguageinstructionusedinthefi rstfewchaptersisn'tclear orifyou'reanxioustoreadmoreabouttheinstr uction 'tfeelthatyoumustreadtheentirebookina strictlysequential wouldcordiallyinviteyoutovisitmywebsite, , whereyouwillfindadditionalresources,exam plesourcecode,anda messageforumwitha usercommunityofover12,000peoplethatexcha ngeideas,comments,questions,andanswers on the 8052 ,I wouldinviteyoutosubmitanycomments,sugges tions, listoferrataandcorrections for the book will be found at ,ofcourse,I.

4 Iwouldliketospecificallythankthefollowin gpeoplefortheirassistance:GerardSteiner, SteveTaylor,AgustinDominguez,ErikMalund, MichaelKaras, wasproof-readingthemanuscript,providingf eedbackoncircuitdiagrams,orsimplytolerat ingthelonghoursI putinwriting this book, their help and support was of Contents8052 1: INTRODUCTION TO 8052 What is a MICROCONTROLLER ?.. MICROCONTROLLER Program Loading a MICROCONTROLLER What is an 8051 or 8052?.. Derivative Using Windows or 2: TYPES OF Code Memory External On-Chip Internal Special Function Register (SFR) 3: SPECIAL FUNCTION REGISTERS (SFRs).. Referencing Referencing Bits of Bit-Addressable SFR SFR Other SFRs for Derivative 4: BASIC "R" "B" Program Counter (PC).

5 Data Pointer (DPTR).. Stack Pointer (SP)..23 CHAPTER 5: ADDRESSING Immediate Direct Indirect External External Code 6: PROGRAM Conditional Direct Direct Returns from 7: INTERNAL iiiCHAPTER 8: How does a timer count?.. Using Timers to Measure How long does a timer take to count?.. Timer Timer Mode (TMOD) Timer Control (TCON) Initializing a Reading the Timing the length of Using Timers as Event Using Timer Timer 2 Control (T2 CON) Timer 2 in Auto-Reload Timer 2 in Capture Timer 2 as a Baud Rate 9: SERIAL Serial Control SFR (SCON).. Serial Mode 0: 8-bit Shift Register, Oscillator-based Baud Serial Mode 1: 8-bit UART, Timer-based Baud Serial Mode 2: 9-bit UART, Oscillator-based Baud Serial Mode 3: 9-bit UART, Timer-based Baud Configuring the Serial Setting the Serial Port Baud Writing to the Serial Reading the Serial Using Timer 2 for Serial Port Baud Serial Communication Sample 10: Events that can Trigger Configuring Polling Interrupt Interrupt Exiting Specific Interrupt Timer 0 and Timer 1 External 0 and External 1 Serial Timer 2 Register Locating Large ISRs in Common Problems with Functional Interrupt 11.

6 8052 ASSEMBLY Number Operator Characters and Character Assembly Language Setting the Address of Program Assembly (ORG).. Establishing Symbol Equates (EQU).. Inserting 8-bit Data In Program (DB).. Inserting 16-bit Data In Program (DW).. Changing Program Flow (LJMP, SJMP, AJMP).. Subroutines (LCALL, ACALL, RET).. Register Assignment (MOV).. Incrementing and Decrementing Registers (INC/ DEC).. Program Loops (DJNZ).. DJNZ With More Than 256 Setting, Clearing, and Moving Bits (SETB/CLR/CPL/MOV).. Bit-Based Decisions & Branching (JB, JBC, JNB, JC, JNC).. Value Comparison (CJNE).. Less Than and Greater Than Comparison (CJNE).. Zero and Non-Zero Decisions (JZ/JNZ).. Performing Additions (ADD, ADDC).

7 Performing Subtractions (SUBB).. Performing Multiplication (MUL).. Performing Division (DIV).. Shifting Bits (RR, RRC, RL, RLC).. Bit-wise Logical Instructions (ANL, ORL, XRL).. Exchanging Register Values (XCH).. Swapping Accumulator Nibbles (SWAP).. Exchanging Nibbles Between Accumulator and Internal RAM (XCHD).. Adjusting Accumulator for BCD Addition (DA).. Using the Stack (PUSH/POP).. Setting the Data Pointer DPTR (MOV DPTR).. Reading External RAM/Data Memory (MOVX).. Reading Code Memory/Tables (MOVC).. Using Jump Tables (JMP 12: 16-BIT MATHEMATICS WITH THE How did we learn math in primary school?.. 16-bit 16-bit 16-bit 16-bit HARDWARE & SINGLE BOARD 13: 8052 MICROCONTROLLER PIN I/O Ports (P0, P1, P2, P3).)

8 Port Port Port Port Oscillator Inputs (XTAL1, XTAL2).. Reset Line (RST).. Address Latch Enable (ALE).. Program Store Enable (-PSEN).. External Access (-EA)..117 CHAPTER 14: AN 8052 SINGLE BOARD COMPUTER (SBC).. Features of the SBC MICROCONTROLLER : Atmel AT89S8252, Dallas 89C420, or 8052 (U1).. Latch: 74LS573 (U2).. Address Decoder: 74LS138 (U5).. EPROM Code Memory: 27C256 (U3).. Static RAM: 62256 (U4).. LCD: Memory-Mapped (J3) and Direct Connect (J4).. Keypad Connector (J5).. DS1307 Real Time Clock (U13).. AT25010A Serial EEPROM (U14).. Reset Circuit: RC Network, MN13811 Reset Supervisor, and Manual RS-232 Transceiver: Power Connector, Rectification, and Voltage In-System Programming (J2, J6, U11, U12).

9 Port Connections (J7 J10).. Power, Ground, and other Signal Connections (J11).. Latched Low Byte of Address Bus (J12).. Power Jumper (JP7).. Other 15: SOFTWARE DEVELOPMENT Introduction to Pinnacle 52 Integrated Development Pinnacle 52 Environment Creating, Loading, and Saving Editor Assembling a Loading a Program for Simulating a Program in Pinnacle Pinnacle's View of Registers and Execute Simulator Concept of Projects in Pinnacle Creating Editing Building Project Relocatable Code in Pinnacle The Problem of Absolute Code in Multiple Source Relocatable Initialization and Interrupt Vectors with Relocatable When to Use Relocatable Multiple Source Files in Pinnacle 16: HARDWARE DEVELOPMENT Device Programmers.

10 Using a Device In-System Using In-System In-Circuit Using ICE Within a INTERFACE AND SOFTWARE 17: SBCMON MONITOR Installing Configuring the PC Terminal Powering up SBCMON Main Command 'A': Command 'C': Read/Set Real Time Command 'E': Read/Write Serial Command 'I': Read/Write to Internal Command 'K': Keypad Command 'L': Load HEX File into SBC Command 'M': Set LCD Access Command 'Q': Quick HEX Load and Command 'R': Run (Execute) Code at Specific Command 'V': Verify External Command 'W': Write Text to Command 'w': Write Commands to Command 'X': Read/Write to External Writing Programs that Execute in Using SBCMON Library Routines in External Using Interrupts in External Programs with Using Timers in 18: INTERFACING TO 4x4 Direct Connection of Memory-Mapped Connection of Reading and Debouncing 19.


Related search queries