Di Jasio | Programming 16-Bit PIC Microcontrollers in C | E-Book | sack.de
E-Book

E-Book, Englisch, 416 Seiten

Di Jasio Programming 16-Bit PIC Microcontrollers in C

Learning to Fly the PIC 24
2. Auflage 2011
ISBN: 978-1-85617-871-6
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: Adobe DRM (»Systemvoraussetzungen)

Learning to Fly the PIC 24

E-Book, Englisch, 416 Seiten

ISBN: 978-1-85617-871-6
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: Adobe DRM (»Systemvoraussetzungen)



New in the second edition: - MPLAB X support and MPLAB C for the PIC24F v3 and later libraries - I2C? interface - 100% assembly free solutions - Improved video, PAL/NTSC - Improved audio, RIFF files decoding - PIC24F GA1, GA2, GB1 and GB2 support Most readers will associate Microchip's name with the ubiquitous 8-bit PIC microcontrollers but it is the new 16-bit PIC24F family that is truly stealing the scene. Orders of magnitude increases of performance, memory size and the rich peripheral set make programming these devices in C a must. This new guide by Microchip insider Lucio Di Jasio teaches readers everything they need to know about the architecture of these new chips: How to program them, how to test them, and how to debug them. Di Jasio's common-sense, practical, hands-on approach starts out with basic functions and guides the reader step-by-step through even the most sophisticated programming scenarios. Experienced PIC users, including embedded engineers, programmers, designers, and SW and HW engineers, and new comers alike will benefit from the text's many thorough examples, which demonstrate how to nimbly sidestep common obstacles and take full advantage of the many new features. ! - A Microchip insider introduces you to 16-bit PIC programming the easy way! - Condenses typical introductory 'fluff' focusing instead on examples and exercises that show how to solve common, real-world design problems quickly - Includes handy checklists to help readers perform the most common programming and debugging tasks

Lucio Di Jasio is now Sales Manager in Europe for Microchip Inc. He was previously Application Segments Manager at Microchip in Chandler AZ. He has been intimately involved in the development of Microchip PIC products for over 10 years and is a well known writer and expert on the use of PIC products both via his Newnes books and his work at events such as the Microchip Masters.

Di Jasio Programming 16-Bit PIC Microcontrollers in C jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


1;Front Cover;1
2;Programming 16-Bit PIC Microcontrollers in C;4
3;Copyright Page;5
4;Contents;8
5;Preface;16
6;Introduction to the Second Edition;18
7;Introduction;20
7.1;Who Should Read this Book?;20
7.2;Structure of the Book;21
7.3;What This Book Is Not;22
7.4;Checklists;23
8;I: First Flights;28
8.1;1: The First Flight;30
8.1.1;Flight Plan;30
8.1.2;Preflight Checklist;31
8.1.3;The Flight;31
8.1.3.1;Compiling and Linking;34
8.1.3.2;Debugging the First Project;36
8.1.3.3;Port Initialization;38
8.1.3.4;Re-Testing PortA;39
8.1.3.5;Configuring the PIC24;40
8.1.3.6;Testing PortB;42
8.1.3.7;Analog vs Digital Pin Control;44
8.1.4;Post-Flight Briefing;46
8.1.5;Notes for the Assembly Experts;46
8.1.6;Notes for the PIC Microcontroller Experts;48
8.1.7;Notes for the C Experts;48
8.1.8;Tips & Tricks;48
8.1.9;Exercises;49
8.1.10;Books;49
8.1.11;Links;49
8.2;2: A Loop in the Pattern;50
8.2.1;Flight Plan;50
8.2.2;Preflight Checklist;50
8.2.3;The Flight;51
8.2.3.1;While Loops;53
8.2.3.2;Animation;56
8.2.3.3;Not So Fast, Please!;57
8.2.4;Post-Flight Briefing;60
8.2.5;Notes for the Assembly Experts;60
8.2.6;Notes for the PIC® Microcontroller Experts;61
8.2.7;Notes for the C Experts;61
8.2.8;Tips & Tricks;61
8.2.9;Exercises;61
8.2.10;Books;62
8.2.11;Links;62
8.3;3: More Pattern Work, More Loops;64
8.3.1;Flight Plan;64
8.3.2;Preflight Checklist;64
8.3.3;The Flight;65
8.3.3.1;do Loops;65
8.3.3.2;Variable Declarations;66
8.3.3.3;for Loops;67
8.3.3.4;More Loop Examples;68
8.3.3.5;Arrays;68
8.3.3.6;Sending a Message;69
8.3.4;Post-Flight Briefing;72
8.3.5;Notes for the Assembly Experts;72
8.3.6;Notes for the PIC® Microcontroller Experts;73
8.3.7;Notes for the C Experts;73
8.3.8;Tips & Tricks;73
8.3.9;Notes for PIC24 GA1 and GB1 Users;73
8.3.10;Exercises;78
8.3.11;Books;78
8.3.12;Links;78
8.4;4: Numb3rs;80
8.4.1;Flight Plan;80
8.4.2;Preflight Checklist;81
8.4.3;The Flight;81
8.4.3.1;Going Long;83
8.4.3.2;Long Long Multiplications;84
8.4.3.3;Floating Point;85
8.4.3.4;Notes for the C Experts;85
8.4.3.5;Measuring Performance;87
8.4.4;Post-Flight Briefing;89
8.4.5;Notes for the Assembly Experts;89
8.4.6;Notes for the PIC® Microcontroller Experts;91
8.4.7;Tips & Tricks;91
8.4.7.1;Math Libraries;91
8.4.7.2;Complex Data Types;91
8.4.8;Exercises;92
8.4.9;Books;92
8.4.10;Links;92
8.5;5: Interrupts;94
8.5.1;Flight Plan;94
8.5.2;Preflight Checklist;94
8.5.3;The Flight;95
8.5.3.1;Nesting of Interrupts;98
8.5.3.2;Traps;99
8.5.3.3;Trap Vector Details;99
8.5.3.4;A Template and an Example for a Timer1 Interrupt;99
8.5.3.5;A Real Example with Timer1;101
8.5.3.6;Testing the Timer1 Interrupt;103
8.5.3.7;The Secondary Oscillator;105
8.5.3.8;The Real-Time Clock Calendar (RTCC);107
8.5.3.9;Managing Multiple Interrupts;108
8.5.4;Post-Flight Briefing;109
8.5.5;Notes for the C Experts;109
8.5.6;Notes for the Assembly Experts;109
8.5.7;Notes for the PIC Microcontroller Experts;110
8.5.8;Tips & Tricks;111
8.5.9;Exercises;112
8.5.10;Books;112
8.5.11;Links;113
8.6;6: Taking a Look Under the Hood;114
8.6.1;Flight Plan;114
8.6.2;Preflight Checklist;114
8.6.3;The Flight;114
8.6.3.1;Memory Space Allocation;116
8.6.3.2;Program Space Visibility;117
8.6.3.3;Investigating Memory Allocation;119
8.6.3.4;Looking at the Map;121
8.6.3.5;Pointers;124
8.6.3.6;The Heap;125
8.6.3.7;MPLAB C Memory Models;126
8.6.3.8;Post-Flight Briefing;127
8.6.3.9;Notes for the C Experts;127
8.6.3.10;Notes for the Assembly Experts;127
8.6.3.11;Notes for the PIC Microcontroller Experts;127
8.6.3.12;Tips & Tricks;128
8.6.4;Exercises;128
8.6.5;Books;129
8.6.6;Links;129
9;II: Flying “Solo”;130
9.1;7: Synchronous Communication;132
9.1.1;Flight Plan;132
9.1.2;Preflight Checklist;132
9.1.3;The Flight;132
9.1.3.1;Synchronous Serial Interfaces;133
9.1.3.2;Asynchronous Serial Interfaces;134
9.1.3.3;Synchronous Communication Using the SPI Modules;136
9.1.3.4;Testing the Read Status Register Command;139
9.1.3.5;Writing to the EEPROM;141
9.1.3.6;Reading the Memory Contents;142
9.1.3.7;A Non-Volatile Storage Library;142
9.1.3.8;Testing the New SEE Library Module;145
9.1.3.9;The I2C Interface;147
9.1.3.10;I2C Data Transfer Rules;149
9.1.3.11;I2C Serial EEPROMs;150
9.1.3.12;Talking to I2C Serial EEPROMs;151
9.1.3.13;Forming Commands;152
9.1.3.14;The SEE Grammar;153
9.1.3.15;Reading and Writing 16-Bit Values;154
9.1.3.16;The iWriteSEE() Function;157
9.1.3.17;The iReadSEE() Function;159
9.1.3.18;The Big I2C SEE Table;161
9.1.4;Post-Flight Briefing;163
9.1.5;Notes for the C Experts;163
9.1.6;Notes for the Experts;164
9.1.7;Notes for the PIC Microcontroller Experts;164
9.1.8;Tips & Tricks;165
9.1.9;Exercises;165
9.1.10;Books;166
9.1.11;Links;166
9.2;8: Asynchronous Communication;168
9.2.1;Flight Plan;168
9.2.2;Preflight Checklist;168
9.2.3;The Flight;169
9.2.3.1;UART Configuration;170
9.2.3.2;Sending and Receiving Data;172
9.2.3.3;Testing the Serial Communication Routines;173
9.2.3.4;Building a Simple Console Library;175
9.2.3.5;Testing a VT100 Terminal;177
9.2.3.6;Using the Serial Port as a Debugging Tool;179
9.2.3.7;The Matrix;179
9.2.4;Post-Flight Briefing;181
9.2.5;Notes for the C Experts;181
9.2.6;Notes for the PIC® Microcontroller Experts;182
9.2.7;Tips & Tricks;183
9.2.8;Exercises;183
9.2.9;Books;183
9.2.10;Links;184
9.3;9: Glass = Bliss;186
9.3.1;Flight Plan;186
9.3.2;Preflight Checklist;186
9.3.3;The Flight;187
9.3.3.1;HD44780 Controller Compatibility;188
9.3.3.2;The Parallel Master Port;188
9.3.3.3;Configuring the PMP for LCD Module Control;191
9.3.3.4;A Small Library of Functions to Access an LCD Display;192
9.3.3.5;Advanced LCD Control;195
9.3.3.6;Creating an LCD Library Module;197
9.3.4;Post-Flight Briefing;198
9.3.4.1;Notes for User Interface Experts;198
9.3.4.2;Notes for the C Experts;199
9.3.4.3;Tips & Tricks;199
9.3.4.4;Exercises;200
9.3.4.5;Books;200
9.3.4.6;Links;200
9.4;10: It’s an Analog World;202
9.4.1;Flight Plan;202
9.4.2;Preflight Checklist;202
9.4.3;The Flight;203
9.4.3.1;The First Conversion;205
9.4.3.2;Automatic Sampling;206
9.4.3.3;Developing a Demo;207
9.4.3.4;Expanding the EX16 Library;208
9.4.3.5;Developing a Game;209
9.4.3.6;Measuring Temperature;211
9.4.3.7;Another Game;214
9.4.4;Post-Flight Briefing;215
9.4.5;Notes for the C Experts;216
9.4.6;Tips & Tricks;216
9.4.7;Exercises;216
9.4.8;Books;216
9.4.9;Links;217
10;III: Cross-Country Flying;218
10.1;11: Capturing Inputs;220
10.1.1;Flight Plan;220
10.1.2;The Flight;221
10.1.2.1;Electrical Interface;221
10.1.2.2;The PS/2 Communication Protocol;221
10.1.2.3;Interfacing a PIC24 to the PS/2;222
10.1.2.4;Input Capture;223
10.1.2.5;Testing the PS/2 Receive Routines;227
10.1.2.6;Another Method – Change Notification;231
10.1.2.7;Evaluating Cost;234
10.1.2.8;A Third Method – I/O Polling;235
10.1.2.9;Testing the I/O Polling Method;239
10.1.2.10;Cost and Efficiency of the Solution;240
10.1.2.11;Completing the Interface, Adding a FIFO Buffer;242
10.1.2.12;Completing the Interface, Performing Key Codes Decoding;246
10.1.3;Post-Flight Briefing;249
10.1.4;Tips & Tricks;249
10.1.5;Exercises;250
10.1.6;Books;250
10.1.7;Links;250
10.2;12: The Dark Screen;252
10.2.1;Flight Plan;252
10.2.2;The Flight;252
10.2.2.1;Generating the Composite Video Signal;255
10.2.2.2;Using the Output Compare Modules;259
10.2.2.3;Memory Allocation;261
10.2.2.4;Image Serialization;263
10.2.2.5;Building the Video Module;265
10.2.2.6;Testing the Video Generator;268
10.2.2.7;Measuring Performance;269
10.2.2.8;The Dark Screen;270
10.2.2.9;A Test Pattern;271
10.2.2.10;Plotting;273
10.2.2.11;A Starry Night;274
10.2.2.12;Line Drawing;275
10.2.2.13;Bresenham Algorithm;276
10.2.2.14;Plotting Math Functions;279
10.2.2.15;Two-Dimensional Function Visualization;281
10.2.2.16;Fractals;285
10.2.2.17;Text;291
10.2.2.18;Testing the Text Functions;294
10.2.2.19;Text Page Video;295
10.2.2.20;Testing the Text Page Performance;303
10.2.3;Post-Flight Briefing;306
10.2.4;Tips & Tricks;306
10.2.5;Exercises;307
10.2.6;Books;308
10.2.7;Links;308
10.3;13: Mass Storage;310
10.3.1;Flight Plan;310
10.3.2;The Flight;311
10.3.2.1;The SD/MMC Physical Interface;311
10.3.2.2;Interfacing to the Explorer16 Board;312
10.3.2.3;Starting a New Project;313
10.3.2.4;Selecting the SPI Mode of Operation;315
10.3.2.5;Sending Commands in SPI Mode;315
10.3.2.6;Completing the SD/MMC Card Initialization;318
10.3.2.7;Reading Data From an SD/MMC Card;320
10.3.2.8;Writing Data to an SD/MMC Card;322
10.3.2.9;Using the SD/MMC Interface Module;324
10.3.3;Post-Flight Briefing;328
10.3.4;Tips & Tricks;328
10.3.5;Exercises;329
10.3.6;Books;329
10.3.7;Links;330
10.4;14: File I/O;332
10.4.1;Flight Plan;332
10.4.2;The Flight;333
10.4.2.1;Sectors and Clusters;333
10.4.2.2;The File Allocation Table;334
10.4.2.3;The Root Directory;335
10.4.2.4;The Treasure Hunt;337
10.4.2.5;Opening a File;345
10.4.2.6;File Attributes;349
10.4.2.7;Reading Data from a File;353
10.4.2.8;Closing a File;356
10.4.2.9;Creating the Fileio Module;357
10.4.2.10;Testing fopenM() and freadM();359
10.4.2.11;Writing Data to a File;362
10.4.2.12;Closing a File, Second Take;366
10.4.2.13;Accessory Functions;367
10.4.2.14;Testing the Complete Fileio Module;371
10.4.2.15;Code Size;374
10.4.3;Post-Flight Briefing;374
10.4.4;Notes for the PIC® Microcontroller Experts;374
10.4.5;Tips & Tricks;375
10.4.6;Exercises;375
10.4.7;Books;375
10.4.8;Links;376
10.5;15: Volare;378
10.5.1;Flight Plan;378
10.5.2;The Flight;378
10.5.2.1;Using the PIC24 OC Modules in PWM Mode;380
10.5.2.2;Testing the PWM as a D/A Converter;382
10.5.2.3;Producing Analog Waveforms;384
10.5.2.4;Reproducing Voice Messages;388
10.5.2.5;A Media Player;388
10.5.2.6;The WAVE File Format;389
10.5.2.7;The Play() Function;390
10.5.2.8;The Low-Level Audio Routines;398
10.5.2.9;Testing the WAVE File Player;401
10.5.2.10;Optimizing the File I/O;403
10.5.2.11;LED Profiling;403
10.5.3;Post-Flight Briefing;404
10.5.4;Tips & Tricks;404
10.5.5;Exercises;405
10.5.6;Books;405
10.5.7;Links;405
10.5.8;Nel Blu Dipinto Di Blu;406
11;Index;408



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.