Programming 8-bit PIC Microcontrollers in C -  Martin P. Bates

Programming 8-bit PIC Microcontrollers in C (eBook)

with Interactive Hardware Simulation
eBook Download: PDF | EPUB
2008 | 1. Auflage
304 Seiten
Elsevier Science (Verlag)
978-0-08-056014-4 (ISBN)
Systemvoraussetzungen
Systemvoraussetzungen
35,95 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Microcontrollers are present in many new and existing electronic products, and the PIC microcontroller is a leading processor in the embedded applications market. Students and development engineers need to be able to design new products using microcontrollers, and this book explains from first principles how to use the universal development language C to create new PIC based systems, as well as the associated hardware interfacing principles.

The book includes many source code listings, circuit schematics and hardware block diagrams. It describes the internal hardware of 8-bit PIC microcontroller, outlines the development systems available to write and test C programs, and shows how to use CCS C to create PIC firmware. In addition, simple interfacing principles are explained, a demonstration program for the PIC mechatronics development board provided and some typical applications outlined.

*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

Martin Bates is one of the leading authors specializing in introductory level texts on PIC microcontrollers for the academic, professional and hobby markets, with 20 years' experience of teaching microprocessor systems.
Microcontrollers are present in many new and existing electronic products, and the PIC microcontroller is a leading processor in the embedded applications market. Students and development engineers need to be able to design new products using microcontrollers, and this book explains from first principles how to use the universal development language C to create new PIC based systems, as well as the associated hardware interfacing principles. The book includes many source code listings, circuit schematics and hardware block diagrams. It describes the internal hardware of 8-bit PIC microcontroller, outlines the development systems available to write and test C programs, and shows how to use CCS C to create PIC firmware. In addition, simple interfacing principles are explained, a demonstration program for the PIC mechatronics development board provided and some typical applications outlined. 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

Front Cover 1
Programming 8-bit PIC Microcontrollers in C: with Interactive Hardware Simulation 4
Copyright Page 5
Contents 6
Foreword 12
Preface 14
Introduction 18
Part 1 PIC Microcontroller Systems 22
1.1 PIC16 Microcontrollers 22
MCU Features 24
Program Execution 24
RAM File Registers 28
Other PIC Chips 28
1.2 PIC16 MCU Configuration 29
Clock Options 30
Configuration Options 30
Configuration in C 32
1.3 PIC16 MCU Peripherals 33
Timers 34
A/D Converter 36
Comparator 36
Parallel Slave Port 37
Interrupts 37
1.4 PIC16 Serial Interfaces 39
USART 40
SPI Bus 42
I[sup(2)]C Bus 42
1.5 PIC16 MPLAB Projects 43
MPLAB C Project 44
Project Files 46
1.6 PIC16 Program and Debug 47
Programming 48
Debugging 50
Design Package 51
Assessment 1 52
Assignments 1 53
Part 2 C Programming Essentials 56
2.1 PIC16 C Getting Started 56
Simple Program 56
Program Creation 57
Program Testing 58
Program Analysis 59
2.2 PIC16 C Program Basics 61
Variables 61
Looping 62
Decision Making 63
Loop Control 63
FOR Loop 66
SIREN Program 66
Blank Program 68
2.3 PIC16 C Data Operations 68
Variable Types 68
Assignment Operations 73
Conditional Operations 75
2.4 PIC16 C Sequence Control 77
While Loops 77
Break, Continue, and Goto 78
If..Else and Switch..Case 80
2.5 PIC16 C Functions and Structure 81
Basic Functions 83
Global and Local Variables 84
2.6 PIC16 C Input and Output 85
Serial LCD 86
Keypad and Calculator 89
2.7 PIC16 C More Data Types 94
Arrays 95
Indirect Addressing Operators 96
Enumeration 98
2.8 PIC16 C Compiler Directives 98
Program Directives 99
Header File 99
2.9 PIC16 C Assembler Routines 107
Program Compilation 108
Assembler Block 109
PIC Assembly Language 113
Assessment 2 115
Assignments 2 117
Part 3 C Peripheral Interfaces 120
3.1 PIC16 C Analog Input 120
Analog Setup 120
Voltage Measurement 121
3.2 PIC16 C Interrupts 125
C Interrupts 125
Interrupt Example 127
Interrupt Statements 128
3.3 PIC16 C Hardware Timers 129
Counter/Timer Operation 129
PWM Mode 130
Compare Mode 132
Capture Mode 132
3.4 PIC16 C UART Serial Link 134
3.5 PIC16 C SPI Serial Bus 137
3.6 PIC16 C I[sup(2)]C Serial Bus 139
3.7 PIC16 C Parallel and Serial Interfaces 142
Parallel Slave Port 142
Comparison of Communication Links 144
3.8 PIC16 C EEPROM Interface 147
3.9 PIC16 C Analog Output 148
Assessment 3 153
Assignments 3 155
Part 4 C Mechatronics Applications 158
4.1 PICDEM Mechatronics Board Overview 158
PICDEM Hardware 158
Motor Drives 159
Test Program 164
Debugging 166
4.2 PICDEM Liquid Crystal Display 167
LCD Connections 167
LCD Test Program 170
BCD Count Program 173
4.3 PICDEM DC Motor Test Programs 173
Basic Control 173
Rev Counter 175
4.4 PICDEM Stepper Motor Control 177
Construction 178
Stepper Motor Test 179
Direction Control 179
4.5 PICDEM Analog Sensors 183
Light Sensor 183
Temperature Measurement 184
4.6 PICDEM Temperature Controller 187
Specification 187
I/O Allocation 189
Implementation 189
4.7 PICDEM Board Simulation 192
Circuit Description 194
Demo Applications 196
Assessment 4 196
Assignments 4 198
Part 5 PIC16 C Applications and Systems 200
5.1 PIC16 C Application Design 200
Hardware Design 200
Software Design 201
Application Debugging and Testing 201
5.2 PIC16 C Temperature Controller 203
System Operation 203
Software Design and Implementation 204
5.3 PIC16 C Data Logger System 205
BASE Board 207
Program Outline 210
5.4 PIC16 C Operating Systems 210
Polled I/O 210
Interrupts 211
PC Operating System 212
Real-Time Operating System 213
5.5 PIC16 C System Design 216
Hardware Selection 216
Microcontrollers 217
Hardware Design 218
Software Design 220
Assessment 5 221
Assignments 5 222
Appendix A: Hardware Design Using ISIS Schematic Capture 224
Design Specification 224
Schematic Circuit 225
Schematic Edit 226
Appendix B: Software Design Using CCS C 230
BAR1 Source Code 232
PIC Registers 233
BAR1 List File 236
Appendix C: System Testing Using Proteus VSM 242
Attaching the Program 242
Program Debugging 242
Typical Errors 245
Appendix D: C Compiler Comparison 248
Microchip C18 249
Hi-Tech PIC C 251
Mikro C 255
Matrix C 255
Summary of C Compilers 257
Appendix E: CCS C Programming Syntax Summary 260
Compiler Directives 260
Program Blocks 260
Punctuation 260
Basic I/O Functions 261
Appendix F: CCS C Programming Function Reference 264
Answers 278
Index 292
A 292
B 292
C 292
D 293
E 294
F 294
G 294
H 294
I 294
K 295
L 295
M 295
N 295
O 295
P 296
R 298
S 298
T 298
U 299
V 299
W 299
X 299

Erscheint lt. Verlag 22.8.2008
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Technik Elektrotechnik / Energietechnik
ISBN-10 0-08-056014-8 / 0080560148
ISBN-13 978-0-08-056014-4 / 9780080560144
Haben Sie eine Frage zum Produkt?
PDFPDF (Adobe DRM)
Größe: 2,5 MB

Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine Adobe-ID und die Software Adobe Digital Editions (kostenlos). Von der Benutzung der OverDrive Media Console raten wir Ihnen ab. Erfahrungsgemäß treten hier gehäuft Probleme mit dem Adobe DRM auf.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine Adobe-ID sowie eine kostenlose App.
Geräteliste und zusätzliche Hinweise

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

EPUBEPUB (Adobe DRM)
Größe: 14,7 MB

Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM

Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belle­tristik und Sach­büchern. Der Fließ­text wird dynamisch an die Display- und Schrift­größe ange­passt. Auch für mobile Lese­geräte ist EPUB daher gut geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine Adobe-ID und die Software Adobe Digital Editions (kostenlos). Von der Benutzung der OverDrive Media Console raten wir Ihnen ab. Erfahrungsgemäß treten hier gehäuft Probleme mit dem Adobe DRM auf.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine Adobe-ID sowie eine kostenlose App.
Geräteliste und zusätzliche Hinweise

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Das umfassende Handbuch

von Johannes Ernesti; Peter Kaiser

eBook Download (2023)
Rheinwerk Computing (Verlag)
44,90
Das Handbuch für Webentwickler

von Philip Ackermann

eBook Download (2023)
Rheinwerk Computing (Verlag)
49,90
Mit über 150 Workouts in Java und Python

von Luigi Lo Iacono; Stephan Wiefling; Michael Schneider

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
29,99