PIC Microcontrollers are present in almost every new electronic application that is released from garage door openers to the iPhone. With the proliferation of this product more and more engineers and engineers-to-be (students) need to understand how to design, develop, and build with them. Martin Bates, best-selling author, has provided a step-by-step guide to programming these microcontrollers (MCUs) with the C programming language. With no previous knowledge of C necessary to read this book, it is the perfect for entry into this world for engineers who have not worked with PICs, new professionals, students, and hobbyists. As MCUs become more complex C is the most popular language due to its ability to process advanced processes and multitasking. RTOSs, that is a need to know for engineers, is also discussed as more advanced MCUs require timing and organization of programming and implementation of multitasking. The book includes lots of source code, circuit schematics, and hardware block diagrams. Microchip's PICDEM Mechatronics board is used to detail the examples throughout the book. *Focuses on the C programming language which is by far the most popular for microcontrollers (MCUs)*Features Proteus VSMg the most complete microcontroller simulator on the market, along with CCS PCM C compiler, both are highly compatible with Microchip tools*Extensive downloadable content including fully worked examples
Author(s): Martin P. Bates
Edition: 1
Publisher: Newnes
Year: 2008
Language: English
Pages: 304
Tags: Библиотека;Компьютерная литература;Микроконтроллеры;PIC;
Cover Page......Page 1
Foreword......Page 2
Preface......Page 4
Links, Resources, and Acknowledgments......Page 6
About the Author......Page 7
Introduction......Page 8
1.1 PIC16 Microcontrollers......Page 11
1.2 PIC16 MCU Configuration......Page 18
1.3 PIC16 MCU Peripherals......Page 22
1.4 PIC16 Serial Interfaces......Page 28
1.5 PIC16 MPLAB Projects......Page 32
1.6 PIC16 Program and Debug......Page 36
Assignments 1......Page 42
2.1 PIC16 C Getting Started......Page 44
2.2 PIC16 C Program Basics......Page 49
2.3 PIC16 C Data Operations......Page 56
2.4 PIC16 C Sequence Control......Page 65
2.5 PIC16 C Functions and Structure......Page 69
2.6 PIC16 C Input and Output......Page 73
2.7 PIC16 C More Data Types......Page 82
2.8 PIC16 C Compiler Directives......Page 86
2.9 PIC16 C Assembler Routines......Page 95
Assignments 2......Page 105
3.1 PIC16 C Analog Input......Page 107
3.2 PIC16 C Interrupts......Page 112
3.3 PIC16 C Hardware Timers......Page 116
3.4 PIC16 C UART Serial Link......Page 121
3.5 PIC16 C SPI Serial Bus......Page 124
3.6 PIC16 C I2C Serial Bus......Page 126
3.7 PIC16 C Parallel and Serial Interfaces......Page 129
3.8 PIC16 C EEPROM Interface......Page 134
3.9 PIC16 C Analog Output......Page 135
Assignments 3......Page 142
4.1 PICDEM Mechatronics Board Overview......Page 144
4.2 PICDEM Liquid Crystal Display......Page 153
4.3 PICDEM DC Motor Test Programs......Page 159
4.4 PICDEM Stepper Motor Control......Page 163
4.5 PICDEM Analog Sensors......Page 169
4.6 PICDEM Temperature Controller......Page 173
4.7 PICDEM Board Simulation......Page 178
5.1 PIC16 C Application Design......Page 185
5.2 PIC16 C Temperature Controller......Page 188
5.3 PIC16 C Data Logger System......Page 190
5.4 PIC16 C Operating Systems......Page 195
5.5 PIC16 C System Design......Page 201
Assignments 5......Page 207
Design Specification......Page 208
Schematic Circuit......Page 209
Schematic Edit......Page 210
Appendix B: Software Design Using CCS C......Page 213
BAR1 Source Code......Page 215
PIC Registers......Page 216
BAR1 List File......Page 219
Program Debugging......Page 224
Typical Errors......Page 227
Appendix D: C Compiler Comparison......Page 230
Hi-Tech PIC C......Page 233
Matrix C......Page 237
Summary of C Compilers......Page 239
Punctuation......Page 242
Relational Operators......Page 243
Arithmetic and Logic Operators......Page 244
Appendix F: CCS C Program Function Reference......Page 245
Assessment 1......Page 258
Assessment 2......Page 260
Assessment 3......Page 263
Assessment 4......Page 265
Assessment 5......Page 268
C......Page 271
D......Page 272
I......Page 273
O......Page 274
P......Page 275
T......Page 277
X......Page 278