Making PIC Microcontroller Instruments and Controllers

Paperback
from $0.00

Author: Harprit S. Sandhu

ISBN-10: 0071606165

ISBN-13: 9780071606165

Category: Circuits - Computer Hardware

Search in google:

Essential Design Techniques From the Workbench of a ProHarness the power of the PIC microcontroller unit with practical, common-sense instruction from an engineering expert. Through eight real-world projects, clear illustrations, and detailed schematics, Making PIC Microcontroller Instruments and Controllers shows you, step-by-step, how to design and build versatile PIC-based devices. Configure all necessary hardware and software, read input voltages, work with control pulses, interface with peripherals, and debug your results. You'll also get valuable appendices covering technical terms, abbreviations, and a list of sample programs available online.Build a tachometer that gathers, processes, and displays data Make accurate metronomes using internal PIC timersConstruct an asynchronous pulse counter that tracks marblesRead temperature information through an analog-to-digital converterUse a gravity sensor and servos to control the position of a tableAssemble an eight-point touch screen with an input scanning routineEngineer an adjustable, programmable single-point controller Capture, log, monitor, and store data from a solar collector

Preface xiiiPart I The PIC 16F877A 1Chapter 1 An Introduction to the PIC 16F877A Microcontroller Unit 3The Microcontroller 7Special Precautions and Notes of Interest 9Data Sheets 9Some Useable PICS 11Chapter 2 Getting Started: The Hardware and Software Setup 13The Programmers 14Loading the Software 15Using the Software in the Windows Environment 15Software Notes from MicroEngineering Labs 18Chapter 3 Understanding Microchip Technology's PIC 16F877A: A Description of the MCU 2116F877A Microcontroller's Core Features 22Peripheral Features 23Configuring and Controlling the Properties of the Ports 29PORTA 29PORTB 30PORTC 31PORTD 32PORTE 33TIMERS 33Chapter 4 The Software, the Compilers, and the Editor 35The Basic Compiler Instruction Set 35The PICBASIC PRO Compiler Instruction Set 37PICBASIC PRO Compiler 42Chapter 5 Controlling the Output and Reading the Input 47General 47Programs That Create Output 48Programs That Read the Inputs and Then Provide Output 48Creating Outputs 48Blink One LED 50Blink Eight LEDs in Sequence 51Dim and Brighten One LED 52LCD Display 53Controlling the Digital and Analog Settings 56Writing Binary, Hex, and Decimal Values to the LCD 56Reading a Potentiometer and Displaying the Results on the LED Bargraph 57A Simple Beep 60Advanced Exercise: Controlling an RC Servo from the Keyboard 63Reading the Inputs 67Read Keyboard and Display Key Number on the LCD 73Read One Potentiometer and Display Its 8-Bit Value on LCD in Binary, Hex, and Decimal Notation, Also Impress the Binary Value on the Bargraph 74Read All Three Potentiometers andDisplay Their Values on the LCD 76Adding the Kind of Flexibility That Defines Computer Interfaces and Demonstrates the Ability to Make Sophisticated Real-Time Adjustments 78Exercises 79Chapter 6 Timers and Counters 83General 83Timers 84Timer0 85Timer1: The Second Timer 93Timer2: The Third Timer 102Counters 104Exercises for Timers 112Exercises for Counters 112Chapter 7 Clocks, Memory, and Sockets 113Sockets U3, U4, and U5: For Serial One-Wire Memory Devices 113Which EEPROM Type Should You Use? 115Socket U3-12C SEEPROM 115Socket U4-SPI SEEPROM 117Socket U5-Microwire Devices 118Socket U6-Real-Time Clocks 120The LTC1298 12-Bit A-to-D Converter (Also Used in Socket U6) 124Sockets U7 (and U8) 126Chapter 8 Serial Communications: Sockets U9 and U10 131When and How Will I Know if It Is Working? 134Using the RS485 Communications 137Chapter 9 Using Liquid Crystal Displays: An Extended Information Resource 139General 139Using LCDs in Your Projects 142Understanding the Hardware and Software Interaction 143Talking to the LCD 144The Hardware 144Setting Out Our Design Intent 146Liquid-Crystal Display Exercises 154Part II The Projects 157Chapter 10 Using Sensors (Transducers) 159General 159The Most Basic Question We Must Answer Is... 161Types of Sensors 163Two Interesting Resources You Will Want to Investigate 164Chapter 11 Conditioning the Input Signal 165General 165Alternating Current Outline 166Direct Current Outline 166Simple Switches and Other Contacts 167Circuitry for Conditioning dc Signals 169Chapter 12 Conditioning the Output Signal 173General 173Chapter 13 An Introduction to the Eight Projects 177The Web Site 177The Eight Techniques 177Notes 182Chapter 14 The Universal Instrument: A Background Discussion 183The Properties and Capabilities of a Universal Instrument 183A Basic Temperature-Controlling Device 184Notes 186Chapter 15 Counting Pulses: A Programmable Tachometer 187Project 1 187Notes on Using Seven-Segment Displays 199Chapter 16 Creating Accurate Intervals with Timers: The Metronomes 209Project 2 209Timer0 214Timer1 224Timer2 228The Timer2 Program 229The Watchdog Timer 230Chapter 17 Understanding the Counters: Counting Marbles 233Project 3 233Counting with an Escapement 240Some Real-World Notes 243Counting to a Register Using an Interrupt 244Counting Directly into an Internal Counter 246Using Timer1 in Counter Mode 248Special Notes for Timer1 Usage 256Chapter 18 A Dual Thermometer Instrument 259Project 4 259Chapter 19 An Artificial Horizon: A Table Surface That Stays Level 269Project 5 269Discussion 270Setting Up the Hardware Connections 271Building the Artificial Horizon Table 275Gravity Sensor Exercises 277Chapter 20 Building a Simple Eight-Button Touch Panel 279Project 6 279Chapter 21 Single Set Point Controller with Remote Inhibit Capability 293Project 7 293Chapter 22 Logging Data from a Solar Collector 301Project 8 301Microcontroller Hardware 304Software 306Chapter 23 Debugging 315General 315Debugging and Troubleshooting 315First Problem That Must Be Fixed: The Microcontroller Crystal Must Oscillate 316If the Chip Refuses to Run 318Using the PBP Compiler Commands to Help Debug a Program 319Commands That Can Provide Debug Output to a Serial Port 319Dumb Terminal Programs 319Solderless Breadboards 320Debugging at the Practical Level 320Configuring the 16F877A and Related Notes 324Settings 326Configuration 326Options 327Simple Checks 327Some Programmer-Related Error Messages 328Things I Have Noticed but Have Not Figured Out (and Other Mysteries) 328Setting the Ports 329Chapter 24 Some Real-World Projects You Can Build 331Conclusion 335Appendixes 337Appendix A Setting Up a Compiler for One-Keystroke Operation 339Appendix B Abbreviations Used in this Book and in the Datasheets 341Appendix C Listings of PICBASIC PRO Programs on the Internet at melabs.com 345Appendix D Notes on Designing a Simple Battery Monitor Instrument: Thinking about a Simple Problem Out Loud 347Appendix E Using the Support Web Site to Help Make Instruments and Controllers 349Index 351