1st Edition
Microcontroller Programming The Microchip PIC
From cell phones and television remote controls to automobile engines and spacecraft, microcontrollers are everywhere. Programming these prolific devices is a much more involved and integrated task than it is for general-purpose microprocessors; microcontroller programmers must be fluent in application development, systems programming, and I/O operation as well as memory management and system timing.
Using the popular and pervasive mid-range 8-bit Microchip PIC® as an archetype, Microcontroller Programming offers a self-contained presentation of the multidisciplinary tools needed to design and implement modern embedded systems and microcontrollers. The authors begin with basic electronics, number systems, and data concepts followed by digital logic, arithmetic, conversions, circuits, and circuit components to build a firm background in the computer science and electronics fundamentals involved in programming microcontrollers.
For the remainder of the book, they focus on PIC architecture and programming tools and work systematically through programming various functions, modules, and devices. Helpful appendices supply the full mid-range PIC instruction set as well as additional programming solutions, a guide to resistor color codes, and a concise method for building custom circuit boards.
Providing just the right mix of theory and practical guidance, Microcontroller Programming: The Microchip PIC® is the ideal tool for any amateur or professional designing and implementing stand-alone systems for a wide variety of applications.
The Atom
Isotopes and Ions
Static Electricity
Electrical Charge
Electrical Circuits
Circuit Elements
Semiconductors
NUMBER SYSTEMS
Counting
The Origins of the Decimal System
Types of Numbers
Radix Representations
Number System Conversions
DATA TYPES AND DATA STORAGE
Electronic-Digital Machines
Character Representations
Storage and Encoding of Integers
Encoding of Fractional Numbers
Binary-Coded Decimals (BCD)
DIGITAL LOGIC, ARITHMETIC, AND CONVERSIONS
Microcontroller Logic and Arithmetic
Logical Instructions
Microcontroller Arithmetic
Bit Manipulations and Auxiliary Operations
Unsigned Binary Arithmetic
Signed Binary Arithmetic
Data Format Conversions
CIRCUITS AND LOGIC GATES
Digital Circuits
The Diode Revisited
The Transistor
Logic Gates
Transistor-Transistor Logic
Other TTL Logic Families
CMOS Logic Gates
CIRCUIT COMPONENTS
Power Supplies
Clocked Logic and Flip-Flops
Clocks
Frequency Dividers and Counters
Multiplexers and Demultiplexers
Input Devices
THE MICROCHIP PIC
The PICMicro Microcontroller
PIC Architecture
MID-RANGE PIC ARCHITECTURE
Processor Architecture and Design
The Mid-Range Core Features
Mid-Range CPU and Instruction Set
EEPROM Data Storage
Data Memory Organization
Mid-Range I/O and Peripheral Modules
PIC PROGRAMMING: TOOLS AND TECHNIQUES
Microchip's MPLAB
Integrated Development Environment
Simulators and Debuggers
Programmers
Engineering PIC Software
Pseudo Instructions
PROGRAMMING ESSENTIALS: INPUT AND OUTPUT
16F84A Programming Template
Introducing the 16F84A
Simple Circuits and Programs
Programming the Seven-Segment LED
A Demonstration Board
INTERRUPTS
Interrupts on the 16F84
Interrupt Sources
Interrupt Handlers
Interrupt Programming
Sample Programs
TIMERS AND COUNTERS
The 16F84 Timer0 Module
Delays using Timer0
Timer0 as a Counter
Timer0 Programming
The Watchdog Timer
Sample Programs
LCD INTERFACING AND PROGRAMMING
LCD Features and Architecture
Interfacing with the HD44780
HD44780 Instruction Set
LCD Programming
Sample Programs
COMMUNICATIONS
PIC Communications Overview
Serial Data Transmission
Parallel Data Transmission
PIC "Free-Style" Serial Programming
PIC Protocol-Based Serial Programming
Sample Programs
DATA EEPROM PROGRAMMING
PIC Internal EEPROM Memory
EEPROM Devices and Interfaces
Sample Programs
ANALOG TO DIGITAL AND REALTIME CLOCKS
A/D Converters
A/D Integrated Circuits
PIC On-Board A/D Hardware
Realtime Clocks
Sample Programs
APPENDIX A: RESISTOR COLOR CODES
APPENDIX B: BUILDING YOUR OWN CIRCUIT BOARDS
APPENDIX C: MID-RANGE INSTRUCTION SET
APPENDIX D: SUPPLEMENTARY PROGRAMS
INDEX
Biography
Julio Sanchez, Maria P. Canton