Sunteți pe pagina 1din 5

CONTENTS

Foreword Preface xiii xv

PART I LEARNING MICROCONTROLLERS


1. Introduction to Microcontrollers 1.1 Introduction 3 1.2 Microcontrollers and Microprocessors 5 1.3 History of Microcontrollers and Microprocessors 1.4 Embedded versus External Memory Devices 7 1.5 8-bit and 16-bit Microcontrollers 8 1.6 CISC and RISC Processors 8 1.7 Harvard and Von Neumann Architectures 9 1.8 Commercial Microcontroller Devices 10 Summary 13 Review Questions 13 Hands-on Exercises 14 2. 8051 Microcontrollers 2.1 Introduction 15 2.2 MCS-51 Architecture 16 2.3 Registers in MCS-51 18 Summary 24 3

15

viii

Contents

Review Questions 24 Hands-on Exercies 25 3. 8051 Pin Description, Connections, I/O Ports and Memory Organization 3.1 8051 Pin Description 26 3.2 8051 Connections 29 3.3 8051 Parallel I/O Ports 30 3.4 Memory Organization 32 Summary 34 Review Questions 34 Hands-on Exercises 35 4. MCS-51 Addressing Modes and Instructions 4.1 8051 Addressing Modes 36 4.2 MCS-51 Instruction Set 39 4.3 8051 Instructions and Simple Programs 44 4.4 Using Stack Pointer 56 Summary 58 Review Questions 58 Hands-on Exercises 59 5. 8051 Assembly Language Programming Tools 5.1 8051 Assembly Language Programming 60 5.2 Development Systems and Tools 63 5.3 Software Simulators of 8051 64 Summary 65 Review Questions 65 Hands-on Exercises 65 6. MCS-51 Interrupts, Timer/Counters and Serial Communication 6.1 Interrupts 66 6.2 Interrupts in MCS-51 67 6.3 Timers and Counters 70 6.4 Serial Communication 77 Summary 82 Review Questions 82 Hands-on Exercises 83 26

36

60

66

Contents

ix

7. Design with Atmel Microcontrollers 7.1 Atmel Microcontrollers (89CXX and 89C20XX) 84 7.2 Architectural Overview of Atmel 89C51 and Atmel 89C2051 85 7.3 Pin Description of 89C51 and 89C2051 85 7.4 Using Flash Memory Devices Atmel 89CXX and 89C20XX 89 7.5 Power Saving Options 94 Summary 96 Review Questions 96 Hands-on Exercises 97 8. Applications of MCS-51 and Atmel 89C51 and 89C2051 Microcontrollers 8.1 Applications of MCS-51 and Atmel 89C51 and 89C2051 microcontrollers 8.2 Square Wave Generation 99 8.3 Rectangular Waves 100 8.4 Pulse Generation 101 8.5 Pulse Width Modulation (PWM) 102 8.6 Staircase Ramp Generation 104 8.7 Sine Wave Generation 105 8.8 Pulse Width Measurement 107 8.9 Frequency Counter 109 Summary 110 Review Questions 110 Hand-on Exercises 111 98

84

98

PART II PIC MICROCONTROLLERS


9. PIC Microcontrollers 9.1 PIC Microcontrollers: Overview and Features 115 9.2 PIC 16C6X/7X 118 FSR (File Selection Register) [Indirect Data Memory Address Pointer] 9.3 PIC Reset Actions 124 9.4 PIC Oscillator Connections 126 9.5 PIC Memory Organization 127 9.6 PIC 16C6X/7X Instructions 132 9.7 Addressing Modes 135 9.8 I/O Ports 136 9.9 Interrupts in PIC 16C61/71 138 115

121

Contents

9.10 PIC 16C61/71 Timers 141 9.11 PIC 16C71 Analog-to-Digital Converter (ADC) Summary 148 Review Questions 148 Hands-on-Exercises 149 10. PIC 10.1 10.2 10.3 10.5 10.4 10.6 10.7 10.8 10.9 10.10 10.11 16F8XX Flash Microcontrollers Introduction 150 Pin Diagram of 16F8XX 152 STATUS Register 154 OPTION_REG Register 156 Power Control Register (PCON) 156 PIC 16F8XX Program Memory 157 PIC 16F8XX Data Memory 158 DATA EEPROM and Flash Program EEPROM Interrupts in 16F877 166 I/O Ports 170 Timers 172 Summary 175 Review Questions 176 Hands-on Exercises 176

144

150

160

11. More About PIC Microcontrollers 11.1 Introduction 177 11.2 Capture/Compare/ PWM (CCP) Modules in PIC 16F877 178 11.3 Master Synchronous Serial Port (MSSP) Module 186 11.4 Universal Synchronous Asynchronous Receiver Transmitter (USART) 11.5 Analog-to-Digital Converter (ADC) 208 Summary 211 Review Questions 212 Hands-on Exercises 212

177

202

PART III INTERFACING AND INDUSTRIAL APPLICATIONS OF MICROCONTROLLERS


12. Interfacing and Microcontroller Applications 12.1 Introduction 215 215

Contents

xi

12.2 12.3 12.4 12.5 12.6

Light Emitting Diodes (LEDs), Push Buttons, Relays and Latch Connections Keyboard Interfacing 221 Interfacing 7-Segment Displays 227 LCD Interfacing 232 ADC and DAC Interfacing with 89C51 Microcontrollers 240 Summary 244 Review Questions 244 Hands-on Exercises 245

216

13. Industrial Applications of Microcontrollers 13.1 Introduction 246 13.2 Measurement Applications 247 13.3 Automation and Control Applications 269 Summary 288 Review Questions 288 Head on Exercises 289 14. Advanced Programming and Math Calculations 14.1 Introduction 290 14.2 Fixed-Point Numbers 291 14.3 Addition of two 16-bit Numbers 294 14.4 Unsigned 32-bit Addition 296 14.5 Subtraction of Two 16-bit Numbers 298 14.6 Conversion of 8-bit Signed Number into a 16-bit Signed Number 14.7 16-bit Signed Addition 300 14.8 Binary to BCD Conversion 300 14.9 Square Root Calculations 302 14.10 Integration 303 14.11 Differentiation 304 14.12 Floating-Point Arithmetic 305 Summary 308 Review Questions 308 Hands-on Exercises 309 Appendix I: PIC 16F877 Instructions Appendix II: Microcontroller Data Sheets References Index

246

290

299

310 317 331 329

S-ar putea să vă placă și