Table of Contents

INTRODUCTION

PIC PRODUCT OVERVIEW

PIC16F84

Pins and Functions
Package
Clock Oscillator
Configuration bits
Reset
Ports
Special Features
Watchdog Timer
Power-up Timer
Sleep Mode
PIC16 Architecture
Program Memory
File Registers
Working Register (W)
Option Register
Stack
Reset Vector
Interrupt Vector
Program Counter
Status Register

CIRCUIT FOR EXPERIMENTS

CHOOSING DEVELOPMENT TOOLS

MPLAB/Windows vs. MPASM/MS-DOS
Choosing a Device Programmer
USING AN ASSEMBLER

Source Code for the Assembler
Semicolon (;)
Tabs
Style
Headers
Labels
Equates
Literals
Origin
End
Program Format
Files Used by Assembler
Files Created by Assembler
Preventing Some "Gotchas"

USING THE MS-DOS BASED MPASM ASSEMBLER

How to Assemble a Program

MPLAB OVERVIEW - GETTING STARTED

Using MPLAB - Getting Started
Toolbars
Select Device Type
Project
Text Editor
Edit Project
Assembler
More MPLAB Operations

PROGRAMMING A DEVICE

WRITING PROGRAMS

Programming Concepts
Instruction Set
Instruction Format for the Assembler
Byte-oriented Instructions
Bit-oriented Instructions
Literal Instructions
Control Instructions (CALL and GOTO)
Destination Designator (d)
Hexadecimal Numbers vs. MPASM Assembler
Binary and Decimal Numbers vs. MPASM Assembler
ASCII Characters vs. MPASM Assembler
Addressing Modes
Immediate Addressing
Direct Addressing
Indirect Addressing
Relative Addressing
Use of the RETLW Instruction for Accessing Tables of Data Via  Relative Addressing
Using the Ports
Data Direction
Port Read/Write
Flags
Simple Data Transfers
Loop - Endless
Loop with a Counter
Loop Until
Comparisons
Bit Manipulation Using Bit Manipulation Instructions
Bit Manipulation Using Logic Instructions
Using Bit Manipulation
Sequencing
Subroutines
Time Delay Loop
Lookup Tables

INTERRUPTS

Interrupt Control Register
Interrupt Sources
External
Timer/Counter
Port B Interrupt on Change - Bits 7,6,5,4
Global Interrupt Enable Flag
Saving Status During an Interrupt (Context Saving)
Where to Put the Interrupt Service Routine
Interrupt Latency
Multiple Interrupt Sources
Example - External Interrupt

TIMING AND COUNTING

Digital Output Waveforms
Timing and Counting Using the PIC16F84's TMR0 On-Board Timer/Counter
Prescaler
Changing Prescaler Assignment
Using the Timer/Counter
Timer/Counter Experiments
Digital Output Using TMR0 - Internal Clock
Single Time Interval - Internal Clock
Single Time Interval - External Clock
Free Running Mode - Internal Clock
Free Running Mode - External Clock
Counting Events (Pulses)

PIC16C54

Pins and Functions
Packages
Clock Oscillator
Configuration Bits
Ports
Architecture
Program Memory
File Registers
Stack
Reset Vector
Program Counter
Option Register
Status Register
No Timer/Counter Overflow Interrupt/Flag Output
Fewer Instructions
PIC16C54 Programming Example
Timing and Counting
Timer/Counter Description
Using the Timer/Counter
Timer/Counter Experiment

MENDING OUR WAYS

Sink vs. Source
File Register Bank Switching
Bank Switching Demo
Interrupts and Bank Switching
Program Memory Paging
Include Files

I/O CONVERSION

Input Conversion
Output Conversion

APPENDICES

Appendix A - Sources
Appendix B - Hexadecimal Numbers