Datasheet
PIC18F2220/2320/4220/4320
DS39599G-page 380 © 2007 Microchip Technology Inc.
C
C Compilers
MPLAB C18 ............................................................. 302
MPLAB C30 ............................................................. 302
CALL ................................................................................ 272
Capture (CCP Module) ..................................................... 135
Associated Registers ...............................................137
CCP Pin Configuration ............................................. 135
CCPR1H:CCPR1L Registers ...................................135
Software Interrupt .....................................................135
Timer1/Timer3 Mode Selection ................................ 135
Capture (ECCP Module) .................................................. 142
Capture/Compare/PWM (CCP) ........................................ 133
Capture Mode. See Capture.
CCP1 ........................................................................134
CCPR1H Register ............................................ 134
CCPR1L Register ............................................ 134
CCP2 ........................................................................134
CCPR2H Register ............................................ 134
CCPR2L Register ............................................ 134
Compare Mode. See Compare.
Interaction of Two CCP Modules ............................. 134
PWM Mode. See PWM.
Timer Resources ...................................................... 134
Clock Sources .................................................................... 25
Selection Using OSCCON Register ........................... 25
Clocking Scheme/Instruction Cycle .................................... 57
CLRF ................................................................................ 273
CLRWDT .......................................................................... 273
Code Examples
16 x 16 Signed Multiply Routine .................................86
16 x 16 Unsigned Multiply Routine ............................. 86
8 x 8 Signed Multiply Routine ..................................... 85
8 x 8 Unsigned Multiply Routine .................................85
Changing Between Capture Prescalers ...................135
Computed GOTO Using an Offset Value ...................59
Data EEPROM Read ................................................. 83
Data EEPROM Refresh Routine ................................84
Data EEPROM Write .................................................. 83
Erasing a Flash Program Memory Row .....................76
Fast Register Stack .................................................... 56
How to Clear RAM (Bank 1) Using
Indirect Addressing ............................................ 66
Implementing a Real-Time Clock Using a
Timer1 Interrupt Service .................................. 125
Initializing PORTA .................................................... 101
Initializing PORTB .................................................... 104
Initializing PORTC ....................................................107
Initializing PORTD ....................................................109
Initializing PORTE .................................................... 111
Loading the SSPBUF (SSPSR) Register ................. 158
Reading a Flash Program Memory Word ................... 75
Saving STATUS, WREG and BSR
Registers in RAM ............................................... 99
Writing to Flash Program Memory ....................... 78–79
Code Protection ....................................................... 237, 252
COMF ............................................................................... 274
Comparator ......................................................................221
Analog Input Connection Considerations .................225
Associated Registers ...............................................226
Configuration ............................................................ 221
Effects of a Reset .....................................................225
Interrupts .................................................................. 224
Operation .................................................................223
Operation in Power-Managed Modes ...................... 225
Outputs .................................................................... 223
Reference ................................................................ 223
Response Time ........................................................ 223
Comparator Specifications ............................................... 322
Comparator Voltage Reference ....................................... 227
Accuracy and Error
.................................................. 228
Associated Registers ............................................... 229
Configuring .............................................................. 227
Connection Considerations ...................................... 228
Effects of a Reset .................................................... 228
Operation in Power-Managed Modes ...................... 228
Compare (CCP Module) .................................................. 136
Associated Registers ............................................... 137
CCP Pin Configuration ............................................. 136
CCPR1 Register ...................................................... 136
Software Interrupt .................................................... 136
Special Event Trigger .......................................136, 220
Timer1/Timer3 Mode Selection ................................ 136
Compare (ECCP Mode) ................................................... 142
Computed GOTO ............................................................... 59
Configuration Bits ............................................................ 237
Configuration Register Protection .................................... 255
Context Saving During Interrupts ....................................... 99
Control Registers
EECON1 and EECON2 ............................................. 72
Conversion Considerations .............................................. 377
CPFSEQ .......................................................................... 274
CPFSGT .......................................................................... 275
CPFSLT ........................................................................... 275
Crystal Oscillator/Ceramic Resonator ................................ 19
Customer Change Notification Service ............................ 389
Customer Notification Service .......................................... 389
Customer Support ............................................................ 389
D
Data EEPROM Code Protection ...................................... 255
Data EEPROM Memory ..................................................... 81
Associated Registers ................................................. 84
EEADR Register ........................................................ 81
EECON1 and EECON2 Registers ............................. 81
Operation During Code-Protect ................................. 84
Protection Against Spurious Write ............................. 83
Reading ..................................................................... 83
Using .......................................................................... 84
Write Verify ................................................................ 83
Writing ........................................................................ 83
Data Memory ..................................................................... 59
General Purpose Registers ....................................... 59
Map for PIC18F2X20/4X20 ........................................ 60
Special Function Registers ........................................ 61
DAW ................................................................................ 276
DC and AC Characteristics
Graphs and Tables .................................................. 347
DC Characteristics ........................................................... 319
Power-Down and Supply Current ............................ 310
Supply Voltage ......................................................... 308
DCFSNZ .......................................................................... 277
DECF ............................................................................... 276
DECFSZ .......................................................................... 277
Development Support ...................................................... 301
Device Differences ........................................................... 376
Device Overview .................................................................. 7
Features (table) ........................................................... 8
New Core Features ...................................................... 7
Other Special Features ................................................ 7
Direct Addressing ............................................................... 67