You are previewing PIC in Practice, 2nd Edition.
O'Reilly logo
PIC in Practice, 2nd Edition

Book Description

PIC in Practice is a graded course based around the practical use of the PIC microcontroller through project work. Principles are introduced gradually, through hands-on experience, enabling students to develop their understanding at their own pace.

Dave Smith has based the book on his popular short courses on the PIC for professionals, students and teachers at Manchester Metropolitan University. The result is a graded text, formulated around practical exercises, which truly guides the reader from square one.

The book can be used at a variety of levels and the carefully graded projects make it ideal for colleges, schools and universities. Newcomers to the PIC will find it a painless introduction, whilst electronics hobbyists will enjoy the practical nature of this first course in microcontrollers.

PIC in Practice introduces applications using the popular 16F84 device as well as the 16F627, 16F877, 12C508, 12C629 and 12C675. In this new edition excellent coverage is given to the 16F818, with additional information on writing and documenting software.

* Gentle introduction to using PICs for electronic applications
* Principles and programming introduced through graded projects
* Thoroughly up-to-date with new chapters on the 16F818 and writing and documenting programs

Table of Contents

  1. Cover Image
  2. Content
  3. Title
  4. Copyright
  5. Introduction
  6. 1. Introduction to the PIC microcontroller
    1. The aim of the book
    2. Program memory
    3. Microcontroller clock
    4. The microcontroller system
    5. Types of microcontroller
    6. Microcontroller specification
    7. Using the microcontroller
    8. 1 Microcontroller hardware
    9. 2 Programming the microcontroller
  7. 2. Programming the 16F84 microcontroller
    1. Instructions used in this chapter:
    2. Microcontroller inputs and outputs (I/O)
    3. Timing with the microcontroller
    4. Programming the microcontroller
    5. Entering data
    6. The Header for the 16F84, HEADER84.ASM
    7. Program example
    8. Saving and assembling the code
    9. PICSTART PLUS programmer
    10. Programming flowchart
    11. Problem: flashing two LEDs
    12. Solution to the problem, flashing two LEDs
  8. 3. Introductory projects
    1. LED_Flasher2
    2. SOS
    3. Code for SOS circuit
    4. Flashing 8 LEDs
    5. Chasing 8 LEDs
    6. Traffic lights
    7. More than 8 outputs
  9. 4. Headers, porting code – which micro
    1. Factors affecting the choice of the microcontroller
    2. Choosing the microcontroller
    3. Headers
  10. 5. Using inputs
    1. Switch flowchart
    2. Program development
    3. Scanning (using multiple inputs)
    4. Switch scanning
    5. Control application – a hot air blower
  11. 6. Understanding the headers
    1. The 16F84
    2. 16F84 memory map
    3. The 16F818
  12. 7. Keypad scanning
    1. Programming example for the keypad
  13. 8. Program examples
    1. Counting events
    2. Look up table
    3. 7-Segment display
    4. Numbers larger than 255
    5. Long time intervals
    6. One hour delay
  14. 9. The 16C54 microcontroller
    1. Header for the 16C54
    2. 16C54 memory map
  15. 10. Alpha numeric displays
    1. Display pin identification
    2. Configuring the display
    3. Writing to the display
    4. Program example
    5. Program operation
    6. Display configuration
    7. Writing to the display
    8. Displaying a number
  16. 11. Analogue to digital conversion
    1. Making an A/D reading
    2. Configuring the A/D device
    3. Analogue header for the 16F818
    4. A/D Conversion – example, a temperature sensitive switch
    5. Program code
    6. Another example – a voltage indicator
  17. 12. Radio transmitters and receivers
    1. How does it work?
    2. Measuring the received pulse width
  18. 13. EEPROM data memory
    1. Example using the EEPROM
  19. 14. Interrupts
    1. New instructions used in this chapter:
    2. Interrupt sources
    3. Interrupt control register
    4. Program using an interrupt
  20. 15. The 12 series 8 pin microcontroller
    1. Pin diagram of the 12C508/509
    2. Pin diagram of the 12F629 and 12F675
    3. Features of these 12 series
    4. The memory maps of the 12C508 and 12F629/675
    5. Oscillator calibration
    6. I/O PORT, GPIO
    7. Delays with the 12 series
    8. Header for 12C508/9
    9. Program application for 12C508
    10. Program application using the 12F629/675
  21. 16. The 16F87X microcontroller
    1. 16F87X family specification
    2. 16F87X memory map
    3. The 16F872 microcontroller
    4. The 16F872 header
    5. 16F872 Application – a greenhouse control
    6. Programming the 16F872 microcontroller using PICSTART PLUS
    7. Reconfiguring the 16F872 header
  22. 17. The 16F62X microcontroller
    1. 16F62X oscillator modes
    2. 16F62X and 16F84 Pinouts
    3. 16F62X Port configuration
    4. 16F62X Memory map
    5. The 16F62X headers
    6. HEAD62RC.ASM
    7. A 16F627 application – flashing an LED on and off
    8. The 16F627 LED flasher code
    9. Configuration settings for the 16F627
    10. Other features of the 16F62X
  23. 18. Projects
    1. Project 1 Electronic dice
    2. Project 2 Reaction timer
    3. Project 3 Burglar alarm
    4. Fault finding
    5. Development kits
  24. 19. Instruction set, files and registers
    1. The PIC microcontroller instruction set
    2. Registers
    3. Instruction set summary
  25. APPENDIX A. Microcontroller data
  26. APPENDIX B. Electrical characteristics
  27. APPENDIX C. Decimal, binary and hexadecimal numbers
  28. APPENDIX D. Useful contacts
  29. Index