PIC18F Peripheral Library Help Document.pdf

1283
PIC18 Peripheral Library Help Document Copyright (c) 2009. All rights reserved.

Transcript of PIC18F Peripheral Library Help Document.pdf

PIC18 Peripheral Library Help Document

Copyright (c) 2009. All rights reserved.

Made with Doc-O-Matic.

PIC18 Peripheral Library Help Document

Table of Contents PIC18 Peripheral Library Introduction SW Licence Agreement Release Notes Getting Started DevicesPIC18F66K80 Family PIC18F66K80 PIC18F65K80 PIC18F46K80 PIC18F45K80 PIC18F26K80 PIC18F25K80 PIC18LF66K80 PIC18LF65K80 PIC18LF46K80 PIC18LF45K80 PIC18LF26K80 PIC18LF25K80 PIC18F47Jx3 Family PIC18F47J53 PIC18F46J53 PIC18F27J53 PIC18F26J53 PIC18F47J13 PIC18F46J13 PIC18F26J13 PIC18F27J13 PIC18F87K22 Family PIC18F87K22Made with Doc-O-Matic.

1 2 4 5 9 1121 22 23 24 25 26 27 28 29 30 31 32 33 33 34 35 36 37 39 40 41 42 44 44

iii

PIC18 Peripheral Library Help Document PIC18F86K22 PIC18F86K27 PIC18F85K22 PIC18F67K22 PIC18F66K22 PIC18F66K27 PIC18F65K22 PIC18F97J72 Family PIC18F97J72 PIC18F96J72 PIC18F87J72 PIC18F86J72 PIC18F87K90 Family PIC18F87K90 PIC18F86K95 PIC18F86K90 PIC18F85K90 PIC18F67K90 PIC18F66K95 PIC18F66K90 PIC18F65K90 PIC18F87J93 Family PIC18F87J93 PIC18F86J93 PIC18F67J93 PIC18F66J93 PIC18F87J90 Family PIC18F87J90 PIC18F86J90 PIC18F67J90 PIC18F66J90 PIC18F46J50 Family PIC18F46J50 PIC18F45J50 PIC18F44J50 PIC18F26J50 PIC18F25J50 PIC18F24J50 PIC18LF46J50Made with Doc-O-Matic.

45 46 47 48 49 50 51 52 52 53 55 56 58 58 59 60 61 62 63 64 65 66 66 67 69 70 72 72 73 75 76 78 78 79 80 82 83 84 85

iv

PIC18 Peripheral Library Help Document PIC18LF45J50 PIC18LF44J50 PIC18LF26J50 PIC18LF25J50 PIC18LF24J50 PIC18F46J11 Family PIC18F46J11 PIC18F45J11 PIC18F44J11 PIC18F26J11 PIC18F25J11 PIC18F24J11 PIC18LF46J11 PIC18LF45J11 PIC18LF44J11 PIC18LF26J11 PIC18LF25J11 PIC18LF24J11 PIC18F1xK50 Family PIC18F14K50 PIC18F13K50 PIC18LF14K50 PIC18LF13K50 PIC18F1xK22 Family PIC18F14K22 PIC18F13K22 PIC18LF14K22 PIC18LF13K22 PIC18F4553 Family PIC18F4553 PIC18F4458 PIC18F2553 PIC18F2458 PIC18F8493 Family PIC18F8493 PIC18F8393 PIC18F6493 PIC18F6393 PIC18F8723 FamilyMade with Doc-O-Matic.

87 88 89 90 92 93 93 94 96 97 98 99 101 102 103 104 106 107 108 108 109 110 111 111 111 112 113 114 115 115 115 116 116 117 117 117 118 119 119

v

PIC18 Peripheral Library Help Document PIC18F8723 PIC18F8628 PIC18F6723 PIC18F6628 PIC18F84J15 Family PIC18F84J15 PIC18F64J15 PIC18F87J50 Family PIC18F87J50 PIC18F86J55 PIC18F86J50 PIC18F85J50 PIC18F67J50 PIC18F66J55 PIC18F66J50 PIC18F65J50 PIC18F87J11 Family PIC18F87J11 PIC18F86J16 PIC18F86J11 PIC18F67J11 PIC18F66J16 PIC18F66J11 PIC18F46K20 Family PIC18F46K20 PIC18F45K20 PIC18F44K20 PIC18F43K20 PIC18F26K20 PIC18F25K20 PIC18F24K20 PIC18F23K20 PIC18F4431 Family PIC18F4431 PIC18F4331 PIC18F2431 PIC18F2331 PIC18F97J60 Family PIC18F97J60Made with Doc-O-Matic.

119 120 120 121 121 121 122 122 122 123 124 125 125 126 127 128 128 128 129 130 131 131 132 133 133 134 135 135 136 137 138 138 139 139 140 141 142 143 143

vi

PIC18 Peripheral Library Help Document PIC18F96J65 PIC18F96J60 PIC18F87J60 PIC18F86J65 PIC18F86J60 PIC18F67J60 PIC18F66J65 PIC18F66J60 PIC18F87J10 Family PIC18F87J10 PIC18F86J15 PIC18F86J10 PIC18F85J15 PIC18F85J10 PIC18F67J10 PIC18F66J15 PIC18F66J10 PIC18F65J15 PIC18F65J10 PIC18F85J90 Family PIC18F85J90 PIC18F84J90 PIC18F83J90 PIC18F65J90 PIC18F64J90 PIC18F63J90 PIC18F85J11 Family PIC18F85J11 PIC18F84J11 PIC18F83J11 PIC18F65J11 PIC18F64J11 PIC18F63J11 PIC18F45J10 Family PIC18F45J10 PIC18F44J10 PIC18F25J10 PIC18F24J10 PIC18F8621 FamilyMade with Doc-O-Matic.

144 145 146 146 147 148 149 150 150 151 151 152 153 154 154 155 156 157 158 158 158 159 160 161 162 163 163 164 164 165 166 167 168 169 169 170 170 171 172

vii

PIC18 Peripheral Library Help Document PIC18F8621 PIC18F8525 PIC18F6621 PIC18F6525 PIC18F8680 Family PIC18F8680 PIC18F8585 PIC18F6680 PIC18F6585 PIC18F8722 Family PIC18F8722 PIC18F8627 PIC18F8622 PIC18F8527 PIC18F6722 PIC18F6627 PIC18F6622 PIC18F6527 PIC18F8490 Family PIC18F8490 PIC18F8390 PIC18F6490 PIC18F6390 PIC18F8410 Family PIC18F8410 PIC18F8310 PIC18F6410 PIC18F6310 PIC18F4321 Family PIC18F4321 PIC18F4221 PIC18F2321 PIC18F2221 PIC18F4685 Family PIC18F4685 PIC18F4682 PIC18F2685 PIC18F2682 172 173 174 175 176 176 177 178 179 180 180 181 182 182 183 184 184 185 186 186 186 187 188 188 188 189 190 190 191 191 192 193 194 194 195 195 196 197

Made with Doc-O-Matic.

viii

PIC18 Peripheral Library Help Document

PIC18F4680 Family PIC18F4680 PIC18F4585 PIC18F2680 PIC18F2585 PIC18F4620 Family PIC18F4620 PIC18F4525 PIC18F2620 PIC18F2525 PIC18F4610 Family PIC18F4610 PIC18F4515 PIC18F4510 PIC18F4410 PIC18F2610 PIC18F2515 PIC18F2510 PIC18F2410 PIC18F4580 Family PIC18F4580 PIC18F4480 PIC18F2580 PIC18F2480 PIC18F4550 Family PIC18F4550 PIC18F4455 PIC18F2550 PIC18F2455 PIC18F4450 Family PIC18F4450 PIC18F2450 PIC18F4523 Family PIC18F4523 PIC18F4423 PIC18F2523 PIC18F2423 PIC18F4520 FamilyMade with Doc-O-Matic.

197 198 198 199 200 200 201 201 202 203 204 204 205 206 207 208 208 209 210 211 211 212 213 213 214 214 215 216 217 218 218 219 220 220 221 222 223 224

ix

PIC18 Peripheral Library Help Document PIC18F4520 PIC18F4420 PIC18F2520 PIC18F2420 PIC18F4320 Family PIC18F4320 PIC18F4220 PIC18F2320 PIC18F2220 PIC18F1330 Family PIC18F1330 PIC18F1230 PIC18F1320 Family PIC18F1320 PIC18F1220 PIC18F8720 Family PIC18F8720 PIC18F8620 PIC18F8520 PIC18F6720 PIC18F6620 PIC18F6520 PIC18C858 Family PIC18C858 PIC18C658 PIC18C801 Family PIC18C801 PIC18C601 PIC18F4539 Family PIC18F4539 PIC18F4439 PIC18F2539 PIC18F2439 PIC18F458 Family PIC18F458 PIC18F448 PIC18F258 PIC18F248Made with Doc-O-Matic.

224 225 226 227 228 228 228 229 230 230 230 231 232 232 232 233 233 234 235 236 237 238 239 239 240 241 241 242 243 244 245 246 247 248 248 248 249 250

x

PIC18 Peripheral Library Help Document

PIC18F452 Family PIC18F452 PIC18F442 PIC18F252 PIC18F242 PIC18C452 Family PIC18C452 PIC18C442 PIC18C252 PIC18C242 PIC18F45K22 Family PIC18F45K22 PIC18LF45K22 PIC18F44K22 PIC18LF44K22 PIC18F43K22 PIC18LF43K22 PIC18F46K22 PIC18LF46K22 PIC18F26K22 PIC18LF26K22 PIC18F25K22 PIC18LF25K22 PIC18F24K22 PIC18LF24K22 PIC18F23K22 PIC18LF23K22

251 251 252 253 254 254 255 256 257 258 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274

Device Modules18F66K80 Family ADC (66K80 Set) Analog Comparator (66K80 Set) CTMU (66K80 Set) Input Capture (66K80 Set) Output Compare (66K80 Set) PWM (66K80 Set) I2C (66K80 Family) I2C EEPROM (66K80 Family) EEP (66K80 Set)

275275 275 276 277 277 278 279 279 280 281

Made with Doc-O-Matic.

xi

PIC18 Peripheral Library Help Document IO Ports (66K80 Set) MWIRE (66K80 Family) SPI (66K80 Family) SW_RTCC (66K80 Family) Timers (66K80 Set) Flash (66K80 Family) USART (66K80 Set) Deep Sleep (66K80 Family) 18F47J53 Family PIC18F2xJ53 Set ADC (2xJ53 Family) Analog Comparator (2xJ53 Set) CTMU (2xJ53 Family) PPS (2xJ53 Family) Deep Sleep (2xJ53 Family) Input Capture (2xJ53 Set) Output Compare (2xJ53 Set) PWM (2xJ53 Set) I2C EEPROM (2xJ53 Family) SPI (2xJ53 Family) IO Ports (2xJ53 Family) RTCC (2xJ53 Family) SW_RTCC (2xJ53 Family) Timers (2xJ53 Set) USART (2xJ53 Family) MWIRE (2xJ53 Family) Flash (2xJ53 Set) PIC18F4xJ53 Set ADC (4xJ53 Family) Analog Comparator (4xJ53 Set) CTMU (4xJ53 Family) PPS (4xJ53 Family) Deep Sleep (4xJ53 Family) Input Capture (4xJ53 Set) Output Compare (4xJ53 Set) PWM (4xJ53 Set) I2C (4xJ53 Family) I2C EEPROM (4xJ53 Family) SPI (4xJ53 Family) IO Ports (4xJ53 Family) 281 282 282 283 283 284 285 286 286 287 287 287 288 289 289 289 290 291 292 293 294 294 296 296 297 298 299 299 300 300 301 301 302 302 303 304 305 306 307 308

Made with Doc-O-Matic.

xii

PIC18 Peripheral Library Help Document RTCC (4xJ53 Family) SW_RTCC (4xJ53 Family) Timers (4xJ53 Set) USART (4xJ53 Family) MWIRE (4xJ53 Family) Flash (4xJ53 Set) PMP (4xJ53 Family) 18F97J72 Family ADC (97J72 Family) Analog Comparator (97J72 Family) CTMU (97J72 Family) Input Capture (97J72 Family) Output Compare (97J72 Family) PWM (97J72 Family) I2C (97J72 Family) I2C EEPROM (97J72 Family) IO Ports (97J72 Family) RTCC (97J72 Family) SW_RTCC (97J72 Family) SPI (97J72 Family) Timers (97J72 Family) USART (97J72 Family) MWIRE (97J72 Family) Flash (97J72 Family) 18F87K90/22 Family PIC18F6xK90 Set PIC18F6xK90_non_32 ADC (6xK90 Set) Analog Comparator (6xK50 Set) CTMU (6xK90 Set) Input Capture (6xK90 Set) Output Compare (6xK90 Set) PWM (6xK90 Set) I2C (6xK90 Set) I2C EEPROM (6xK90 Set) EEP (6xK90 Set) IO Ports (6xK90 Set) MWIRE (6xK90 Set) RTCC (6xK90 Set) SW_RTCC (6xK90 Set) 308 310 310 311 312 313 314 315 315 316 316 317 317 318 318 319 320 320 322 322 323 324 325 325 326 326 326 326 328 329 330 331 331 332 334 334 335 335 336 337

Made with Doc-O-Matic.

xiii

PIC18 Peripheral Library Help Document SPI (6xK90 Set) USART (6xK90 Set) Timers (6xK90 Set) Flash (6xK90) PIC18F6xK90_32 ADC (65K90 Set) Analog Comparator (65K90 Set) CTMU (65K90 Set) Input Capture (65K90 Set) Output Compare (65K90 Set) PWM (65K90 Set) I2C (65K90 Set) I2C EEPROM (65K90 Set) EEP (65K90 Set) IO Ports (65K90 Set) MWIRE (65K90 Set) RTCC (65K90 Set) SW_RTCC (65K90 Set) SPI (65K90 Set) USART (65K90 Set) Timers (65K90 Set) Flash (65K90 Set) PIC18F8xK90 Set PIC18F8xK90_non_32 ADC (8xK90 Set) Analog Comparator (8xK90 Set) CTMU (8xK90 Set) Input Capture (8xK90 Set) Output Compare (8xK90 Set) PWM (8xK90 Set) I2C (8xK90 Set) I2C EEPROM (8xK90 Set) EEP (8xK90 Set) IO Ports (8xK90 Set) MWIRE (8xK90 Set) RTCC (8xK90 Set) SW_RTCC (8xK90 Set) SPI (8xK90 Set) USART (8xK90 Set) Timers (8xK90 Set) Flash (8xK90 Set)Made with Doc-O-Matic.

338 339 340 341 342 342 343 344 345 345 346 347 348 349 349 350 351 352 352 353 354 356 356 356 356 357 357 358 359 360 361 362 363 363 364 365 366 366 367 368 370

xiv

PIC18 Peripheral Library Help Document PIC18F8xK90_32 ADC (85K90 Set) Analog Comparator (85K90 Set) CTMU (85K90 Set) Input Capture (85K90 Set) Output Compare (85K90 Set) PWM (85K90 Set) I2C (85K90 Set) I2C EEPROM (85K90 Set) EEP (85K90 Set) IO Ports (85K90 Set) MWIRE (85K90 Set) RTCC (85K90 Set) SW_RTCC (85K90 Set) SPI (853K90 Set) USART (85K90 Set) Timers (85K90 Set) Flash (85K90 Set) 18F87J90 Family ADC (87J90 Family) Analog Comparator (87J90 Family) CTMU (87J90 Family) Input Capture (87J90 Family) Output Compare (87J90 Family) PWM (87J90 Family) I2C (87J90 Family) I2C EEPROM (87J90 Family) IO Ports (87J90 Family) RTCC (87J90 Family) SW_RTCC (87J90 Family) SPI (87J90 Family) Timers (87J90 Family) USART (87J90 Family) MWIRE (87J90 Family) Flash (87J90 Family) 18F87J93 Family ADC (87J93 Family) Analog Comparator (87J93 Family) CTMU (87J93 Family) Input Capture (87J93 Family) 370 370 371 371 372 373 374 374 376 376 377 377 378 379 380 381 382 383 384 384 384 385 385 386 386 387 388 388 389 390 390 391 392 393 394 394 394 395 395 396

Made with Doc-O-Matic.

xv

PIC18 Peripheral Library Help Document Output Compare (87J93 Family) PWM (87J93 Family) I2C (87J93 Family) I2C EEPROM (87J93 Family) SPI (87J93 Family) IO Ports (87J93 Family) RTCC (87J93 Family) SW_RTCC (87J93 Family) Timers (87J93 Family) USART (87J93 Family) MWIRE (87J93 Family) Flash (87J93 Family) 18F/LF46J50 Family PIC18F/LF26J50 Set ADC (2xJ50 Family) Analog Comparator (2xJ50 Family) CTMU (2xJ50 Family) Deep Sleep (2xJ50 Family) PPS (2xJ50 Family) Input Capture (2xJ50 Family) Output Compare (2xJ50 Family) PWM (2xJ50 Family) I2C (2xJ50 Family) I2C EEPROM (2xJ50 Family) SPI (2xJ50 Family) IO Ports (2xJ50 Family) RTCC (2xJ50 Family) SW_RTCC (2xJ50 Family) Timers (2xJ50 Family) USART (2xJ50 Family) MWIRE (2xJ50 Family) Flash (2xJ50 Set) PIC18F/LF46J50 Set ADC (4xJ50 Family) Analog Comparator (4xJ50 Family) CTMU (4xJ50 Family) Deep Sleep (4xJ50 Family) PPS (4xJ50 Family) Input Capture (4xJ50 Family) Output Compare (4xJ50 Family) 397 397 397 398 399 400 400 402 402 403 404 404 405 405 405 406 406 407 408 408 408 409 409 410 410 412 412 414 414 415 416 416 417 417 418 418 419 419 420 420

Made with Doc-O-Matic.

xvi

PIC18 Peripheral Library Help Document PWM (4xJ50 Family) I2C (4xJ50 Family) I2C EEPROM (4xJ50 Family) IO Ports (4xJ50 Family) RTCC (4xJ50 Family) SW_RTCC (4xJ50 Family) SPI (4xJ50 Family) Timers (4xJ50 Family) USART (4xJ50 Family) PMP (4xJ50 Family) MWIRE (4xJ50 Family) Flash (4xJ50 Set) 18F/LF46J11 Family PIC18F/LF26J11 Set ADC (2xJ11 Family) Analog Comparator (2xJ11 Family) CTMU (2xJ11 Family) Deep Sleep (2xJ11 Family) PPS (2xJ11 Family) Input Capture (2xJ11 Family) Output Compare (2xJ11 Family) PWM (2xJ11 Family) I2C (2xJ11 Family) I2C EEPROM (2xJ11 Family) IO Ports (2xJ11 Family) RTCC (2xJ11 Family) SW_RTCC (2xJ11 Family) SPI (2xJ11 Family) Timers (2xJ11 Family) USART (2xJ11 Family) MWIRE (2xJ11 Family) Flash (2xJ11 Set) PIC18F/LF46J11 Set ADC (4xJ11 Family) Analog Comparator (4xJ11 Family) CTMU (4xJ11 Family) Deep Sleep (4xJ11 Family) PPS (4xJ11 Family) Input Capture (4xJ11 Family) Output Compare (4xJ11 Family) 420 421 422 423 424 425 425 426 427 428 430 430 431 431 431 432 432 433 434 434 434 435 435 436 436 437 438 439 440 441 442 442 443 443 444 444 445 445 446 446

Made with Doc-O-Matic.

xvii

PIC18 Peripheral Library Help Document PWM (4xJ11 Family) I2C (4xJ11 Family) I2C EEPROM (4xJ11 Family) IO Ports (4xJ11 Family) RTCC (4xJ11 Family) SW_RTCC (4xJ11 Family) SPI (4xJ11 Family) Timers (4xJ11 Family) USART (4xJ11 Family) PMP (4xJ11 Family) MWIRE (4xJ11 Family) Flash (4xJ11 Set) 18F/LF14K50 Family ADC (14K50 Family) Analog Comparator (14K50 Family) Input Capture (14K50 Family) Output Compare (14K50 Family) PWM (14K50 Family) I2C (14K50 Family) I2C EEPROM (14K50 Family) EEP (14K50 Family) IO Ports (14K50 Family) SW_RTCC (14K50 Family) SPI (14K50 Family) Timers (14K50 Family) USART (14K50 Family) MWIRE (14K50 Family) Flash (14K50 Family) 18F/LF14K22 Family ADC (14K22 Family) Analog Comparator (14K22 Family) Input Capture (14K22 Family) Output Compare (14K22 Family) PWM (14K22 Family) I2C (14K22 Family) I2C EEPROM (14K22 Family) EEP (14K22 Family) IO Ports (14K22 Family) SW_RTCC (14K22 Family) SPI (14K22 Family) 446 447 448 449 449 451 451 452 453 454 455 456 457 457 458 458 458 459 459 460 461 461 462 462 463 464 464 465 465 466 466 467 467 467 468 469 469 469 470 470

Made with Doc-O-Matic.

xviii

PIC18 Peripheral Library Help Document Timers (14K22 Family) USART (14K22 Family) MWIRE (14K22 Family) Flash (14K22 Family) 18F4553 Family ADC (4553 Family) Analog Comparator (4553 Family) Input Capture (4553 Family) Output Compare (4553 Family) PWM (4553 Family) I2C (4553 Family) I2C EEPROM (4553 Family) EEP (4553 Family) IO Ports (4553 Family) SW_RTCC (4553 Family) SPI (4553 Family) Timers (4553 Family) USART (4553 Family) MWIRE (4553 Family) Flash (4553 Family) 18F8493 Family ADC (8493 Family) Analog Comparator (8493 Family) Input Capture (8493 Family) Output Compare (8493 Family) PWM (8493 Family) I2C (8493 Family) I2C EEPROM (8493 Family) IO Ports (8493 Family) SW_RTCC (8493 Family) SPI (8493 Family) Timers (8493 Family) USART (8493 Family) MWIRE (8493 Family) Flash (8493 Family) 18F8723 Family ADC (8723 Family) Analog Comparator (8723 Family) Input Capture (8723 Family) Output Compare (8723 Family)Made with Doc-O-Matic.

471 472 473 473 474 474 475 475 475 476 476 477 477 478 478 479 480 480 481 482 482 482 483 483 484 484 485 485 486 487 487 488 489 490 490 491 491 491 492 492

xix

PIC18 Peripheral Library Help Document PWM (8723 Family) I2C (8723 Family) I2C EEPROM (8723 Family) EEP (8723 Family) IO Ports (8723 Family) SW_RTCC (8723 Family) SPI (8723 Family) Timers (8723 Family) USART (8723 Family) MWIRE (8723 Family) Flash (8723 Family) 18F84J15 Family ADC (84J15 Family) Analog Comparator (84J15 Family) Input Capture (84J15 Family) Output Compare (84J15 Family) PWM (84J15 Family) I2C (84J15 Family) I2C EEPROM (84J15 Family) IO Ports (84J15 Family) SW_RTCC (84J15 Family) SPI (84J15 Family) Timers (84J15 Family) USART (84J15 Family) MWIRE (84J15 Family) Flash (84J15 Family) 18F87J50 Family ADC (87J50 Family) Analog Comparator (87J50 Family) Input Capture (87J50 Family) Output Compare (87J50 Family) PWM (87J50 Family) I2C (87J50 Family) I2C EEPROM (87J50 Family) IO Ports (87J50 Family) SW_RTCC (87J50 Family) SPI (87J50 Family) Timers (87J50 Family) USART (87J50 Family) MWIRE (87J50 Family) 493 493 495 495 496 496 497 498 499 500 501 501 501 502 502 503 503 504 505 506 507 507 508 509 510 511 511 511 512 513 513 514 515 516 517 517 518 519 520 521

Made with Doc-O-Matic.

xx

PIC18 Peripheral Library Help Document Flash (87J50 Family) 18F87J11 Family ADC (87J11 Family) Analog Comparator (87J11 Family) Input Capture (87J11 Family) Output Compare (87J11 Family) PWM (87J11 Family) I2C (87J11 Family) I2C EEPROM (87J11 Family) IO Ports (87J11 Family) SW_RTCC (87J11 Family) SPI (87J11 Family) Timers (87J11 Family) USART (87J11 Family) MWIRE (87J11 Family) Flash (87J11 Family) 18F46K20 Family ADC (46K20 Family) Analog Comparator (46K20 Family) Input Capture (46K20 Family) Output Compare (46K20 Family) PWM (46K20 Family) I2C (46K20 Family) I2C EEPROM (46K20 Family) EEP (46K20 Family) IO Ports (46K20 Family) SW_RTCC (46K20 Family) SPI (46K20 Family) Timers (46K20 Family) USART (46K20 Family) MWIRE (46K20 Family) Flash (46K20 Family) 18F97J60 Family PIC18F67J60 Set ADC (67J60 Family) Analog Comparator (67J60 Family) Input Capture (67J60 Family) Output Compare (67J60 Family) PWM (67J60 Family) I2C (67J60 Family)Made with Doc-O-Matic.

521 522 522 523 523 524 524 525 526 527 528 528 529 530 531 532 533 533 533 534 534 535 535 536 536 537 537 538 539 539 540 541 541 542 542 542 543 543 544 544

xxi

PIC18 Peripheral Library Help Document I2C EEPROM (67J60 Family) IO Ports (67J60 Family) SW_RTCC (67J60 Family) SPI (67J60 Family) Timers (67J60 Family) USART (67J60 Family) MWIRE (67J60 Family) Flash (67J60 Set) PIC18F87J60 Set ADC (87J60 Family) Analog Comparator (87J60 Family) Input Capture (87J60 Family) Output Compare (87J60 Family) PWM (87J60 Family) I2C (87J60 Family) I2C EEPROM (87J60 Family) IO Ports (87J60 Family) SW_RTCC (87J60 Family) SPI (87J60 Family) Timers (87J60 Family) USART (87J60 Family) MWIRE (87J60 Family) Flash (87J60 Set) PIC18F97J60 Set ADC (97J60 Family) Analog Comparator (97J60 Family) Input Capture (97J60 Family) Output Compare (97J60 Family) PWM (97J60 Family) I2C (97J60 Family) I2C EEPROM (97J60 Family) IO Ports (97J60 Family) SW_RTCC (97J60 Family) SPI (97J60 Family) Timers (97J60 Family) USART (97J60 Family) MWIRE (97J60 Family) Flash (97J60 Set) 18F87J10 Family ADC (87J10 Family) 545 546 546 547 548 549 549 550 551 551 551 552 552 553 553 554 555 555 556 557 558 559 559 560 560 561 561 562 562 563 564 565 565 565 567 567 568 569 570 570

Made with Doc-O-Matic.

xxii

PIC18 Peripheral Library Help Document Analog Comparator (87J10 Family) Input Capture (87J10 Family) Output Compare (87J10 Family) PWM (87J10 Family) I2C (87J10 Family) I2C EEPROM (87J10 Family) IO Ports (87J10 Family) SW_RTCC (87J10 Family) SPI (87J10 Family) Timers (87J10 Family) USART (87J10 Family) MWIRE (87J10 Family) Flash (87J10 Family) 18F85J90/11 Family ADC (85J90/11 Family) Analog Comparator (85J90/11 Family) Input Capture (85J90/11 Family) Output Compare (85J90/11 Family) PWM (85J90/11 Family) I2C (85J90/11 Family) I2C EEPROM (85J90/11 Family) IO Ports (85J90/11 Family) SW_RTCC (85J90/11 Family) SPI (85J90/11 Family) Timers (85J90/11 Family) USART (85J90/11 Family) MWIRE (85J90/11 Family) Flash (85J90/11 Family) 18F8621 Family ADC (8621 Family) Analog Comparator (8621 Family) Input Capture (8621 Family) Output Compare (8621 Family) PWM (8621 Family) I2C (8621 Family) I2C EEPROM (8621 Family) EEP (8621 Family) IO Ports (8621 Family) SW_RTCC (8621 Family) SPI (8621 Family) 571 571 572 572 573 574 575 576 576 577 578 579 580 580 581 581 582 582 582 583 584 584 585 585 586 587 588 588 589 589 590 590 591 591 592 593 593 594 594 595

Made with Doc-O-Matic.

xxiii

PIC18 Peripheral Library Help Document Timers (8621 Family) USART (8621 Family) MWIRE (8621 Family) Flash (8621Family) 18F8680 Family ADC (8680 Family) Analog Comparator (8680 Family) Input Capture (8680 Family) Output Compare (8680 Family) PWM (8680 Family) I2C (8680 Family) I2C EEPROM (8680 Family) SPI (8680 Family) EEP (8680 Family) SW_RTCC (8680 Family) IO Ports (8680 Family) Timers (8680 Family) USART (8680 Family) MWIRE (8680 Family) Flash (8680 Family) 18F8722 Family ADC (8722 Family) Analog Comparator (8722 Family) Input Capture (8722 Family) Output Compare (8722 Family) PWM (8722 Family) I2C (8722 Family) I2C EEPROM (8722 Family) SPI (8722 Family) EEP (8722 Family) IO Ports (8722 Family) SW_RTCC (8722 Family) Timers (8722 Family) USART (8722 Family) MWIRE (8722 Family) Flash (8722 Family) 18F8490 Family ADC (8490 Family) Analog Comparator (8490 Family) Input Capture (8490 Family)Made with Doc-O-Matic.

596 597 598 598 599 599 600 600 600 601 601 602 602 603 604 604 605 605 606 607 607 607 608 608 609 610 610 612 612 613 614 614 615 616 617 617 618 618 619 619

xxiv

PIC18 Peripheral Library Help Document Output Compare (8490 Family) PWM (8490 Family) I2C (8490 Family) I2C EEPROM (8490 Family) SPI (8490 Family) SW_RTCC (8490 Family) IO Ports (8490 Family) Timers (8490 Family) USART (8490 Family) MWIRE (8490 Family) Flash (8490 Family) 18F8410 Family ADC (8410 Family) Analog Comparator (8410 Family) Input Capture (8410 Family) Output Compare (8410 Family) PWM (8410 Family) I2C (8410 Family) I2C EEPROM (8410 Family) SPI (8410 Family) IO Ports (8410 Family) SW_RTCC (8410 Family) Timers (8410 Family) USART (8410 Family) MWIRE (8410 Family) Flash (8410 Family) 18F4321 Family PIC18F4x21 Set ADC (4x21 Family) Analog Comparator (4x21 Family) Input Capture (4x21 Family) Output Compare (4x21 Family) PWM (4x21 Family) I2C (4x21 Family) I2C EEPROM (4x21 Family) SPI (4x21 Family) IO Ports (4x21 Family) SW_RTCC (4x21 Family) EEP (4x21 Family) Timers (4x21 Family) 619 620 620 621 622 622 623 623 624 625 626 626 626 627 627 628 628 629 630 630 631 632 632 633 634 634 635 635 635 636 636 636 637 637 638 638 639 640 640 640

Made with Doc-O-Matic.

xxv

PIC18 Peripheral Library Help Document USART (4x21 Family) MWIRE (4x21 Family) Flash (4x21 Family) PIC18F2x21 Set ADC (2x21 Family) Analog Comparator (2x21 Family) Input Capture (2x21 Family) Output Compare (2x21 Family) PWM (2x21 Family) I2C (2x21 Family) I2C EEPROM (2x21 Family) SPI (2x21 Family) IO Ports (2x21 Family) EEP (2x21 Family) SW_RTCC (2x21 Family) Timers (2x21 Family) USART (2x21 Family) MWIRE (2x21 Family) Flash (2x21 Family) 18F4x80/5 Family PIC18F4x80/5 Set ADC (4x8x Family) Analog Comparator (4x8x Family) Input Capture (4x8x Family) Output Compare (4x8x Family) PWM (4x8x Family) I2C (4x8x Family) I2C EEPROM (4x8x Family) SPI (4x8x Family) EEP (4x8x Family) SW_RTCC (4x8x Family) IO Ports (4x8x Family) Timers (4x8x Family) USART (4x8x Family) MWIRE (4x8x Family) Flash (4x80/5 Family) PIC18F2x80/5 Set ADC (2x8x Family) Input Capture (2x8x Family) Output Compare (2x8x Family) 641 642 642 643 643 644 644 644 645 645 646 646 647 648 648 648 649 650 650 651 652 652 652 653 653 654 654 655 655 656 656 657 657 658 659 659 660 660 661 661

Made with Doc-O-Matic.

xxvi

PIC18 Peripheral Library Help Document PWM (2x8x Family) I2C (2x8x Family) I2C EEPROM (2x8x Family) SPI (2x8x Family) EEP (2x8x Family) IO Ports (2x8x Family) SW_RTCC (2x8x Family) Timers (2x8x Family) USART (2x8x Family) MWIRE (2x8x Family) Flash (2x80/5 Family) 18F4610 Family PIC18F4610 Set ADC (4610 Family) Analog Comparator (4610 Family) Input Capture (4610 Family) Output Compare (4610 Family) PWM (4610 Family) I2C (4610 Family) I2C EEPROM (4610 Family) SPI (4610 Family) IO Ports (4610 Family) SW_RTCC (4610 Family) Timers (4610 Family) USART (4610 Family) MWIRE (4610 Family) Flash (4610Family) PIC18F2610 Set ADC (2610 Family) Analog Comparator (2610 Family) Input Capture (2610 Family) Output Compare (2610 Family) PWM (2610 Family) I2C (2610 Family) I2C EEPROM (2610 Family) SPI (2610 Family) IO Ports (2610 Family) SW_RTCC (2610 Family) Timers (2610 Family) USART (2610 Family) 661 662 663 663 664 664 665 665 666 667 667 668 668 668 669 669 669 670 670 671 671 672 673 673 674 674 675 675 676 676 676 677 677 678 678 679 680 680 681 681

Made with Doc-O-Matic.

xxvii

PIC18 Peripheral Library Help Document MWIRE (2610 Family) Flash (2610 Family) 18F4620 Family PIC18F4620 Set ADC (4620 Family) Analog Comparator (4620 Family) Input Capture (4620 Family) Output Compare (4620 Family) PWM (4620 Family) I2C (4620 Family) I2C EEPROM (4620 Family) SPI (4620 Family) EEP (4620 Family) IO Ports (4620 Family) SW_RTCC (4620 Family) Timers (4620 Family) USART (4620 Family) MWIRE (4620 Family) Flash (4620Family) PIC18F2620 Set ADC (2620 Family) Analog Comparator (2620 Family) Input Capture (2620 Family) Output Compare (2620 Family) I2C (2620 Family) I2C EEPROM (2620 Family) SPI (2620 Family) PWM (2620 Family) EEP (2620 Family) IO Ports (2620 Family) SW_RTCC (2620 Family) Timers (2620 Family) USART (2620 Family) MWIRE (2620 Family) Flash (2620 Family) 18F4550/23/20 Family ADC (45xx Family) Analog Comparator (45xx Family) Input Capture (45xx Family) Output Compare (45xx Family) 682 683 683 683 683 684 684 685 685 685 686 687 687 688 688 689 689 690 691 691 691 692 692 693 693 694 694 695 695 696 696 697 698 698 699 699 700 700 701 701

Made with Doc-O-Matic.

xxviii

PIC18 Peripheral Library Help Document PWM (45xx Family) I2C (45xx Family) I2C EEPROM (45xx Family) SPI (45xx Family) IO Ports (45xx Family) EEP (45xx Family) SW_RTCC (45xx Family) Timers (45xx Family) USART (45xx Family) MWIRE (45xx Family) Flash (45xx Family) 18F4450 Family ADC (4450 Family) Input Capture (4450 Family) Output Compare (4450 Family) PWM (4450 Family) IO Ports (4450 Family) SW_RTCC (4450 Family) Timers (4450 Family) USART (4450 Family) Flash (4450 Family) 18F4320 Family ADC (4320 Family) Analog Comparator (4320 Family) Input Capture (4320 Family) Output Compare (4320 Family) PWM (4320 Family) I2C (4320 Family) I2C EEPROM (4320 Family) SPI (4320 Family) IO Ports (4320 Family) EEP (4320 Family) SW_RTCC (4320 Family) Timers (4320 Family) USART (4320 Family) MWIRE (4320 Family) Flash (4320 Family) 18F8720 Family ADC (8720 Family) Analog Comparator (8720 Family)Made with Doc-O-Matic.

702 702 703 703 704 705 705 706 706 707 708 708 708 709 709 710 710 711 711 712 712 713 713 714 714 715 715 715 716 717 718 718 719 719 720 720 721 722 722 722

xxix

PIC18 Peripheral Library Help Document Input Capture (8720 Family) Output Compare (8720 Family) PWM (8720 Family) I2C (8720 Family) I2C EEPROM (8720 Family) SPI (8720 Family) IO Ports (8720 Family) EEP (8720 Family) SW_RTCC (8720 Family) Timers (8720 Family) USART (8720 Family) MWIRE (8720 Family) Flash (8720 Family) 18C858 Family ADC (858 Family) Analog Comparator (858 Family) Input Capture (858 Family) Output Compare (858 Family) PWM (858 Family) I2C (858 Family) I2C EEPROM (858 Family) SPI (858 Family) IO Ports (858 Family) SW_RTCC (858 Family) Timers (858 Family) USART (858 Family) MWIRE (858 Family) 18C801 Family ADC (801 Family) Input Capture (801 Family) Output Compare (801 Family) PWM (801 Family) I2C (801 Family) I2C EEPROM (801 Family) SPI (801 Family) IO Ports (801 Family) SW_RTCC (801 Family) Timers (801 Family) USART (801 Family) MWIRE (801 Family) 723 723 724 725 725 726 727 727 728 728 729 730 730 731 731 732 732 732 733 733 734 735 735 736 736 737 738 738 739 739 740 740 740 741 742 743 743 744 744 745

Made with Doc-O-Matic.

xxx

PIC18 Peripheral Library Help Document

18F4539 Family ADC (4539 Family) I2C (4539 Family) I2C EEPROM (4539 Family) SPI (4539 Family) IO Ports (4539 Family) EEP (4539 Family) SW_RTCC (4539 Family) Timers (4539 Family) USART (4539 Family) MWIRE (4539 Family) Flash (4539 Family) 18F452 Family ADC (F452 Family) Input Capture (F452 Family) Output Compare (F452 Family) PWM (F452 Family) I2C (F452 Family) I2C EEPROM (F452 Family) SPI (F452 Family) IO Ports (F452 Family) EEP (F452 Family) SW_RTCC (F452 Family) Timers (F452 Family) USART (F452 Family) MWIRE (F452 Family) Flash (F452 Family) 18C452 Family ADC (C452 Family) Input Capture (C452 Family) Output Compare (C452 Family) PWM (C452 Family) I2C (C452 Family) I2C EEPROM (C452 Family) SPI (C452 Family) IO Ports (C452 Family) SW_RTCC (C452 Family) Timers (C452 Family) USART (C452 Family) MWIRE (C452 Family)Made with Doc-O-Matic.

746 746 746 747 748 749 749 750 750 751 751 752 753 753 753 754 754 755 755 756 757 757 758 758 759 760 760 761 761 762 762 762 763 764 764 765 766 766 767 767

xxxi

PIC18 Peripheral Library Help Document

18F458 Family PIC18F258 Set ADC (258 Family) Input Capture (258 Family) Output Compare (258 Family) PWM (258 Family) I2C (258 Family) I2C EEPROM (258 Family) SPI (258 Family) IO Ports (258 Family) EEP (258 Family) SW_RTCC (258 Family) Timers (258 Family) USART (258 Family) MWIRE (258 Family) Flash (258 Family) PIC18F458 Set ADC (458 Family) Analog Comparator (258 Family) Input Capture (458 Family) Output Compare (458 Family) PWM (458 Family) I2C (458 Family) I2C EEPROM (458 Family) SPI (458 Family) IO Ports (458 Family) EEP (458 Family) SW_RTCC (458 Family) Timers (458 Family) USART (458 Family) MWIRE (458 Family) Flash (458 Family) 18F1320 Family ADC (1320 Family) Input Capture (1320 Family) Output Compare (1320 Family) PWM (1320 Family) IO Ports (1320 Family) EEP (1320 Family) SW_RTCC (1320 Family)

768 768 768 769 769 770 770 771 771 772 773 773 773 774 775 775 776 776 777 777 777 778 778 779 779 780 781 781 781 782 783 783 784 784 785 785 785 786 786 787

Made with Doc-O-Matic.

xxxii

PIC18 Peripheral Library Help Document Timers (1320 Family) USART (1320 Family) Flash (1320 Family) 18F45J10 Family PIC18F45J10 Set ADC (45J10 Family) Analog Comparator (45J10 Family) Input Capture (45J10 Family) Output Compare (45J10 Family) PWM (45J10 Family) I2C (45J10 Family) I2C EEPROM (45J10 Family) SPI (45J10 Family) IO Ports (45J10 Family) SW_RTCC (45J10 Family) Timers (45J10 Family) USART (45J10 Family) MWIRE (45J10 Family) Flash (45J10 Family) PIC18F25J10 Set ADC (25J10 Family) Analog Comparator (25J10 Family) Input Capture (25J10 Family) Output Compare (25J10 Family) PWM (25J10 Family) I2C (25J10 Family) I2C EEPROM (25J10 Family) SPI (25J10 Family) IO Ports (25J10 Family) SW_RTCC (25J10 Family) Timers (25J10 Family) USART (25J10 Family) MWIRE (25J10 Family) Flash (25J10 Family) 18F1330 Family ADC (1330 Family) PCPWM (1330 Family) EEP (1330 Family) IO Ports (1330 Family) SW_RTCC (1330 Family) 787 788 789 789 789 789 790 790 791 791 791 793 793 795 795 795 796 797 798 798 798 799 799 799 800 800 801 802 803 803 804 804 805 806 806 806 807 808 808 809

Made with Doc-O-Matic.

xxxiii

PIC18 Peripheral Library Help Document Timers (1330 Family) USART (1330 Family) Flash (1330 Family) 18F4431 Family PIC18F4431 Set ADC (4431 Family) Input Capture (4431 Family) Output Compare (4431 Family) PWM (4431 Family) PCPWM (4431 Family) I2C (4431 Family) SPI (4431 Family) IO Ports (4431 Family) EEP (4431 Family) Timers (4431 Family) SW_RTCC (4431 Family) USART (4431 Family) MWIRE (4431 Family) Flash (4431 Family) PIC18F2431 Set ADC (2431 Family) Input Capture (2431 Family) Output Compare (2431 Family) PWM (2431 Family) PCPWM (2431 Family) I2C (2431 Family) SPI (2431 Family) IO Ports (2431 Family) EEP (2431 Family) SW_RTCC (2431 Family) Timers (2431 Family) USART (2431 Family) MWIRE (2431 Family) Flash (2431 Family) 18F45K22 Family ADC (45K22 Set) Analog Comparator (45K22 Family) CTMU (45K22 Set) Input Capture (45K22 Set) Output Compare (45K22 Set) 809 810 810 811 811 811 812 812 813 813 814 815 815 816 816 817 817 818 819 819 819 820 820 821 821 822 822 823 824 824 824 825 826 826 827 827 828 829 830 830

Made with Doc-O-Matic.

xxxiv

PIC18 Peripheral Library Help Document PWM (45K22 Set) I2C (45K22 Family) I2C EEPROM (44K22 Family) SPI (45K22 Family) IO Ports (45K22 Family) EEP (45K22 Set) MWIRE (45K22 Family) SW_RTCC (45K22 Family) Timers (45K22 Set) Flash (45K22 Family) USART (45K22 Set) 831 832 833 834 835 835 836 837 837 838 839

ModulesA/D Converter (ADC) ADC Functions Open_ADC OpenADC_Page1 OpenADC_Page2 OpenADC_Page3 OpenADC_Page4 OpenADC_Page5 OpenADC_Page6 OpenADC_Page7 OpenADC_Page8 OpenADC_Page9 OpenADC_Page10 OpenADC_Page11 OpenADC_Page12 OpenADC_Page13 OpenADC_Page14 OpenADC_Page15 OpenADC_Page16 OpenADC_Page17 SetChan_ADC SetChanADC_Page1 SetChanADC_Page2 SetChanADC_Page3 SetChanADC_Page4 SetChanADC_Page5 SetChanADC_Page6

840840 840 840 840 842 844 846 848 851 854 855 858 860 862 865 867 870 873 876 879 882 882 883 884 885 886 887

Made with Doc-O-Matic.

xxxv

PIC18 Peripheral Library Help Document SetChanADC_Page7 SetChanADC_Page8 SelChanConv_ADC SelChanConvADC_Page1 SelChanConvADC_Page2 SelChanConvADC_Page3 SelChanConvADC_Page4 SelChanConvADC_Page5 SelChanConvADC_Page6 SelChanConvADC_Page7 SelChanConvADC_Page8 Convert_ADC Busy_ADC Read_ADC Close_ADC ADC Structs,Records,Enums ADC Macros ADC Examples ADC Example 1 Analog Comparator (ANCOMP) Comparator Functions Open_ANCOMP Open_ancomp_Page1 Open_ancomp1_Page1 Open_ancomp1_Page2 Open_ancomp1_Page3 Open_ancomp1_Page4 Open_ancomp1_Page5 Open_amcomp2_Page1 Open_ancomp2_Page2 Open_ancomp2_Page3 Open_ancomp2_Page4 Open_ancomp2_Page5 Open_ancomp3_Page1 Open_ancomp1_Page6 Open_ancomp2_Page6 Open_ancomp3_Page2 Close_ANCOMP Close_ancomp_Page1 Close_ancomp1_Page1 887 889 889 889 890 891 892 893 894 895 896 896 897 897 897 898 898 898 898 899 899 899 899 900 902 904 906 907 909 911 912 914 915 917 918 920 921 922 923 923

Made with Doc-O-Matic.

xxxvi

PIC18 Peripheral Library Help Document Close_ancomp2_Page1 Close_ancomp3_Page1 Comparator Macros Comparator Examples Comparator Example1 Charge Time Measurement Unit ( CTMU ) CTMU Functions Open_CTMU CurrentControl_CTMU Close_CTMU CTMU Macros CTMU Examples CTMU Example1 Deep Sleep (DPSLP) Deep Sleep Functions Goto_DeepSleep DeepSleep_WakeUpSource IsResetFrom_DeepSleep Read_DSGPR ULPWakeUp_Enable DeepSleep Structs,Records,Enums _BOOL Deep Sleep Macros Deep Sleep Examples Deep Sleep Example1 Peripheral Pin Select (PPS) PPS Macros PPS_Input_Page1/2 iPPS_Input_Page1/2 iPPS_Input_Page1/2_1 PPS_Input_Page1/2_1 PPS_Output_Page1 PPS_Output_Page2 iPPS_Output_Page1 iPPS_Output_Page2 iPPS_Input_Page3 PPS_Input_Page3 iPPS_Output_Page3 PPS_Output_Page3 PPS ExamplesMade with Doc-O-Matic.

923 923 924 924 924 925 925 925 927 927 928 928 928 929 929 930 930 931 931 931 932 932 932 932 932 934 935 935 936 938 939 941 942 944 945 947 948 950 951 953

xxxvii

PIC18 Peripheral Library Help Document PPS Example1 Input Capture (INCAP) Input Capture Function Open_Capture Open_Capture1 Open_Capture2 Open_Capture2_Page2 Open_Capture3 Open_Capture3_Page2 Open_Capture4 Open_Capture4_Page2 Open_Capture4_Page3 Open_Capture5 Open_Capture5_Page2 Open_Capture5_Page3 Open_ECapture1 Open_ECapture1_Page2 Open_ECapture1_Page3 Open_ECapture1_Page4 Open_ECapture2_Page1 Open_ECapture2_Page2 Open_ECapture3_Page1 Open_Capture6_Page1 Open_Capture7_Page1 Open_Capture8_Page1 Open_Capture8_Page2 Open_Capture9_Page1 Open_Capture10_Page1 Open_ECapture1_Page5 Open_ECapture2_Page4 Open_ECapture3_Page4 Open_Capture5_Page4 Read_Capture Read_Capture1 Read_Capture2 Read_Capture3 Read_Capture4 Read_Capture5 Read_Capture6 Read_Capture7 953 954 954 954 954 955 956 957 958 959 960 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 983 984 984 984 984 985 985

Made with Doc-O-Matic.

xxxviii

PIC18 Peripheral Library Help Document Read_Capture8 Read_Capture9 Read_Capture10 Read_ECapture1 Read_ECapture2 Read_ECapture3 Close_Capture Close_Capture1 Close_Capture2 Close_Capture3 Close_Capture4 Close_Capture5 Close_Capture6 Close_Capture7 Close_Capture8 Close_Capture9 Close_Capture10 Close_ECapture1 Close_ECapture2 Close_ECapture3 Input Capture Structs, Records, Enums Input Capture Macros Input Capture Examples Input Capture Example1 Output Compare (OCMP) Output Compare Functions Open_Compare Open_Compare1 Open_Compare2 Open_Compare2_Page2 Open_Compare3 Open_Compare3_Page2 Open_Compare4 Open_Compare4_Page2 Open_Compare4_Page3 Open_Compare5 Open_Compare5_Page2 Open_Compare5_Page3 Open_ECompare1 Open_ECompare1_Page2 985 986 986 986 986 987 987 987 987 988 988 988 989 989 989 989 990 990 990 991 991 991 991 991 992 992 992 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004

Made with Doc-O-Matic.

xxxix

PIC18 Peripheral Library Help Document Open_ECompare1_Page3 Open_ECompare1_Page4 Open_ECompare2_Page1 Open_ECompare2_Page2 Open_ECompare3_Page1 Open_Compare6_Page1 Open_Compare7_Page1 Open_Compare8_Page1 Open_Compare8_Page2 Open_Compare9_Page1 Open_Compare10_Page1 Open_ECompare1_Page5 Open_ECompare2_Page4 Open_ECompare3_Page4 Open_Compare4_Page4 Open_Compare5_Page4 Close_Compare Close_Compare1 Close_Compare2 Close_Compare3 Close_Compare4 Close_Compare5 Close_Compare6 Close_Compare7 Close_Compare8 Close_Compare9 Close_Compare10 Close_ECompare1 Close_ECompare2 Close_ECompare3 Output Compare Macros Output Compare Examples Output Compare Example1 Pulse Width Modulation (PWM) PWM Functions Open_PWM Open_PWM1 Open_PWM2 Open_PWM3 Open_PWM3_Page2 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1021 1022 1022 1022 1022 1023 1023 1023 1024 1024 1024 1024 1025 1025 1025 1025 1026 1026 1026 1026 1027 1027 1028

Made with Doc-O-Matic.

xl

PIC18 Peripheral Library Help Document Open_PWM4 Open_PWM4_Page2 Open_PWM4_Page3 Open_PWM2_Page2 Open_PWM5 Open_PWM5_Page2 Open_PWM5_Page3 Open_PWM6_Page1 Open_PWM7_Page1 Open_PWM8_Page1 Open_PWM8_Page2 Open_PWM9_Page1 Open_PWM10_Page1 Open_EPWM1 Open_EPWM1_Page2 Open_EPWM1_Page3 Open_EPWM2_Page1 Open_EPWM2_Page2 Open_EPWM3_Page1 Open_EPWM1_Page4 Open_EPWM2_Page3 Open_EPWM3_Page3 Open_PWM4_Page4 Open_PWM5_Page4 SetOutput_PWM SetOutput_PWM1 SetOutput_PWM2 SetOutput_PWM3 SetOutput_EPWM1 SetOutput_EPWM2_Page1 SetOutput_EPWM3_Page1 SetDC_PWM SetDC_PWM1 SetDC_PWM2 SetDC_PWM3 SetDC_PWM4 SetDC_PWM5 SetDC_PWM6_Page1 SetDC_PWM7_Page1 SetDC_PWM8_Page1 SetDC_PWM9_Page1Made with Doc-O-Matic.

1028 1029 1029 1030 1030 1031 1032 1032 1033 1033 1034 1035 1035 1036 1036 1037 1038 1038 1039 1040 1040 1041 1041 1042 1043 1043 1043 1044 1045 1046 1046 1047 1047 1048 1048 1049 1050 1050 1051 1052 1052

xli

PIC18 Peripheral Library Help Document SetDC_PWM10_Page1 SetDC_EPWM1 SetDC_EPWM2_Page1 SetDC_EPWM3_Page1 Close_PWM Close_PWM1 Close_PWM2 Close_PWM3 Close_PWM4 Close_PWM5 Close_PWM6_Page1 Close_PWM7_Page1 Close_PWM8_Page1 Close_PWM9_Page1 Close_PWM10_Page1 Close_EPWM1 Close_EPWM3_Page1 Close_EPWM2_Page1 PWM Structs,Records,Enums PWM Macros PWM Examples PWM Example1 EEPROM (EEP) EEP Functions Write_Byte_EEP Read_Byte_EEP Busy__EEP EEP Examples EEP Example1 Inter Integrated Circuit Communication (I2C) I2C Functions I2C_Open Open_I2C Open_I2C1 Open_I2C2 I2C_Write Write_I2C Write_I2C1 Write_I2C2 I2C_Read 1053 1054 1054 1055 1056 1056 1056 1056 1057 1057 1057 1057 1058 1058 1058 1059 1059 1059 1059 1059 1060 1060 1060 1061 1061 1061 1062 1062 1062 1063 1063 1063 1063 1064 1065 1065 1066 1066 1067 1067

Made with Doc-O-Matic.

xlii

PIC18 Peripheral Library Help Document Read_I2C Read_I2C1 Read_I2C2 I2C_puts puts_I2C puts_I2C1 puts_I2C2 I2C_gets gets_I2C gets_I2C1 gets_I2C2 Close_I2C Idle_I2C I2C Macros I2C Examples I2C Example1_Master I2C Example1_Slave I2C EEPROM (I2C_EEP) I2C_EEP Functions EEAckPolling_I2C I2C_EEAckPolling I2C_EEAckPolling1 I2C_EEAckPolling2 EECurrentAddRead_I2C I2C_EECurrentAddRead I2C_EECurrentAddRead1 I2C_EECurrentAddRead2 EEByteWrite_I2C I2C_EEByteWrite I2C_EEByteWrite1 I2C_EEByteWrite2 EEPageWrite_I2C I2C_EEPageWrite I2C_EEPageWrite1 I2C_EEPageWrite2 EESequenctialRead_I2C I2C_EESequentialRead I2C_EESequentialRead1 I2C_EESequentialRead2 EERandomRead_I2C 1067 1067 1068 1068 1068 1069 1069 1070 1070 1070 1071 1071 1072 1072 1072 1072 1074 1075 1075 1075 1075 1076 1076 1077 1077 1078 1078 1079 1079 1080 1080 1081 1081 1082 1083 1083 1083 1084 1085 1086

Made with Doc-O-Matic.

xliii

PIC18 Peripheral Library Help Document I2C_EERandomRead I2C_EERandomRead1 I2C_EERandomRead2 I2C_EEP Examples I2C_EEP Example1 IO Ports Ports Functions Open_PORTB Open_RB0INT Open_RB1INT Open_RB2INT Open_RB3INT Ports Macros Ports Examples Ports Example1 Real Time Clock & Calender (RTCC) RTCC Functions RTCC_InitClock RTCC_ReadAlrmDate RTCC_ReadAlrmTime RTCC_ReadAlrmTimeDate RTCC_ReadDate RTCC_ReadTime RTCC_ReadTimeDate RTCC_SetAlarmRpt RTCC_WrOn RTCC_WriteTimeDate RTCC_WriteTime RTCC_WriteDate RTCC_WriteAlrmTimeDate RTCC_WriteAlrmTime RTCC_WriteAlrmDate RTCC_SetChimeEnable RTCC_SetCalibration RTCC_SetAlarmRptCount RTCC Structs,Records,Enums RTCC Macros RTCC Examples RTCC Example1 Software RTCC (SW_RTCC)Made with Doc-O-Matic.

1086 1086 1087 1088 1088 1088 1088 1089 1089 1090 1091 1092 1093 1093 1093 1095 1095 1095 1095 1096 1096 1096 1097 1097 1098 1098 1099 1099 1100 1101 1101 1102 1103 1103 1104 1104 1104 1104 1104 1106

xliv

PIC18 Peripheral Library Help Document SW_RTCC Functions Open_SW_RTCC update_SW_RTCC Close_SW_RTCC SW_RTCC Examples SW_RTCC Example1 Serial Peripheral Interface (SPI) SPI Functions SPI_Open Open_SPI Open_SPI1 Open_SPI2 SPI_Write Write_SPI Write_SPI1 Write_SPI2 SPI_Read Read_SPI Read_SPI1 Read_SPI2 SPI_puts puts_SPI puts_SPI1 puts_SPI2 SPI_gets gets_SPI gets_SPI1 gets_SPI2 SPI Macros SPI Examples SPI Example1_Master SPI Example1_Slave TIMERS TIMERS Functions Open_Timer Open_Timer0 Open_Timer1_Page1 Open_Timer1_Page2 Open_Timer2 Open_Timer3_Page1 1106 1106 1106 1106 1107 1107 1108 1108 1108 1108 1109 1110 1111 1111 1112 1112 1113 1113 1113 1113 1113 1114 1114 1114 1115 1115 1115 1116 1116 1116 1116 1117 1118 1119 1119 1119 1120 1121 1123 1124

Made with Doc-O-Matic.

xlv

PIC18 Peripheral Library Help Document Open_Timer3_Page2 Open_Timer5 Open_Timer5_Page2 Open_Timer4 Open_Timer6_Page1 Open_Timer7_Page1 Open_Timer8_Page1 Open_Timer10_Page1 Open_Timer12_Page1 Read_Timer Read_Timer0 Read_Timer1 Read_Timer3 Read_Timer5 Read_Timer7_Page1 Write_Timer Write_Timer0 Write_Timer1 Write_Timer3 Write_Timer5 Write_Timer7_Page1 Set_TmrCCPSrc Set_TmrCCPSrc_Page1 Set_TmrCCPSrc_Page2 Set_TmrCCPSrc_Page3 Close_Timer Close_Timer0 Close_Timer1 Close_Timer2 Close_Timer3 Close_Timer4 Close_Timer5 Close_Timer6_Page1 Close_Timer7_Page1 Close_Timer8_Page1 Close_Timer10_Page1 Close_Timer12_Page1 TIMERS Structs,Records,Enums TIMERS Macros TIMERS Examples TIMERS Example1Made with Doc-O-Matic.

1125 1127 1129 1130 1131 1132 1134 1135 1136 1137 1137 1138 1138 1139 1139 1139 1139 1140 1140 1140 1141 1141 1141 1142 1142 1143 1143 1143 1144 1144 1144 1144 1145 1145 1145 1146 1146 1146 1146 1146 1146

xlvi

PIC18 Peripheral Library Help Document

Universal Asynchronous/Synchronous Reciever Transmitter (USART) USART Functions USART_Open Open_1USART Open_2USART Open_USART USART_Write Write_1USART Write_2USART Write_USART USART_baud baud_1USART baud_2USART baud_USART USART_gets gets_1USART gets_2USART gets_USART USART_putrs putrs_1USART putrs_2USART putrs_USART USART_puts puts_1USART puts_2USART puts_USART USART_Read Read_1USART Read_2USART Read_USART USART Structs,Records,Enums USART Macros USART Examples USART Example1 MicroWire (MWIRE) MWIRE Functions Mwire_Open Open_Mwire1 Open_Mwire2 Open_Mwire

1148 1148 1148 1148 1150 1152 1154 1154 1155 1155 1155 1155 1157 1158 1159 1159 1159 1160 1160 1160 1161 1161 1162 1162 1162 1163 1163 1163 1163 1164 1164 1164 1164 1164 1165 1165 1165 1166 1166 1167

Made with Doc-O-Matic.

xlvii

PIC18 Peripheral Library Help Document Mwire_gets gets_Mwire1 gets_Mwire2 gets_Mwire Mwire_Write Write_Mwire1 Write_Mwire2 Write_Mwire Mwire_Read Read_Mwire1 Read_Mwire2 Read_Mwire MWIRE Macros MWIRE Examples MWIRE Example1 Power Control PWM (PCPWM) PCPWM Functions Open_pcpwm_Page1 Open_pcpwm_Page2 Setdc0_pcpwm Setdc1_pcpwm Setdc2_pcpwm Setdc3_pcpwm OVD_CTRL_pcpwm OVD_IO_STA_pcpwm dt_clk_source_pcpwm dt_assignment_pcpwm Close_pcpwm PCPWM Macros Parallel Master Port (PMP) PMP Functions Open_PMP SetAddress_PMP MasterRead_PMP MasterWrite_PMP IsBufferNEmpty_PMP IsBufferNFull_PMP SlaveReadBufferN_PMP SlaveReadBuffers_PMP SlaveWriteBufferN_PMP 1167 1167 1168 1168 1169 1169 1169 1170 1170 1170 1171 1171 1171 1172 1172 1173 1174 1174 1178 1182 1182 1183 1183 1184 1184 1185 1185 1186 1186 1186 1187 1187 1187 1188 1189 1189 1189 1190 1190 1191

Made with Doc-O-Matic.

xlviii

PIC18 Peripheral Library Help Document SlaveWriteBuffers_PMP Close_PMP PMP Structs,Records,Enums PMP Macros PMP Examples PMP Example1 Flash Flash Functions Erase_Flash_Page1 Erase_Flash_Page2 Erase_Flash_Page3 Read_Flash_Page1 WriteBlock_Flash_Page1 WriteBlock_Flash_Page2 WriteBlock_Flash_Page3 WriteBlock_Flash_Page4 WriteBlock_Flash_Page5 WriteBlock_Flash_Page6 WriteWord_Flash_Page1 WriteBytes_Flash_Page1 WriteBytes_Flash_Page2 WriteBytes_Flash_Page3 Flash Macros Flash Examples Flash Example1 Prototype_Page 1191 1192 1192 1192 1192 1192 1196 1196 1196 1196 1197 1198 1198 1199 1199 1200 1200 1201 1202 1202 1203 1203 1204 1204 1204 1206

Symbol ReferenceFiles adc.h ancomp.h capture.h compare.h ctmu.h dpslp.h EEP.h flash.h i2c.h mwire.h

12071207 1207 1207 1207 1208 1208 1208 1208 1208 1208 1208

Made with Doc-O-Matic.

xlix

PIC18 Peripheral Library Help Document pcpwm.h pmp.h portb.h pps.h ProMPT.h pwm.h reset.h rtcc.h spi.h timers.h usart.h 1208 1208 1208 1208 1209 1209 1209 1209 1209 1209 1209

Index

a

Made with Doc-O-Matic.

l

1

PIC18 Peripheral Library Help Document

1 PIC18 Peripheral Library

1

Peripheral Library Support

for the

PIC18 Microcontroller Family

Made with Doc-O-Matic.

1

2

PIC18 Peripheral Library Help Document

2 IntroductionPIC18 MCU Peripheral Library Introduction

2The PIC18 MCU Peripheral Library provides a set of functions for setting up and controlling the operation of all the peripheral modules available in the PIC18 devices, as well as functions for interfacing with an external LCD, Software implemented communication modules. The Peripheral Library serves as a convenient layer of abstraction over the specific details of the peripherals and their associated control and status registers. The Peripheral Library supports the following hardware peripheral modules:

1. 10-bit A/D Converter 2. 12-bit A/D Converter 3. Analog Comparator 4. timers 5. Input Capture 6. Output Compare 7. Charge Time Measurement Unit (CTMU) 8. Deep Sleep 9. Internal EEPROM 10. Power Control PWM (PCPWM) 11. PWM 12. Programmable Motor Control Technology (ProMPT) 13. Real Time Clock & Calendar (RTCC) 14. Software RTCC 15. I/O Ports and External Interrupts 16. Reset 17. Usart 18. SPI 19. I2C 20. MWIRE 21. CAN2510 22. Parallel Master Port (PMP) 23. Functions for controlling an external LCD through configurable I/O Port pins are also provided 24. Software I2C 25. Software SPI 26. Software UART 27. FLASH Features

Made with Doc-O-Matic.

2

2

PIC18 Peripheral Library Help Document Key features of the PIC18 MCU Peripheral Library include:

Free library included with MCC18 compiler release The Peripheral Library contains a library file for each individual device from the PIC218 MCU family. The library file for each device includes functions corresponding to peripherals present in that particular device. The Peripheral Library also contains C include files that enable a user to take advantage of pre-defined constants for passing parameters to various library functions. There is an include file for each peripheral module. Since the functions are in the form of pre-compiled libraries, they may be called from a user application program written in either MCC18 or 8-bit PIC18 assembly language. The C source code is also included, so users can customize the functions to suit their specific application requirements if needed. The pre-defined constants in the C include files eliminates the need to refer to the details and structure of every Special Function Register while initializing peripherals or checking status bits. Library is developed considering the aspect of optimization, which upholds the ambit for the users effectively develop the application Library design facilitates the easy integration of all peripheral module support in a single application Library cogitates the migration possibility among the PIC MCU with least possible or no modifications to the application layer. Comprehensive code examples making use of peripheral library support in application layer, to facilitate the use of peripheral library Resource Requirements

2

Program Memory: The Peripheral Library functions have been optimized for reduced Program Memory usage. Since the functions are in the form of libraries, the actual Program Memory requirements depend on the functions being called by the application, as well as on the specific PIC18 device being used. Data Memory: The vast majority of the functions do not use RAM at all. Each of the remaining functions uses less than 10 bytes of RAM. Peripheral modules: Makes use of any other peripherals that are required to work in conjunction with the peripheral module in use as depicted in module architecture available in device data sheet.

Made with Doc-O-Matic.

3

3

PIC18 Peripheral Library Help Document

3 SW Licence AgreementCopyright 2009 released Microchip Technology Inc. All rights reserved. Microchip licenses to you the right to use,modify, copy and distribute Software only when embedded on a Microchip microcontroller or digital signal controller that is integrated into your product or third party product (pursuant to the sublicense terms in the accompanying license agreement). You should refer to the license agreement accompanying this Software for additional information regarding your rights and obligations. SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

3

Made with Doc-O-Matic.

4

4

PIC18 Peripheral Library Help Document

4 Release NotesIntroduction ( see page 2) This chapter gives an overview of the MCC18 library files and pre compiled object files that can be included in an application.

Overview A library is a collection of functions grouped for reference and ease of linking. The MCC18 libraries are included in the lib subdirectory of the installation. These can be linked directly into an application using the MPLINK linker. These files were pre compiled in the ..\MCC18\lib directory at Microchip. The directory ..\MCC18\src\pmc_common\.. contains the library files.

Devices (

see page 11) Supported

The following PIC18 devices are supported:

4PIC18C242 ( PIC18F242 ( PIC18F248 ( PIC18F2439 ( PIC18C601 ( see page 258) PIC18C252 ( see page 254) PIC18F252 ( see page 250) PIC18F258 ( see page 257) PIC18C442 ( see page 253) PIC18F442 ( see page 249) PIC18F448 ( see page 256) PIC18C452 ( see page 252) PIC18F452 ( see page 248) PIC18F458 ( see page 255) see page 251) see page 248) see page 244)

see page 247) PIC18F2539 ( see page 242) PIC18C801 (

see page 246) PIC18F4439 ( see page 241) PIC18C658 (

see page 245) PIC18F4539 (

see page 240) PIC18C858 (

see page 239) see page

PIC18F6620 ( see page 237) PIC18F6720 ( see page 236) PIC18F8620 ( 233) PIC18F6520 ( see page 238) PIC18F8520 ( see page 235) PIC18F1220 ( PIC18F2220 ( PIC18F2420 ( PIC18F2423 ( see page 232) PIC18F1320 ( see page 230) PIC18F2320 ( see page 227) PIC18F2520 ( see page 223) PIC18F2523 ( see page 232) PIC18F1230 ( see page 229) PIC18F4220 ( see page 226) PIC18F4420 ( see page 222) PIC18F4423 (

see page 234) PIC18F8720 (

see page 231) PIC18F1330 ( see page 228) PIC18F4320 ( see page 225) PIC18F4520 ( see page 221) PIC18F4523 (

see page 230) see page 228) see page 224) see page 220) see page

PIC18F2450 ( see page 219) PIC18F4450 ( see page 218) PIC18F2455 ( 216) PIC18F4455 ( see page 215) PIC18F4550 ( see page 214) PIC18F2480 ( PIC18F2410 ( PIC18F4410 ( PIC18F2525 ( PIC18F2585 ( PIC18F2682 ( PIC18F2221 ( PIC18F6310 ( PIC18F6390 ( see page 213) PIC18F2580 ( see page 210) PIC18F2510 ( see page 207) PIC18F4510 ( see page 203) PIC18F2620 ( see page 200) PIC18F2680 ( see page 197) PIC18F2685 ( see page 194) PIC18F2321 ( see page 190) PIC18F6410 ( see page 188) PIC18F6490 ( see page 213) PIC18F4480 ( see page 209) PIC18F2515 ( see page 206) PIC18F4515 ( see page 202) PIC18F4525 ( see page 199) PIC18F4585 ( see page 196) PIC18F4682 ( see page 193) PIC18F4221 ( see page 190) PIC18F8310 ( see page 187) PIC18F8390 (

see page 217) PIC18F2550 (

see page 212) PIC18F4580 ( see page 208) PIC18F2610 ( see page 205) PIC18F4610 ( see page 201) PIC18F4620 ( see page 198) PIC18F4680 ( see page 195) PIC18F4685 ( see page 192) PIC18F4321 ( see page 189) PIC18F8410 ( see page 186) PIC18F8490 (

see page 211) see page 208) see page 204) see page 201) see page 198) see page 195) see page 191) see page 188) see page 186)

Made with Doc-O-Matic.

5

4 PIC18F6527 ( PIC18F8527 ( PIC18F6585 ( PIC18F6525 ( PIC18F24J10 ( 169)

PIC18 Peripheral Library Help Document see page 185) PIC18F6622 ( see page 182) PIC18F8622 ( see page 179) PIC18F6680 ( see page 175) PIC18F6621 ( see page 184) PIC18F6627 ( see page 182) PIC18F8627 ( see page 178) PIC18F8585 ( see page 174) PIC18F8525 ( see page 184) PIC18F6722 ( see page 181) PIC18F8722 ( see page 177) PIC18F8680 ( see page 173) PIC18F8621 ( see page 183) see page 180) see page 176) see page 172) see page see page see page see page see page see page see page

see page 171) PIC18F25J10 (

see page 170) PIC18F44J10 (

see page 170) PIC18F45J10 ( see page 154) PIC18F85J10 ( see page 166) PIC18F83J11 ( see page 155) PIC18F86J15 ( see page 161) PIC18F83J90 ( see page 147) PIC18F87J60 ( see page 144) PIC18F97J60 (

PIC18F65J10 ( see page 158) PIC18F66J10 ( see page 156) PIC18F67J10 ( 154) PIC18F86J10 ( see page 152) PIC18F87J10 ( see page 151) PIC18F63J11 ( see page 168) PIC18F64J11 ( see page 167) PIC18F65J11 ( 165) PIC18F84J11 ( see page 164) PIC18F85J11 ( see page 164) PIC18F85J15 ( 151) see page 153) PIC18F65J15 ( see page 157) PIC18F66J15 (

PIC18F63J90 ( see page 163) PIC18F64J90 ( see page 162) PIC18F65J90 ( 160) PIC18F84J90 ( see page 159) PIC18F85J90 ( see page 158) PIC18F66J60 ( see page 150) PIC18F67J60 ( 146) PIC18F96J60 ( see page 145) PIC18F66J65 ( 143) PIC18F2331 ( PIC18F24K20 ( PIC18F43K20 ( page 133) PIC18F66J11 ( 128) PIC18F66J16 ( PIC18F65J50 ( PIC18F85J50 ( PIC18F66J55 ( PIC18F64J15 ( PIC18F8723 ( PIC18F8493 ( PIC18F8628 ( PIC18F2458 ( PIC18F13K50 ( page 110) PIC18F13K22 ( page 113) see page 149) PIC18F86J65 ( see page 142) PIC18F2431 ( see page 148) PIC18F86J60 ( see page 146) PIC18F96J65 (

4

see page 141) PIC18F4331 (

see page 140) PIC18F4431 ( see page 136)

see page 139)

see page 138) PIC18F25K20 ( see page 135) PIC18F44K20 ( see page 132) PIC18F67J11 ( see page 131) PIC18F86J16 ( see page 128) PIC18F66J50 ( see page 125) PIC18F86J50 ( see page 126) PIC18F86J55 ( see page 122) PIC18F84J15 ( see page 119) PIC18F6723 ( see page 117) PIC18F8393 ( see page 120) PIC18F6628 ( see page 116) PIC18F2553 (

see page 137) PIC18F26K20 (

see page 135) PIC18F45K20 ( see page 131) PIC18F86J11 (

see page 134) PIC18F46K20 (

see

see page 130) PIC18F87J11 (

see page

see page 129) see page 127) PIC18F67J50 ( see page 124) PIC18F87J50 ( see page 123) see page 121) see page 120) see page 117) PIC18F6493 ( see page 121) see page 116) PIC18F4458 ( see page 115) PIC18F4553 ( see page 115) see see see page 118) PIC18F6393 ( see page 119) see page 125) see page 122)

see page 109) PIC18F14K50 ( see page 112) PIC18F14K22 (

see page 108) PIC18LF13K50 ( see page 111) PIC18LF13K22 (

see page 111) PIC18LF14K50 ( see page 114) PIC18LF14K22 (

PIC18F24J50 ( see page 84) PIC18F25J50 ( see page 83) PIC18F26J50 ( PIC18F45J50 ( see page 79) PIC18F46J50 ( see page 78)

see page 82) PIC18F44J50 (

see page 80) see

PIC18LF24J50 ( see page 92) PIC18LF25J50 ( see page 90) PIC18LF26J50 ( page 88) PIC18LF45J50 ( see page 87) PIC18LF46J50 ( see page 85)Made with Doc-O-Matic.

see page 89) PIC18LF44J50 (

6

4

PIC18 Peripheral Library Help Document PIC18F25J11 ( see page 98) PIC18F24J11 ( see page 99) PIC18F26J11 ( PIC18F44J11 ( see page 96) PIC18F46J11 ( see page 93) see page 97) PIC18F45J11 ( see page 94) see

PIC18LF25J11 ( see page 106) PIC18LF24J11 ( see page 107) PIC18LF26J11 ( page 102) PIC18LF44J11 ( see page 103) PIC18LF46J11 ( see page 101) PIC18F66J90 ( PIC18F66J93 ( PIC18F87K90 ( 61) PIC18F67K90 ( 65) PIC18F87K22 ( 47) PIC18F67K22 ( 51) PIC18F86J72 ( PIC18F26J53 ( see page 76) PIC18F67J90 ( see page 70) PIC18F67J93 ( see page 58) PIC18F86K95 ( see page 62) PIC18F66K95 ( see page 44) PIC18F86K27 ( see page 48) PIC18F66K27 ( see page 56) PIC18F87J72 ( see page 37) PIC18F27J53 ( see page 75) PIC18F86J90 ( see page 69) PIC18F86J93 (

see page 104) PIC18LF45J11 (

see page 73) PIC18F87J90 ( see page 67) PIC18F87J93 (

see page 72) see page 66) see page see page see page see page

see page 59) PIC18F86K90 ( see page 63) PIC18F66K90 ( see page 46) PIC18F86K22 ( see page 50) PIC18F66K22 ( see page 55) PIC18F96J72 ( see page 36) PIC18F46J53 (

see page 60) PIC18F85K90 ( see page 64) PIC18F65K90 ( see page 45) PIC18F85K22 ( see page 49) PIC18F65K22 (

see page 53) PIC18F97J72 ( see page 35) PIC18F47J53 (

see page 52) see page 34) see page see

PIC18F66K80 ( see page 22) PIC18F65K80 ( see page 23) PIC18F46K80 ( 25) PIC18F26K80 ( see page 26) PIC18F25K80 ( see page 27)

see page 24) PIC18F45K80 (

4

PIC18LF66K80 ( see page 28) PIC18LF65K80 ( see page 29) PIC18LF46K80 ( page 31) PIC18LF26K80 ( see page 32) PIC18LF25K80 ( see page 33)

see page 30) PIC18LF45K80 (

Installation Peripheral Library comes along with MCC18 Compiler. No separate installation required for library.

What's New in this Release. This support update to version 2.0.0 includes 12 new devices.

PIC18F26K22 ( see page 267) PIC18F25K22 ( see page 269) PIC18F24K22 ( see page 271) PIC18F23K22 ( see page 273) PIC18LF26K22 ( see page 268) PIC18LF25K22 ( see page 270) PIC18LF24K22 ( see page 272) PIC18LF23K22 ( see page 274) PIC18F46K22 ( see page 265) PIC18F45K22 ( see page 259) PIC18F44K22 ( see page 261) PIC18F43K22 ( see page 263) PIC18LF46K22 ( see page 266) PIC18LF45K22 ( see page 260) PIC18LF44K22 ( see page 262) PIC18LF43K22 ( see page 264)

Migrating to Version 2.0.0 Existing projects can be migrated without modification.

Fixed Issues Flash ( see page 1196) buffer window length in library

Made with Doc-O-Matic.

7

4 PIC18F14K22 (

PIC18 Peripheral Library Help Document see page 111)/50 Family ADC channel select macros

Customer Support Users of Microchip products can receive assistance through several channels: Distributor or Representative Local Sales Office Field Application Engineer (FAE) Technical Support Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. Technical support is available through the web site at: http://support.microchip.com

Microchip Technology Inc. www.microchip.com Voice: (480) 792-7200 Fax: (480) 792-7277 Microchip Technical Support : http://support.microchip.com

4

Made with Doc-O-Matic.

8

5

PIC18 Peripheral Library Help Document

5 Getting StartedUsing the Peripheral Libraries - PIC18 Family These libraries provide a set of common interface functions to initialize and use peripheral modules on Microchip 8-bit microcontrollers. The libraries have been optimized for code size efficiency.

Building a Project with the Peripheral Library Building an application which utilizes the 8-bit peripheral libray support, requires the library file ".lib" file specific to device under use and a header file for each peripheral module. The archived library file contains all the individual object files for each library function. For each peripheral, the corresponding header file provides all the function prototypes, macros and typedefs used in the library. The library files are of the form p18wxyz.lib or p18wxyz_e.lib (depending on executable/object file format selected during the compile operation). The library supports all the variants of PIC18 devices as given under the Devices ( see page 11) heading. The header files are of the form peripheral.h, where peripheral is the name of the particular peripheral being used (e.g., adc.h ( see page 1207) for ADC Module). When linking an application, the library file ( p18wxyz.lib or p18wxyz_e.lib) must be provided as an input to the linker (using the --library or -l linker switch) such that the functions used by the application may be linked into the application.The .lib file to be added to the Project window under Library files. When compiling an application, each header file must be referenced (using #include) by all source files which call a function in the library or use its symbols or typedefs.

5Library Function Calling Convention The peripheral library contains some functions that do not require any input arguments, some that require single values or variables as arguments, and some whose arguments can be expressed as a logical AND/AND-OR of several constants that are pre-defined in the header file. Each constant included in any of these AND-ed expressions corresponds to the 8-bit mask for a possible selection for a certain bit or bit-field in a Special Function Register (SFR). Each argument, in turn, typically corresponds to the value written to an entire SFR. Thus, by logically combining chosen values for every bit-field in the SFR, the complete initialization value of the SFR is obtained. To use the OR mask setting, you will need to define the macro (#define USE_OR_MASKS) at the beginning of application code prior to inclusion of respective peripheral header files using #inlcude. In addition, the peripheral.h file provides macros xxx_MASK for each bitfield in an SFR. During runtime these macros can be used to clear bitfields. To clear a bitfield , bitwise AND the xxx_MASK with the current contents of the respective register. Example: Use of xxx_MASK AD1CON &= ADC_TAD_MASK; /* To Clear the bit field */ AD1CON |= ADC_48_TAD; /* To Set the bit field to new value */ Note: To avoid inadvertently setting a register bit to an undesired state, please select one (and only one) constant from each group in the logical expression that generates the argument. While using the AND_MASK to pass the value to argument of a function, it is necessary to add the macros of all selection/settings with necessary configuration associated with that parameter Rebuilding the Peripheral LibraryMade with Doc-O-Matic.

9

5

PIC18 Peripheral Library Help Document The batch file makeall.bat may be used to remake the libraries. The default behavior is to build peripheral libraries for all supported target processors; however, you may select a particular processor to build by adding the device names under the list in the batch file.

For example: 1. At DOS prompt, go to the src directory (by default, it is ..\MCC18\src) 2. Edit the processor list for which the library has to be rebuilt. 3. Type makeall.bat 4. After execution, process ends with the text Build Successful. 5. After successful build it generates p18_____.lib or p18_____e.lib files in the ..\MCC18\lib folder.

5

Made with Doc-O-Matic.

10

6

PIC18 Peripheral Library Help Document

6 DevicesDevices with the Peripheral Library Support

PIC18F45K22_Family PIC18F46K22 ( PIC18LF46K22 ( PIC18F45K22 ( PIC18LF45K22 ( PIC18F44K22 ( PIC18LF44K22 ( PIC18F43K22 ( PIC18LF43K22 ( PIC18F26K22 ( PIC18LF26K22 ( PIC18F25K22 ( PIC18LF25K22 ( PIC18F24K22 ( PIC18LF24K22 ( PIC18F23K22 ( PIC18LF23K22 ( see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258) see page 258)

6PIC18F66K80_Family PIC18F66k80 ( PIC18F65k80 ( PIC18F46k80 ( PIC18F45k80 ( PIC18F26k80 ( PIC18F25k80 ( PIC18LF66k80 ( PIC18LF65k80 ( PIC18LF46k80 ( PIC18LF45k80 ( PIC18LF26k80 ( PIC18LF25k80 ( see page 21) see page 21) see page 21) see page 21) see page 21) see page 21) see page 21) see page 21) see page 21) see page 21) see page 21) see page 21)

Made with Doc-O-Matic.

11

6

PIC18 Peripheral Library Help Document

PIC18LF47J53_Family PIC18LF26J53 ( PIC18LF27J53 ( PIC18LF46J53 ( PIC18LF47J53 ( see page 287) see page 287) see page 299) see page 299)

PIC18F47J13_Family PIC18F26J13 ( PIC18F27J13 ( PIC18F46J13 ( PIC18F47J13 ( see page 287) see page 287) see page 299) see page 299)

PIC18F47J53_Family PIC18F26J53 ( PIC18F27J53 ( PIC18F46J53 ( PIC18F47J53 ( see page 287) see page 287) see page 299) see page 299)

PIC18F87K22_Family PIC18F87K22 ( PIC18F86K22 ( PIC18F86K27 ( PIC18F85K22 ( PIC18F67K22 ( PIC18F66K22 ( PIC18F66K27 ( PIC18F65K22 ( see page 44) see page 44) see page 44) see page 44) see page 44) see page 44) see page 44) see page 44)

6

PIC18F97J72_Family PIC18F86J72 ( PIC18F87J72 ( PIC18F96J72 ( PIC18F97J72 ( see page 52) see page 52) see page 52) see page 52)

PIC18F87K90_Family PIC18F87K90 ( see page 58)

Made with Doc-O-Matic.

12

6

PIC18 Peripheral Library Help Document

PIC18F86K90 ( PIC18F86K95 ( PIC18F85K90 ( PIC18F67K90 ( PIC18F66K90 ( PIC18F66K95 ( PIC18F65K90 (

see page 58) see page 58) see page 58) see page 58) see page 58) see page 58) see page 58)

PIC18F87J90_Family PIC18F66J90 ( PIC18F67J90 ( PIC18F86J90 ( PIC18F87J90 ( see page 72) see page 72) see page 72) see page 72)

PIC18F87J93_Family PIC18F66J93 ( PIC18F67J93 ( PIC18F86J93 ( PIC18F87J93 ( see page 66) see page 66) see page 66) see page 66)

PIC18F46J50_Family PIC18F24J50 ( PIC18F25J50 ( PIC18F26J50 ( PIC18F44J50 ( PIC18F45J50 ( PIC18F46J50 ( see page 405) see page 405) see page 405) see page 417) see page 417) see page 417)

6

PIC18LF46J50_Family PIC18LF24J50 ( PIC18LF25J50 ( PIC18LF26J50 ( PIC18LF44J50 ( PIC18LF45J50 ( PIC18LF46J50 ( see page 405) see page 405) see page 405) see page 417) see page 417) see page 417)

Made with Doc-O-Matic.

13

6

PIC18 Peripheral Library Help Document

PIC18F46J11_Family PIC18F24J11 ( PIC18F25J11 ( PIC18F26J11 ( PIC18F44J11 ( PIC18F45J11 ( PIC18F46J11 ( see page 431) see page 431) see page 431) see page 443) see page 443) see page 443)

PIC18LF46J11_Family PIC18LF24J11 ( PIC18LF25J11 ( PIC18LF26J11 ( PIC18LF44J11 ( PIC18LF45J11 ( PIC18LF46J11 ( see page 431) see page 431) see page 431) see page 443) see page 443) see page 443)

PIC18LF14K22_Family PIC18LF13K22 ( PIC18LF14K22 ( see page 114) see page 113)

PIC18F14K22_Family PIC18F13K22 ( PIC18F14K22 ( see page 112) see page 111)

6

PIC18LF14K50_Family PIC18LF13K50 ( PIC18LF14K50 ( see page 111) see page 110)

PIC18F14K50_Family PIC18F13K50 ( PIC18F14K50 ( see page 109) see page 108)

PIC18F4553_Family PIC18F2458 ( PIC18F2553 ( see page 115) see page 115)

Made with Doc-O-Matic.

14

6

PIC18 Peripheral Library Help Document

PIC18F4458 ( PIC18F4553 (

see page 115) see page 115)

PIC18F8493_Family PIC18F6393 ( PIC18F6493 ( PIC18F8393 ( PIC18F8493 ( see page 117) see page 117) see page 117) see page 117)

PIC18F8723_Family PIC18F6628 ( PIC18F6723 ( PIC18F8628 ( PIC18F8723 ( see page 119) see page 119) see page 119) see page 119)

PIC18F84J15_Family PIC18F64J15 ( PIC18F84J15 ( see page 121) see page 121)

PIC18F87J50_Family PIC18F65J50 ( PIC18F66J50 ( PIC18F66J55 ( PIC18F67J50 ( PIC18F85J50 ( PIC18F86J50 ( PIC18F86J55 ( PIC18F87J50 ( see page 122) see page 122) see page 122) see page 122) see page 122) see page 122) see page 122) see page 122)

6

PIC18F87J11_Family PIC18F66J11 ( PIC18F66J16 ( PIC18F67J11 ( PIC18F86J11 ( PIC18F86J16 ( PIC18F87J11 ( see page 128) see page 128) see page 128) see page 128) see page 128) see page 128)

Made with Doc-O-Matic.

15

6

PIC18 Peripheral Library Help Document

PIC18F46K20_Family PIC18F23K20 ( PIC18F24K20 ( PIC18F25K20 ( PIC18F26K20 ( PIC18F43K20 ( PIC18F44K20 ( PIC18F45K20 ( PIC18F46K20 ( see page 133) see page 133) see page 133) see page 133) see page 133) see page 133) see page 133) see page 133)

PIC18F4431_Family PIC18F2331 ( PIC18F2431 ( PIC18F4331 ( PIC18F4431 ( see page 819) see page 819) see page 811) see page 811)

PIC18F97J60_Family PIC18F66J60 ( PIC18F66J65 ( PIC18F67J60 ( PIC18F86J60 ( PIC18F86J65 ( PIC18F87J60 ( PIC18F96J60 ( PIC18F96J65 ( PIC18F97J60 ( see page 143) see page 143) see page 143) see page 143) see page 143) see page 143) see page 143) see page 143) see page 143)

6

PIC18F87J10_Family PIC18F65J10 ( PIC18F65J15 ( PIC18F66J10 ( PIC18F66J15 ( PIC18F67J10 ( PIC18F85J10 ( PIC18F85J15 ( PIC18F86J10 ( PIC18F86J15 ( see page 150) see page 150) see page 150) see page 150) see page 150) see page 150) see page 150) see page 150) see page 150)

Made with Doc-O-Matic.

16

6

PIC18 Peripheral Library Help Document

PIC18F87J10 (

see page 150)

PIC18F85J90_Family PIC18F63J90 ( PIC18F64J90 ( PIC18F65J90 ( PIC18F83J90 ( PIC18F84J90 ( PIC18F85J90 ( see page 163) see page 162) see page 161) see page 160) see page 159) see page 158)

PIC18F85J11_Family PIC18F63J11 ( PIC18F64J11 ( PIC18F65J11 ( PIC18F83J11 ( PIC18F84J11 ( PIC18F85J11 ( see page 168) see page 167) see page 166) see page 165) see page 164) see page 164)

PIC18F45J10_Family PIC18F24J10 ( PIC18F25J10 ( PIC18F44J10 ( PIC18F45J10 ( see page 798) see page 798) see page 789) see page 789)

6

PIC18F8621_Family PIC18F6525 ( PIC18F6621 ( PIC18F8525 ( PIC18F8621 ( see page 172) see page 172) see page 172) see page 172)

PIC18F8680_Family PIC18F6585 ( PIC18F6680 ( PIC18F8585 ( PIC18F8680 ( see page 176) see page 176) see page 176) see page 176)

Made with Doc-O-Matic.

17

6

PIC18 Peripheral Library Help Document

PIC18F8722_Family PIC18F6527 ( PIC18F6622 ( PIC18F6627 ( PIC18F6722 ( PIC18F8527 ( PIC18F8622 ( PIC18F8627 ( PIC18F8722 ( see page 180) see page 180) see page 180) see page 180) see page 180) see page 180) see page 180) see page 180)

PIC18F8490_Family PIC18F6390 ( PIC18F6490 ( PIC18F8390 ( PIC18F8490 ( see page 186) see page 186) see page 186) see page 186)

PIC18F8410_Family PIC18F6310 ( PIC18F6410 ( PIC18F8310 ( PIC18F8410 ( see page 188) see page 188) see page 188) see page 188)

PIC18F4321_Family PIC18F2221 ( PIC18F2321 ( PIC18F4221 ( PIC18F4321 ( see page 643) see page 643) see page 635) see page 635)

6

PIC18F4685_Family PIC18F2682 ( PIC18F2685 ( PIC18F4682 ( PIC18F4685 ( see page 660) see page 660) see page 652) see page 652)

Made with Doc-O-Matic.

18

6

PIC18 Peripheral Library Help Document

PIC18F4680_Family PIC18F2585 ( PIC18F2680 ( PIC18F4585 ( PIC18F4680 ( see page 660) see page 660) see page 652) see page 652)

PIC18F4620_Family PIC18F2525 ( PIC18F2620 ( PIC18F4525 ( PIC18F4620 ( see page 691) see page 691) see page 683) see page 683)

PIC18F4610_Family PIC18F2410 ( PIC18F2510 ( PIC18F2515 ( PIC18F2610 ( PIC18F4410 ( PIC18F4510 ( PIC18F4515 ( PIC18F4610 ( see page 675) see page 675) see page 675) see page 675) see page 668) see page 668) see page 668) see page 668)

PIC18F4580_Family PIC18F2480 ( PIC18F2580 ( PIC18F4480 ( PIC18F4580 ( see page 660) see page 660) see page 652) see page 652)

6

PIC18F4550_Family PIC18F2455 ( PIC18F2550 ( PIC18F4455 ( PIC18F4550 ( see page 217) see page 216) see page 215) see page 214)

PIC18F4450_Family PIC18F2450 ( see page 218)

Made with Doc-O-Matic.

19

6

PIC18 Peripheral Library Help Document

PIC18F4450 (

see page 218)

PIC18F4523_Family PIC18F2423 ( PIC18F2523 ( PIC18F4423 ( PIC18F4523 ( see page 223) see page 222) see page 221) see page 220)

PIC18F4520_Family PIC18F2420 ( PIC18F2520 ( PIC18F4420 ( PIC18F4520 ( see page 227) see page 226) see page 225) see page 224)

PIC18F4320_Family PIC18F2220 ( PIC18F2320 ( PIC18F4220 ( PIC18F4320 ( see page 228) see page 228) see page 228) see page 228)

PIC18F1330_Family PIC18F1230 ( PIC18F1330 ( see page 230) see page 230)

6

PIC18F1320_Family PIC18F1220 ( PIC18F1320 ( see page 232) see page 232)

PIC18F8720_Family PIC18F6520 ( PIC18F6620 ( PIC18F6720 ( PIC18F8520 ( PIC18F8620 ( PIC18F8720 ( see page 233) see page 233) see page 233) see page 233) see page 233) see page 233)

Made with Doc-O-Matic.

20

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18F66K80

PIC18C858_Family PIC18C658 ( PIC18C858 ( see page 239) see page 239)

PIC18C801_Family PIC18C601 ( PIC18C801 ( see page 241) see page 241)

PIC18F4539_Family PIC18F2439 ( PIC18F2539 ( PIC18F4439 ( PIC18F4539 ( see page 243) see page 243) see page 243) see page 243)

PIC18F458_Family PIC18F248 ( PIC18F258 ( PIC18F448 ( PIC18F458 ( see page 768) see page 768) see page 776) see page 776)

PIC18F452_Family PIC18F242 ( PIC18F252 ( PIC18F442 ( PIC18F452 ( see page 251) see page 251) see page 251) see page 251)

6

PIC18C452_Family PIC18C242 ( PIC18C252 ( PIC18C442 ( PIC18C452 ( see page 254) see page 254) see page 254) see page 254)

6.1 PIC18F66K80 FamilyMade with Doc-O-Matic.

21

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18F65K80

6.1.1 PIC18F66K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

22

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18F46K80

6.1.2 PIC18F65K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

23

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18F45K80

6.1.3 PIC18F46K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

24

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18F26K80

6.1.4 PIC18F45K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

25

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18F25K80

6.1.5 PIC18F26K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

26

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18LF66K80

6.1.6 PIC18F25K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

27

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18LF65K80

6.1.7 PIC18LF66K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

28

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18LF46K80

6.1.8 PIC18LF65K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

29

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18LF45K80

6.1.9 PIC18LF46K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

30

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18LF26K80

6.1.10 PIC18LF45K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

31

6.1 PIC18F66K80 Family

PIC18 Peripheral Library Help Document

PIC18LF25K80

6.1.11 PIC18LF26K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

Made with Doc-O-Matic.

32

6.2 PIC18F47Jx3 Family

PIC18 Peripheral Library Help Document

PIC18F47J53

6.1.12 PIC18LF25K80CLICK HERE ( see page 275) for the Peripheral Library Support Details for this Device

Peripheral Highlights: 1/4 CCP/ECCP modules - Seven Capture/Compare/PWM (CCP) modules - Three Enhanced Capture/Compare/PWM (ECCP) modules 5 8/16-bit timer/counter modules: - Timer0 8/16-bit timer/counter with 8-bit programmable prescaler - Timer1,3 16-bit timer/counter - Timer2,4 8-bit timer/counter Two analog comparators Configurable reference clock output Charge Time Measurement Unit (CTMU): - Capacitance measurement - Time measurement with 1-ns typical resolution High-current sink/source 25 mA/25 mA (PORTB and PORTC) Up to four external interrupts One Master Synchronous Serial Port (MSSP) modules: - 3/4-wire SPI (supports all four SPI modes) - I2C Master and Slave mode Two Enhanced Addressable USART modules: - LIN/J2602 support - Auto-Baud Detect (ABD) 12-bit A/D converter with up to 14 channels: - Auto-acquisition and Sleep operation

6

6.2 PIC18F47Jx3 FamilyMade with Doc-O-Matic.

33

6.2 PIC18F47Jx3 Family

PIC18 Peripheral Library Help Document

PIC18F47J53

6.2.1 PIC18F47J53CLICK HERE ( see page 299) for the Peripheral Library Support Details for this Device

Micro Controller Features:nanoWatt XLP for Extreme Low-Power: Deep Sleep mode: CPU off, Peripherals off, - Able to wake-up on external triggers, programmable WDT or RTCC alarm - Ultra Low-Power Wake-up (ULPWU) Special Microcontroller Features: 5.5V Tolerant Inputs (digital only pins) Low-Power, High-Speed CMOS Flash ( see page 1196) Technology

C Compiler Optimized Architecture for Re-Entrant Code Priority Levels for Interrupts Self-Programmable under Software Control 8 x 8 Single-Cycle Hardware Multiplier Extended Watchdog Timer (WDT): Flash ( see page 1196) Program Memory of 10,000 Erase/Write

Cycles Minimum and 20-Year Data Retention Peripheral Highlights: Peripheral Pin Select: Hardware Real-Time Clock and Calendar (RTCC): High-Current Sink/Source 25 mA/25 mA (PORTB and PORTC) Four Programmable External Interrupts Four Input Change Interrupts Two Enhanced Capture/Compare/PWM (ECCP) modules: Two Master Synchronous Serial Port (MSSP) modules Supporting Three-Wire SPI (all four modes) and I2C Master and Slave modes Full-Duplex Master/Slave SPI DMA Eng