PIC18F2220/2320/4220/4320
Comparator ...................................................................... 221
C
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 ............................................... 321
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 .................................... 254
Context Saving During Interrupts ....................................... 99
Control Registers
C Compilers
MPLAB C17 .............................................................300
MPLAB C18 .............................................................300
MPLAB C30 .............................................................300
CALL ................................................................................270
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 ....................................................................24
Selection Using OSCCON Register ...........................24
Clocking Scheme/Instruction Cycle ....................................57
CLRF ................................................................................271
CLRWDT ..........................................................................271
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
EECON1 and EECON2 ............................................. 72
Conversion Considerations .............................................. 370
CPFSEQ .......................................................................... 272
CPFSGT .......................................................................... 273
CPFSLT ........................................................................... 273
Crystal Oscillator/Ceramic Resonator ................................ 19
D
Data EEPROM Code Protection ...................................... 254
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 ................................................................................ 274
DC and AC Characteristics
Graphs and Tables .................................................. 343
DC Characteristics ........................................................... 318
Power-Down and Supply Current ............................ 309
Supply Voltage ......................................................... 308
DCFSNZ .......................................................................... 275
DECF ............................................................................... 274
DECFSZ .......................................................................... 275
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, 251
COMF ...............................................................................272
DS39599C-page 374
2003 Microchip Technology Inc.