Extensively revised and updated to encompass the latest developments in the PIC 18FXXX series, this book demonstrates how to develop a range of microcontroller applications through a project-based approach. After giving an introduction to programming in C using the popular mikroC Pro for PIC and MPLAB XC8 languages, this book describes the project development cycle in full. The book walks you through fully tried and tested hands-on projects, including many new, advanced topics such as Ethernet programming, digital signal processing, and RFid technology. This book is ideal for engineers, technicians, hobbyists and students who have knowledge of the basic principles of PIC microcontrollers and want to develop more advanced applications using the PIC18F series.
This book Includes over fifty projects which are divided into three categories: Basic, Intermediate, and Advanced.
New projects in this edition:
Logic probeCustom LCD font designHi/Lo gameGenerating various waveforms in real-timeUltrasonic height measurementFrequency counterReaction timerGPS projectsClosed-loop ON/OFF temperature controlBluetooth projects (master and slave)RFid projectsClock using Real-time-clock (RTC) chipRTC alarm projectGraphics LCD (GLCD) projectsBarometer+thermometer+altimeter projectPlotting temperature on GLCDEthernet web browser based controlEthernet UDP based controlDigital signal processing (Low Pass Filter design)Automotive LIN bus projectAutomotive CAN bus projectMultitasking projects (using both cooperative and Round-robin scheduling)Unipolar stepper motor projectsBipolar stepper motor projectsClosed-loop ON/OFF DC motor control
- A clear introduction to the PIC 18FXXX microcontroller's architecture
- Covers developing wireless and sensor network applications, SD card projects, and multi-tasking; all demonstrated with the block and circuit diagram, program description in PDL, program listing, and program description
- Includes more than 50 basic, intermediate, and advanced projects
Inhaltsverzeichnis
1;Front Cover;1 2;PIC Microcontroller Projects in C: Basic to Advanced;4 3;Copyright;5 4;Contents;6 5;Preface;18 6;Acknowledgments;20 7;Chapter 1 - Microcomputer Systems;22 7.1;1.1 Introduction;22 7.2;1.2 Microcontroller Systems;22 7.3;1.3 Summary;27 7.4;1.4 Exercises;27 8;Chapter 2 - mikroC Pro for PIC Programming Language;30 8.1;2.1 Structure of a mikroC Pro for PIC Program;31 8.2;2.2 Arrays;33 8.3;2.3 Pointers;34 8.4;2.4 Structures;35 8.5;2.5 Operators in C;36 8.6;2.6 Modifying the Flow of Control;36 8.7;2.7 mikroC Pro for PIC Functions;41 8.8;2.8 mikroC Pro for PIC Library Functions;41 8.9;2.9 Summary;41 8.10;2.10 Exercises;43 9;Chapter 3 - MPLAB X IDE and MPLAB XC8 C Programming Language;46 9.1;3.1 The PICDEM PIC18 Explorer Development Board;47 9.2;3.2 MPLAB X IDE;50 9.3;3.3 MPLAB XC8 Compiler;50 9.4;3.4 Summary;71 9.5;3.5 Exercises;71 10;Chapter 4 - Microcontroller Program Development;72 10.1;4.1 Using the PDL and Flow Charts;73 10.2;4.2 Examples;78 10.3;4.3 Representing for Loops in Flow Charts;84 10.4;4.4 Summary;85 10.5;4.5 Exercises;86 11;Chapter 5 - Simple PIC18 Projects;88 11.1;Project 5.1Chasing LEDs;91 11.2;Project 5.2Complex Flashing LED;97 11.3;Project 5.3Random Flashing LEDs;99 11.4;Project 5.4Logic Probe;102 11.5;Project 5.5LED Dice;106 11.6;Project 5.6Two-Dice Project;115 11.7;Project 5.7Two-Dice Project Using Fewer I/O Pins;119 11.8;Project 5.87-Segment LED Counter;130 11.9;Project 5.9Two-Digit Multiplexed 7-Segment LED;141 11.10;Project 5.10Four-Digit Multiplexed 7-Segment LED;146 11.11;Project 5.11LED Voltmeter;150 11.12;Project 5.12LCD Voltmeter;161 11.13;Project 5.13Generating Sound;177 11.14;Project 5.14Generating Custom LCD Fonts;181 11.15;Project 5.15Digital Thermometer;189 12;Chapter 6 - Intermediate PIC18 Projects;194 12.1;Project 6.1Four-Digit Multiplexed Seven-Segment Light Emitting Diode Event Counter Using an External Interrupt;196 12.2;Project 6.2Calculator with a Keypad and Liquid Crystal Display;211 12.3;Project 6.3The High/Low Ga
me;227 12.4;Project 6.4Generating Waveforms;235 12.5;Project 6.5Ultrasonic Human Height Measurement;269 12.6;Project 6.6Minielectronic Organ;279 12.7;Project 6.7Frequency Counter with an LCD Display;283 12.8;Project 6.8Reaction Timer;289 12.9;Project 6.9Temperature and Relative Humidity Measurement;298 12.10;Project 6.10Thermometer with an RS232 Serial Output;311 12.11;Project 6.11Microcontroller and a PC-Based Calculator;325 12.12;Project 6.12GPS with an LCD Output;327 12.13;Project 6.13ONOFF Temperature Control;338 13;Chapter 7 - Advanced PIC18 Projects;348 13.1;Project 7.1Bluetooth Serial CommunicationSlave Mode;354 13.2;Project 7.2Bluetooth Serial CommunicationMaster Mode;382 13.3;Project 7.3Using the RFID;390 13.4;Project 7.4RFID Lock;408 13.5;Project 7.5Complex SPI Bus Project;410 13.6;Project 7.6Real-Time Clock Using an RTC Chip;435 13.7;Project 7.7Real-Time Alarm Clock;457 13.8;Project 7.8SD Card ProjectsWrite Text To a File;460 13.9;Project 7.9SD Card-Based Temperature Data Logger;487 13.10;Project 7.10Using Graphics LCDDisplaying Various Shapes;498 13.11;Project 7.11Barometer, Thermometer and Altimeter Display on a GLCD;511 13.12;Project 7.12Plotting the Temperature Variation on the GLCD;522 13.13;Project 7.13Using the EthernetWeb Browser-Based Control;529 13.14;Project 7.14Using the EthernetUDP-Based Control;542 13.15;Project 7.15Digital Signal ProcessingLow Pass FIR Digital Filter Project;543 13.16;Project 7.16Automotive ProjectLocal Interconnect Network Bus Project;556 13.17;Project 7.17Automotive ProjectCan Bus Project;571 13.18;Project 7.18 Multitasking;599 13.19;Project 1Using Cooperative Multitasking;602 13.20;Project 2Using Round-Robin Multitasking With Variable CPU Time Allocation;611 13.21;Project 7.19Stepper Motor Control ProjectsSimple Unipolar Motor Drive;619 13.22;Project 7.20Stepper Motor Control ProjectsComplex Control Of A Unipolar Motor;625 13.23;Project 7.21Stepper Motor Control ProjectSimple Bipolar Motor Drive;629 13.24;Project 7.22DC
Motor Control ProjectsSimple Motor Drive;634 13.25;Project 7.23A Homemade Optical Encoder For Motor Speed Measurement;640 13.26;Project 7.24Closed-Loop DC Motor Speed ControlOn/Off Control;645 14;Index;652