O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming 8-bit PIC Microcontrollers in C

Book Description

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

Table of Contents

  1. Copyright
  2. Foreword
  3. Preface
    1. Links, Resources, and Acknowledgments
    2. About the Author
  4. Introduction
  5. PIC Microcontroller Systems
    1. PIC16 Microcontrollers
    2. PIC16 MCU Configuration
    3. PIC16 MCU Peripherals
    4. PIC16 Serial Interfaces
    5. PIC16 MPLAB Projects
    6. PIC16 Program and Debug
  6. C Programming Essentials
    1. PIC16 C Getting Started
    2. PIC16 C Program Basics
    3. PIC16 C Data Operations
    4. PIC16 C Sequence Control
    5. PIC16 C Functions and Structure
    6. PIC16 C Input and Output
    7. PIC16 C More Data Types
    8. PIC16 C Compiler Directives
    9. PIC16 C Assembler Routines
    10. Assessment 2
    11. Assignments 2
  7. C Peripheral Interfaces
    1. PIC16 C Analog Input
    2. PIC16 C Interrupts
    3. PIC16 C Hardware Timers
    4. PIC16 C UART Serial Link
    5. PIC16 C SPI Serial Bus
    6. PIC16 C I2C Serial Bus
    7. PIC16 C Parallel and Serial Interfaces
    8. PIC16 C EEPROM Interface
    9. PIC16 C Analog Output
    10. Assessment 3
    11. Assignments 3
  8. C Mechatronics Applications
    1. PICDEM Mechatronics Board Overview
    2. PICDEM Liquid Crystal Display
    3. PICDEM DC Motor Test Programs
    4. PICDEM Stepper Motor Control
    5. PICDEM Analog Sensors
    6. PICDEM Temperature Controller
    7. PICDEM Board Simulation
    8. Assessment 4 5 points each, total 100
    9. Assignments 4
  9. PIC16 C Applications and Systems
    1. PIC16 C Application Design
    2. PIC16 C Temperature Controller
    3. PIC16 C Data Logger System
    4. PIC16 C Operating Systems
    5. PIC16 C System Design
    6. Assessment 5
    7. Assignments 5
  10. Hardware Design Using ISIS Schematic Capture
    1. Design Specification
    2. Schematic Circuit
    3. Schematic Edit
  11. Software Design Using CCS C
    1. BAR1 Source Code
    2. PIC Registers
    3. BAR1 List File
  12. System Testing Using Proteus VSM
    1. Attaching the Program
    2. Program Debugging
    3. Typical Errors
  13. C Compiler Comparison
    1. Microchip C18
    2. Hi-Tech PIC C
    3. Mikro C
    4. Matrix C
    5. Summary of C Compilers
  14. CCS C Programming Syntax Summary
    1. Compiler Directives
    2. Program Blocks
    3. Punctuation
    4. Basic I/O Functions
  15. CCS C Program Function Reference
  16. Answers
    1. Questions: Assessment 1
    2. Answers
    3. Questions: Assessment 2
    4. Answers
    5. Questions: Assessment 3
    6. Answers
    7. Questions: Assessment 4
    8. Answers
    9. Questions: Assessment 5
    10. Answers