Single and Multiple-Chip Microcontroller Interfacing teaches the principles of designing and programming microcontrollers that will be used in a wide variety of electronic and mechanical devices, machines and systems. Applications are wide ranging from controlling an automobile to measuring, controlling and displaying your homes temperature. This book utilizes the new Motorola 68HC12 Microcontroller as the primary example throughout. This new microprocessor is the latest development in mid-level 16-bit microcontrollers that will be used world wide due to its low cost and ease of programming. The book features the most popular programming languages C and C++ in describing basic and advanced techniques. The 68HC12 will replace many of the existing 8-bit microprocessors currently used in applications and teaching.
KEY FEATURES
- First book available on the new Motorola 6812 microcontroller
- Thorough discussion of C and C++ programming of I/O ports and synchronization mechanisms
- Concrete discussion of applications of using the popular, readily available, inexpensive and well-designed 6812.
- A CD-ROM with HiWares professional C++ compiler is included with the book
- Many examples and over 200 problems at the end of chapters.
- Separate sections describing object-oriented interfacing
This book is ideal for professional engineers as well as students in university courses in microprocessors/microcontrollers in departments of electrical engineering, computer engineering or computer science. It is also appropriate for advanced technical school courses. The book will also be a valuable professional reference for electrical engineers and mechanical engineers in industry working with the design of electronic and electromechanical devices and systems.
Author(s): G. Jack Lipovski
Series: Academic Press Series in Engineering
Edition: 1
Publisher: Academic Press
Year: 1999
Language: English
Pages: 489
Contents......Page 8
Preface......Page 14
List of Figures......Page 18
List of Tables......Page 22
Acknowledgments......Page 23
About the Author......Page 7
1.1 An Introduction to the Microcomputer......Page 24
1.1.1 Computer Architecture......Page 25
1.1.2 The Instruction......Page 29
1.1.3 Microcomputers......Page 32
1.2.1 6812 Addressing Modes......Page 34
1.2.2 6812 Data Operator Instructions......Page 39
1.2.3 6812 Control Instructions......Page 46
1.3 Assembly-Language Directives......Page 51
1.4.2 6812 Microcontroller I/O and Memory Organization......Page 54
1.4.3 The MC68HC812A4 and MC68HC912B32 Memory Maps......Page 58
1.5 Conclusions......Page 59
1 Problems......Page 61
2 Programming Microcomputers......Page 68
2.1 Introduction to C......Page 69
2.2 Data Structures......Page 78
2.2.1 Indexable Data Structures......Page 80
2.2.2 Sequential Data Structures......Page 82
2.3.1 C Procedures and Their Arguments......Page 89
2.3.2 Programming Style......Page 95
2.3.3 Object-Oriented Programming......Page 96
2.3.5 Optimizing C Programs with Assembly Language......Page 106
2.4 Conclusions......Page 107
2 Problems......Page 109
3 Bus Hardware and Signals......Page 116
3.1.1 Modules and Signals......Page 117
3.1.2 Drivers, Registers, and Memories......Page 120
3.2.1 Address and Control Timing......Page 127
3.2.2 Address and Control Signal Decoding......Page 131
3.3 Conclusions......Page 136
3 Problems......Page 138
4. Parallel and Serial Input/Output......Page 144
4.1 I/O Devices and Ports......Page 145
4.1.1 Generic Port Architecture......Page 146
4.1.2 Generic Port Classes......Page 154
4.1.3 Debugging Tools......Page 158
4.2 6812 Parallel Ports......Page 161
4.2.1 MC68HC812A4 Port Architecture......Page 162
4.2.2 MC68HC912B32 Port Architecture......Page 163
4.2.3 Programming of PORTA......Page 164
4.2.4 A Class for Ports with Direction Control......Page 166
4.3.1 A Wire......Page 169
4.3.2 A Movie......Page 170
4.3.3 A Traffic Light Controller......Page 171
4.3.4 A Sequential Machine......Page 173
4.3.5 An IC Tester......Page 177
4.3.6 Object-oriented Vector Functions and Interpreters......Page 180
4.4.1 Indirect Input/Output......Page 185
4.4.2 LCD Interfacing......Page 188
4.4.3 Synchronous Serial Input/Output......Page 189
4.4.4 The 6812 SPI Module......Page 195
4.4.5 Accessing Devices Using Vectors and structs......Page 198
4.4.6 Indirect and Serial I/O Objects......Page 200
4.5 A Designer's Selection of I/O Ports and Software......Page 204
4.6 Conclusions......Page 206
4 Problems......Page 208
5 Interrupts and Alternatives......Page 216
5.1.1 Real-time Synchronization......Page 219
5.1.2 Gadfly Synchronization......Page 221
5.1.3 Handshaking......Page 223
5.1.4 Some Examples of Programmed I/O......Page 224
5.1.5 Object-oriented Classes for Programmed I/O......Page 227
5.2.1 Steps in an Interrupt......Page 233
5.2.2 Interrupt Handlers and Critical Sections......Page 237
5.2.3 Polled Interrupts......Page 245
5.2.4 Vectored Interrupts......Page 251
5.2.5 Examples of Interrupt Synchronization......Page 254
5.2.6 Object-oriented Classes for Interrupts......Page 260
5.3.1 Real-time Interrupts......Page 267
5.3.2 Multithread Scheduling......Page 268
5.3.3 Threads for Time-sharing......Page 271
5.3.4 An Efficient Time Schedular......Page 275
5.3.5 Special Instructions for Time-sharing......Page 279
5.3.6 Object-oriented Classes for Time-sharing......Page 280
5.4 Fast Synchronization Mechanisms......Page 281
5.4.1 Direct Memory Access......Page 282
5.4.2 Context Switching......Page 283
5.4.3 Memory Buffer Synchronization......Page 285
5.5 Conclusions......Page 289
5 Problems......Page 292
6.1.1 MODE Control Port......Page 300
6.1.2 Port E Assignment......Page 302
6.2.1 Internal Memory Map Control......Page 303
6.2.2 MC68HC812A4 Chip Selects......Page 304
6.2.3 MC68HC812A4 Memory Expansion......Page 307
6.2.4 Object-oriented Programming of Memory Expansion......Page 308
6.3 EEPROM and Flash Memory Programming......Page 309
6.4 MC68HC812A4 Timing Control......Page 312
6.5 An External Memory for the MC68HC812A4......Page 313
6.6 The 6812 Background Debug Module......Page 318
6.7 6812 Reset Handler......Page 322
6.8 Conclusions......Page 324
6 Problems......Page 325
7 Analog Interfacing......Page 330
7.1.1 Positional Transducers......Page 332
7.1.2 Radiant Energy Transducers......Page 334
7.1.3 Other Transducers......Page 336
7.2.1 Transistors and Silicon Controlled Rectifiers......Page 337
7.2.2 Basic Linear Integrated Circuits......Page 340
7.2.3 Practical Linear Integrated Circuits......Page 344
7.3 OP AMP and Analog Switch Signal Conditioning......Page 349
7.3.1 Filters......Page 350
7.3.2 Selection of Inputs and Control of Gain......Page 352
7.3.3 Nonlinear Amplification......Page 355
7.4.1 Digital-to-Analog Converters......Page 357
7.4.2 Analog-to-Digital Converters......Page 361
7.4.3 Voltage Conversion to or from Frequency......Page 363
7.5 Data Acquisition Systems......Page 367
7.5.1 Basic Operation of a Data Acquisition System......Page 368
7.5.2 The MC145040 A-to-D Converter......Page 369
7.5.3 The MC68HC812A4 A-to-D Converter......Page 370
7.5.4 Object-oriented Programming of Converters......Page 372
7.5.5 Applications in Control Systems......Page 373
7.6 Conclusions......Page 375
7 Problems......Page 377
8 Counters and Timers......Page 384
8.1 The MC68HC812A4 Counter/Timer Subsystem......Page 385
8.2 Signal Generation......Page 386
8.2.1 Output Compare Logic......Page 387
8.2.2 The Counter/Timer Square-Wave Generator......Page 388
8.2.3 The MC68HC912B32 PWM Signal Generator......Page 389
8.2.4 A Touch-tone Signal Generator......Page 392
8.2.5 The Pulse Generator......Page 396
8.2.6 A Rotary Dialer......Page 397
8.2.7 Real-Time Clock and Trace Mechanism......Page 398
8.2.8 Output Compare 7......Page 399
8.2.9 Object-oriented Square-wave and Pulse Generation......Page 401
8.3.1 The Input Capture Mechanism and Period Measurement......Page 404
8.3.2 Pulse-width Measurement......Page 406
8.3.4 Pulse Accumulation and Frequency Measurement......Page 408
8.3.5 Object-oriented Period, Pulse-width, and Frequency Measurements......Page 410
8.4 Conclusions......Page 411
8 Problems......Page 413
9. Communications Systems......Page 420
9.1 Communications Principles......Page 421
9.2.1 Voltage and Current Linkages......Page 424
9.2.2 Frequency Shift-Keyed Links Using Modems......Page 428
9.2.3 Infrared Links......Page 430
9.3.1 UART Transmission and Reception by Software......Page 431
9.3.2 The UART......Page 434
9.3.3 The ACIA......Page 437
9.3.4 The M14469......Page 440
9.3.5 The Serial Communication Interface System in the 6812......Page 443
9.3.6 Object-oriented Interfacing to the SCI......Page 446
9.4.1 Synchronous Bit-oriented Protocols......Page 450
9.4.2 MC68HC912B32 BDLC Device......Page 453
9.4.3 IEEE-488 Bus Standard......Page 455
9.4.4 The Small Computer System Interface (SCSI)......Page 458
9.5 Conclusions......Page 459
9 Problems......Page 461
10. Display and Storage Systems......Page 468
10.1.1 NTSC Television Signals......Page 469
10.1.2 A 6812 SPI Display......Page 471
10.1.3 A Bitmapped Display......Page 473
10.1.4 An Object-oriented Display......Page 476
10.2.1 Floppy Disk Format......Page 478
10.2.2. The Western Digital 37C65C Floppy Disk Controller......Page 482
10.2.3. Floppy Disk Interfacing Procedures......Page 485
10.2.4 Personal Computer Disk Data Organization......Page 489
10.2.5 Object-oriented Disk I/O......Page 493
10.3 Conclusions......Page 496
Problems......Page 498
Appendix. Using the HIWAVE CD-ROM......Page 504
C......Page 506
D......Page 507
I......Page 508
N......Page 509
P......Page 510
S......Page 511
Z......Page 512