| Preface |
|
xiii | |
|
Introduction to the Intel MCS-51 |
|
|
1 | (40) |
|
|
|
1 | (1) |
|
|
|
1 | (6) |
|
|
|
1 | (4) |
|
|
|
5 | (2) |
|
|
|
7 | (2) |
|
The MCS-51 Memory Organization |
|
|
9 | (1) |
|
|
|
10 | (2) |
|
|
|
12 | (1) |
|
The MCS-51 Addressing Modes |
|
|
13 | (9) |
|
|
|
14 | (1) |
|
|
|
14 | (1) |
|
|
|
15 | (1) |
|
|
|
16 | (1) |
|
|
|
17 | (1) |
|
|
|
17 | (1) |
|
|
|
18 | (1) |
|
|
|
19 | (1) |
|
|
|
20 | (1) |
|
|
|
20 | (2) |
|
|
|
22 | (1) |
|
A Sample of MCS-51 Instructions |
|
|
23 | (5) |
|
|
|
23 | (3) |
|
|
|
26 | (1) |
|
|
|
27 | (1) |
|
|
|
28 | (8) |
|
|
|
28 | (1) |
|
Decoding Machine Language Instructions |
|
|
29 | (2) |
|
The Instruction Execution Cycle |
|
|
31 | (4) |
|
|
|
35 | (1) |
|
|
|
36 | (2) |
|
|
|
38 | (3) |
|
MCS-51 Assembly Programming |
|
|
41 | (72) |
|
|
|
41 | (1) |
|
Assembly Language Program Structure |
|
|
41 | (3) |
|
|
|
44 | (11) |
|
Segment Control Directives |
|
|
44 | (3) |
|
Symbol Definition Directives |
|
|
47 | (1) |
|
Memory Initialization Directives |
|
|
48 | (1) |
|
Memory Reservation Directives |
|
|
49 | (2) |
|
Program Linkage Directives |
|
|
51 | (2) |
|
Address Control Directives |
|
|
53 | (1) |
|
|
|
53 | (1) |
|
Macro Definition Directives |
|
|
54 | (1) |
|
|
|
55 | (1) |
|
Writing Programs to Do Arithmetic |
|
|
56 | (11) |
|
|
|
57 | (1) |
|
|
|
58 | (1) |
|
Subtraction and the CY flag |
|
|
59 | (1) |
|
Multiprecision Subtraction |
|
|
60 | (1) |
|
Binary-Coded Decimal Addition |
|
|
61 | (3) |
|
Multiplication and Division |
|
|
64 | (3) |
|
|
|
67 | (9) |
|
|
|
69 | (3) |
|
Decrement and Increment Instructions |
|
|
72 | (1) |
|
Instructions for Variable Initialization |
|
|
73 | (3) |
|
|
|
76 | (1) |
|
|
|
77 | (4) |
|
Boolean Variable Manipulation Instructions |
|
|
81 | (2) |
|
|
|
83 | (2) |
|
|
|
85 | (22) |
|
|
|
85 | (3) |
|
Hardware Development Tools |
|
|
88 | (1) |
|
|
|
88 | (8) |
|
|
|
96 | (9) |
|
|
|
105 | (2) |
|
|
|
107 | (1) |
|
|
|
108 | (2) |
|
Lab Exercises and Assignments |
|
|
110 | (3) |
|
Advanced Assembly Programming |
|
|
113 | (44) |
|
|
|
113 | (1) |
|
|
|
113 | (1) |
|
|
|
113 | (2) |
|
Indexable Data Structures |
|
|
115 | (7) |
|
|
|
122 | (12) |
|
|
|
134 | (2) |
|
Issues in Subroutine Calls |
|
|
136 | (1) |
|
|
|
137 | (1) |
|
Examples of Subroutine Calls |
|
|
138 | (14) |
|
|
|
138 | (3) |
|
|
|
141 | (1) |
|
|
|
142 | (5) |
|
Calculating the Root-Mean-Square Value |
|
|
147 | (5) |
|
Dual Data Pointers of the DS87C520 Microcontroller |
|
|
152 | (1) |
|
|
|
153 | (1) |
|
|
|
154 | (1) |
|
Lab Exercises and Assignments |
|
|
155 | (2) |
|
Bus Cycles and Memory Expansion |
|
|
157 | (34) |
|
|
|
157 | (1) |
|
|
|
157 | (1) |
|
|
|
158 | (1) |
|
|
|
159 | (1) |
|
|
|
160 | (2) |
|
Bus Transaction Timing Diagram |
|
|
162 | (1) |
|
A Summary of the MCS-51/52 Signal Pins |
|
|
163 | (3) |
|
The 8XC51FX Bus Cycle Timing Diagram |
|
|
166 | (4) |
|
Memory Terminology and SRAM |
|
|
170 | (9) |
|
Memory Capacity and Organization |
|
|
171 | (1) |
|
|
|
172 | (3) |
|
|
|
175 | (4) |
|
Memory System Design for MCS-51/52 |
|
|
179 | (8) |
|
|
|
187 | (1) |
|
|
|
188 | (3) |
|
Interrupts, Resets, and Exception Processing |
|
|
191 | (17) |
|
|
|
191 | (1) |
|
|
|
191 | (4) |
|
|
|
191 | (1) |
|
|
|
192 | (1) |
|
|
|
192 | (1) |
|
|
|
193 | (1) |
|
|
|
193 | (1) |
|
|
|
193 | (1) |
|
|
|
194 | (1) |
|
|
|
195 | (1) |
|
|
|
195 | (1) |
|
|
|
196 | (4) |
|
The MCS-51/52 Interrupt Priority Structure |
|
|
198 | (1) |
|
How Interrupts Are Handled |
|
|
198 | (2) |
|
|
|
200 | (1) |
|
|
|
200 | (1) |
|
|
|
200 | (2) |
|
|
|
201 | (1) |
|
Power-Saving Modes of Operation |
|
|
202 | (2) |
|
|
|
202 | (1) |
|
|
|
203 | (1) |
|
MCS-51/52 Interrupt Programming |
|
|
204 | (1) |
|
|
|
205 | (1) |
|
|
|
206 | (1) |
|
Lab Exercises and Assignments |
|
|
207 | (1) |
|
|
|
208 | (53) |
|
|
|
208 | (1) |
|
|
|
208 | (1) |
|
|
|
209 | (1) |
|
I/O Transfer Synchronization |
|
|
210 | (3) |
|
Synchronizing the Microprocessor and the Interface Chip |
|
|
210 | (1) |
|
Synchronizing the Interface Chip and the I/O Devices |
|
|
211 | (2) |
|
MCS-51/52 Parallel I/O Overview |
|
|
213 | (3) |
|
Port Structures and Operation |
|
|
213 | (1) |
|
|
|
214 | (2) |
|
|
|
216 | (1) |
|
Interfacing Parallel Ports with the Keyboard |
|
|
217 | (7) |
|
Keypad Scanning Techniques |
|
|
218 | (2) |
|
|
|
220 | (4) |
|
|
|
224 | (1) |
|
|
|
224 | (16) |
|
|
|
225 | (1) |
|
The Seven-Segment Display |
|
|
226 | (5) |
|
Driving Liquid-Crystal Displays Using the MCS-51/52 Parallel Ports |
|
|
231 | (3) |
|
Interfacing with the D/A Converter (DAC) Using the MCS-51/52 Parallel Ports |
|
|
234 | (6) |
|
The 18255 Programmable Peripheral Interface |
|
|
240 | (16) |
|
|
|
241 | (1) |
|
|
|
241 | (6) |
|
Interfacing the i8255 with the 87C51FX |
|
|
247 | (4) |
|
Centronics Printer Interface |
|
|
251 | (5) |
|
|
|
256 | (1) |
|
|
|
256 | (2) |
|
Lab Exercises and Assignments |
|
|
258 | (3) |
|
|
|
261 | (59) |
|
|
|
261 | (1) |
|
|
|
261 | (2) |
|
|
|
263 | (8) |
|
Timer 0 and Timer 1 Operation Modes |
|
|
264 | (2) |
|
Applications of Timer 0 and Timer 1 |
|
|
266 | (5) |
|
|
|
271 | (11) |
|
|
|
271 | (1) |
|
Timer 2 Auto-Reload Mode (Up or Down Counter) |
|
|
271 | (3) |
|
Timer 2 Baud Rate Generation Mode |
|
|
274 | (1) |
|
|
|
274 | (1) |
|
|
|
275 | (7) |
|
Programmable Counter Array |
|
|
282 | (16) |
|
|
|
284 | (1) |
|
|
|
285 | (2) |
|
|
|
287 | (4) |
|
Sixteen-Bit Software Timer and High Speed Output |
|
|
291 | (4) |
|
Pulse Width Modulation Mode |
|
|
295 | (2) |
|
|
|
297 | (1) |
|
|
|
298 | (16) |
|
|
|
298 | (8) |
|
|
|
306 | (8) |
|
|
|
314 | (1) |
|
|
|
315 | (2) |
|
|
|
317 | (1) |
|
Lab Exercises and Assignments |
|
|
318 | (2) |
|
Analog-to-Digital Converter |
|
|
320 | (34) |
|
|
|
320 | (1) |
|
|
|
320 | (1) |
|
Successive-Approximation Method |
|
|
321 | (1) |
|
Voltage Level Scaling and Shifting |
|
|
322 | (3) |
|
Optimal Voltage Range for the A/D Converter |
|
|
323 | (1) |
|
|
|
323 | (1) |
|
|
|
324 | (1) |
|
The Intel 8XC51GB A/D Converter |
|
|
325 | (3) |
|
Registers Related to the A/D Converter |
|
|
326 | (1) |
|
The Modes of the A/D Converter |
|
|
326 | (1) |
|
A/D Converter Operating Condition |
|
|
327 | (1) |
|
The Procedure for Using the A/D Converter |
|
|
328 | (1) |
|
Measuring the Barometric Pressure |
|
|
329 | (6) |
|
Measuring the Temperature |
|
|
335 | (5) |
|
|
|
340 | (4) |
|
Using the External A/D Converter ADC0820 |
|
|
344 | (6) |
|
Pin Functions of the AD0820 |
|
|
344 | (2) |
|
|
|
346 | (3) |
|
Interfacing the ADC0820 with the 87C51FB |
|
|
349 | (1) |
|
|
|
350 | (1) |
|
|
|
351 | (1) |
|
Lab Exercises and Assignments |
|
|
352 | (2) |
|
Serial Communication Port |
|
|
354 | (35) |
|
|
|
354 | (1) |
|
|
|
354 | (2) |
|
The EIA-232-E (Or RS-232) Standard |
|
|
356 | (10) |
|
EIA-232-E Mechanical Characteristics |
|
|
356 | (1) |
|
Functions of EIA-232-E Interchange Circuits |
|
|
356 | (4) |
|
The EIA-232-E Procedural Characteristics |
|
|
360 | (2) |
|
The EIA-232-E Electrical Characteristics |
|
|
362 | (2) |
|
|
|
364 | (1) |
|
|
|
364 | (1) |
|
Interfacing a Microprocessor with the EIA-232-E Interface |
|
|
365 | (1) |
|
The MCS-51/52 Serial Interface |
|
|
366 | (4) |
|
The Serial Port Control Register SCON |
|
|
366 | (1) |
|
|
|
366 | (1) |
|
|
|
367 | (3) |
|
The Detection of Start Bit and Determination of Bit Values |
|
|
370 | (1) |
|
Multiprocessor Communications |
|
|
370 | (1) |
|
|
|
370 | (7) |
|
X24C44 Serial Nonvolatile Static RAM |
|
|
371 | (1) |
|
|
|
371 | (1) |
|
|
|
371 | (2) |
|
The X24C44 Read and Write Timing |
|
|
373 | (1) |
|
Interfacing the X24C44 with the MCS-51/52 |
|
|
374 | (1) |
|
Programming the X24C44 for Data Transfer |
|
|
375 | (2) |
|
|
|
377 | (6) |
|
Applications of Mode 2 and Mode 3 |
|
|
383 | (1) |
|
The DS87C520 Serial Ports |
|
|
384 | (1) |
|
|
|
384 | (2) |
|
|
|
386 | (1) |
|
Lab Exercises and Assignments |
|
|
387 | (2) |
|
|
|
389 | (52) |
|
|
|
389 | (1) |
|
|
|
389 | (1) |
|
The SEP-Related Registers |
|
|
390 | (1) |
|
|
|
391 | (1) |
|
SEP-Compatible Peripheral Chips |
|
|
391 | (1) |
|
|
|
392 | (5) |
|
Interfacing the 74HC589 with the SEP |
|
|
397 | (5) |
|
|
|
398 | (1) |
|
Circuit Connections of the 74HC589 and the SEP |
|
|
398 | (4) |
|
Interfacing the 74HC595 with the SEP |
|
|
402 | (4) |
|
|
|
402 | (1) |
|
Circuit Connections of the 74HC595 and the SEP |
|
|
403 | (3) |
|
Interfacing with the Seven-Segment Display Driver MC14489 |
|
|
406 | (9) |
|
The Signal Pins of MC14489 |
|
|
406 | (2) |
|
The Operation of the MC14489 |
|
|
408 | (4) |
|
|
|
412 | (3) |
|
|
|
415 | (14) |
|
|
|
415 | (2) |
|
|
|
417 | (1) |
|
|
|
418 | (2) |
|
|
|
420 | (1) |
|
Interfacing X24165 with the MCS-51/52 |
|
|
421 | (8) |
|
Interfacing with A/D Converters with Serial Interface |
|
|
429 | (4) |
|
|
|
429 | (1) |
|
|
|
430 | (1) |
|
Using the ADC1031 to Measure Mass Airflow |
|
|
430 | (3) |
|
D/A Converters with Serial Interface |
|
|
433 | (4) |
|
|
|
433 | (1) |
|
|
|
434 | (1) |
|
Interfacing the AD7303 with MCS-51 and 8XC51GB |
|
|
435 | (2) |
|
|
|
437 | (1) |
|
|
|
438 | (1) |
|
Lab Exercises and Assignments |
|
|
439 | (2) |
| Appendixes |
|
441 | (90) |
|
Appendix A MCS-51 Instruction Execution Times |
|
|
441 | (4) |
|
Appendix B Special Function Registers |
|
|
445 | (2) |
|
Appendix C MCS-51/52 Interrupt Vectors |
|
|
447 | (1) |
|
Appendix D Standard Values of Commercially Available Resistors |
|
|
448 | (1) |
|
Appendix E Vendors of Software and Hardware Development Tools |
|
|
449 | (2) |
|
Appendix F Summary of MCS-51 Variants |
|
|
451 | (7) |
|
Appendix G MCS-51 Instruction Set |
|
|
458 | (33) |
|
Appendix H Dallas DS87C520/DS8C520 Datasheet |
|
|
491 | (40) |
| Glossary |
|
531 | (9) |
| References |
|
540 | (1) |
| Index |
|
541 | |