Summary of Programming 8-bit PIC Microcontrollers in C By Martin Bates E-book
This book by Martin Bates serves as a comprehensive guide for engineers and students to design, develop, and program PIC microcontrollers using the C language. It covers essential topics from basic syntax and peripherals to advanced concepts like Real-Time Operating Systems (RTOS). The text utilizes Microchip's PICDEM Mechatronics board for practical examples and integrates Proteus VSMg simulation with CCS PCM C compiler tools. Extensive source code, schematics, and downloadable content support hands-on learning for building complex electronic applications.
Parts used in the PIC Microcontroller Programming Project:
- PIC16 Microcontrollers
- PICDEM Mechatronics Board
- Proteus VSMg Simulator
- CCS PCM C Compiler
- MPLAB Development Environment
- Seriel LCD
- Keypad and Calculator Interface
- DC Motor Drives
- Stepper Motors
- Analog Sensors (Light and Temperature)
Book Introduction:
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.
Audience: Professional
Format: Paperback
Language: English
Number Of Pages: 300
Published: 22nd August 2008
Publisher: Elsevier Science & Technology
Dimensions (cm): 23.1 x 19.2 x 2.4
Weight (kg): 0.639
Table of Contents:
| Foreword | p. xi |
| Preface | p. xiii |
| Introduction | p. xvii |
| PIC Microcontroller Systems | p. 1 |
| PIC16 Microcontrollers | p. 1 |
| MCU Features | p. 3 |
| Program Execution | p. 3 |
| RAM File Registers | p. 7 |
| Other PIC Chips | p. 7 |
| PIC16 MCU Configuration | p. 8 |
| Clock Options | p. 9 |
| Configuration Options | p. 9 |
| Configuration in C | p. 11 |
| PIC16 MCU Peripherals | p. 12 |
| Timers | p. 13 |
| A/D Converter | p. 15 |
| Comparator | p. 15 |
| Parallel Slave Port | p. 16 |
| Interrupts | p. 16 |
| PIC16 Serial Interfaces | p. 18 |
| USART | p. 19 |
| SPI Bus | p. 21 |
| I[superscript 2]C Bus | p. 21 |
| PIC16 MPLAB Projects | p. 22 |
| MPLAB C Project | p. 23 |
| Project Files | p. 25 |
| PIC16 Program and Debug | p. 26 |
| Programming | p. 27 |
| Debugging | p. 29 |
| Design Package | p. 30 |
| Assessment 1 | p. 31 |
| Assignments 1 | p. 32 |
| C Programming Essentials | p. 35 |
| PIC16 C Getting Started | p. 35 |
| Simple Program | p. 35 |
| Program Creation | p. 36 |
| Program Testing | p. 37 |
| Program Analysis | p. 38 |
| PIC16 C Program Basics | p. 40 |
| Variables | p. 40 |
| Looping | p. 41 |
| Decision Making | p. 42 |
| Loop Control | p. 42 |
| FOR Loop | p. 45 |
| SIREN Program | p. 45 |
| Blank Program | p. 47 |
| PIC16 C Data Operations | p. 47 |
| Variable Types | p. 47 |
| Assignment Operations | p. 52 |
| Conditional Operations | p. 54 |
| PIC16 C Sequence Control | p. 56 |
| While Loops | p. 56 |
| Break, Continue, and Goto | p. 57 |
| If..Else and Switch..Case | p. 59 |
| PIC16 C Functions and Structure | p. 60 |
| Basic Functions | p. 62 |
| Global and Local Variables | p. 63 |
| PIC16 C Input and Output | p. 64 |
| Serial LCD | p. 65 |
| Keypad and Calculator | p. 68 |
| PIC16 C More Data Types | p. 73 |
| Arrays | p. 74 |
| Indirect Addressing Operators | p. 75 |
| Enumeration | p. 77 |
| PIC16 C Compiler Directives | p. 77 |
| Program Directives | p. 78 |
| Header File | p. 78 |
| PIC16 C Assembler Routines | p. 86 |
| Program Compilation | p. 87 |
| Assembler Block | p. 88 |
| PIC Assembly Language | p. 92 |
| Assessment 2 | p. 94 |
| Assignments 2 | p. 96 |
| C Peripheral Interfaces | p. 99 |
| PIC16 C Analog Input | p. 99 |
| Analog Setup | p. 99 |
| Voltage Measurement | p. 100 |
| PIC16 C Interrupts | p. 104 |
| C Interrupts | p. 104 |
| Interrupt Example | p. 106 |
| Interrupt Statements | p. 107 |
| PIC16 C Hardware Timers | p. 108 |
| Counter/Timer Operation | p. 108 |
| PWM Mode | p. 109 |
| Compare Mode | p. 111 |
| Capture Mode | p. 111 |
| PIC16 C UART Serial Link | p. 113 |
| PIC16 C SPI Serial Bus | p. 116 |
| PIC16 C I[superscript 2]C Serial Bus | p. 118 |
| PIC16 C Parallel and Serial Interfaces | p. 121 |
| Parallel Slave Port | p. 121 |
| Comparison of Communication Links | p. 123 |
| PIC16 C EEPROM Interface | p. 126 |
| PIC16 C Analog Output | p. 127 |
| Assessment 3 | p. 132 |
| Assignments 3 | p. 134 |
| C Mechatronics Applications | p. 137 |
| PICDEM Mechatronics Board Overview | p. 137 |
| PICDEM Hardware | p. 137 |
| Motor Drives | p. 138 |
| Test Program | p. 143 |
| Debugging | p. 145 |
| PICDEM Liquid Crystal Display | p. 146 |
| LCD Connections | p. 146 |
| LCD Test Program | p. 149 |
| BCD Count Program | p. 152 |
| PICDEM DC Motor Test Programs | p. 152 |
| Basic Control | p. 152 |
| Rev Counter | p. 154 |
| PICDEM Stepper Motor Control | p. 156 |
| Construction | p. 157 |
| Stepper Motor Test | p. 158 |
| Direction Control | p. 158 |
| PICDEM Analog Sensors | p. 162 |
| Light Sensor | p. 162 |
| Temperature Measurement | p. 163 |
| PICDEM Temperature Controller | p. 166 |
| Specification | p. 166 |
| I/O Allocation | p. 168 |
| Implementation | p. 168 |
| PICDEM Board Simulation | p. 171 |
| Circuit Description | p. 173 |
| Demo Applications | p. 175 |
| Assessment 4 | p. 175 |
| Assignments 4 | p. 177 |
| PIC16 C Applications and Systems | p. 179 |
| PIC16 C Application Design | p. 179 |
| Hardware Design | p. 179 |
| Software Design | p. 180 |
| Application Debugging and Testing | p. 180 |
| PIC16 C Temperature Controller | p. 182 |
| System Operation | p. 182 |
| Software Design and Implementation | p. 183 |
| PIC16 C Data Logger System | p. 184 |
| BASE Board | p. 186 |
| Program Outline | p. 189 |
| PIC16 C Operating Systems | p. 189 |
| Polled I/O | p. 189 |
| Interrupts | p. 190 |
| PC Operating System | p. 191 |
| Real-Time Operating System | p. 192 |
| PIC16 C System Design | p. 195 |
| Hardware Selection | p. 195 |
| Microcontrollers | p. 196 |
| Hardware Design | p. 197 |
| Software Design | p. 199 |
| Assessment 5 | p. 200 |
| Assignments 5 | p. 201 |
| Hardware Design Using ISIS Schematic Capture | p. 203 |
| Design Specification | p. 203 |
| Schematic Circuit | p. 204 |
| Schematic Edit | p. 205 |
| Software Design Using CCS C | p. 209 |
| BAR1 Source Code | p. 211 |
| PIC Registers | p. 212 |
| BAR1 List File | p. 215 |
| System Testing Using Proteus VSM | p. 221 |
| Attaching the Program | p. 221 |
| Program Debugging | p. 221 |
| Typical Errors | p. 224 |
| C Compiler Comparison | p. 227 |
| Microchip C18 | p. 228 |
| Hi-Tech PIC C | p. 230 |
| Mikro C | p. 234 |
| Matrix C | p. 234 |
| Summary of C Compilers | p. 236 |
| CCS C Programming Syntax Summary | p. 239 |
| Compiler Directives | p. 239 |
| Program Blocks | p. 239 |
| Punctuation | p. 239 |
| Basic I/O Functions | p. 240 |
| CCS C Programming Function Reference | p. 243 |
| Answers | p. 257 |
| Index | p. 271 |
| Table of Contents provided by Ingram. All Rights Reserved. |
Link to Purchase E-Book:
Programming 8-bit PIC Microcontrollers in C By Martin Bates E-book
- Is previous knowledge of C necessary to read this book?
No, the book is designed for readers with no previous knowledge of C. - Which simulator is featured as the most complete on the market?
The book features Proteus VSMg as the most complete microcontroller simulator available. - What hardware board is used to detail the examples throughout the book?
Microchip's PICDEM Mechatronics board is used to illustrate the examples. - Why is the C programming language considered the most popular for MCUs?
C is popular because it can process advanced processes and multitasking effectively. - Does the book cover Real-Time Operating Systems (RTOS)?
Yes, the book discusses RTOSs as they are needed for timing and organization in advanced MCUs. - What specific C compiler is highly compatible with Microchip tools in this project?
The CCS PCM C compiler is highlighted for its high compatibility with Microchip tools. - Are there downloadable resources included with the book?
Yes, the book includes extensive downloadable content featuring fully worked examples. - Can the book be used by hobbyists and new professionals?
Yes, it is perfect for new professionals, students, and hobbyists entering the field. - What types of motor drives are covered in the mechatronics section?
The text covers DC Motor Drives and Stepper Motor Control. - Which communication interfaces are discussed in the peripheral section?
The book discusses USART, SPI Bus, I2C Bus, and Parallel Slave Port.
