100% found this document useful (1 vote)
6 views

PICmicro microcontroller pocket reference 1st Edition Predko pdf download

The document is a reference guide for the PICmicro microcontroller, authored by Myke Predko and published by McGraw-Hill in 2001. It includes detailed information on device pinouts, instruction sets, processor architectures, hardware features, programming, and interfacing. The guide serves as a comprehensive resource for users and developers working with PICmicro MCUs.

Uploaded by

isbikeiner
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
6 views

PICmicro microcontroller pocket reference 1st Edition Predko pdf download

The document is a reference guide for the PICmicro microcontroller, authored by Myke Predko and published by McGraw-Hill in 2001. It includes detailed information on device pinouts, instruction sets, processor architectures, hardware features, programming, and interfacing. The guide serves as a comprehensive resource for users and developers working with PICmicro MCUs.

Uploaded by

isbikeiner
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

PICmicro microcontroller pocket reference 1st

Edition Predko pdf download

https://ebookfinal.com/download/picmicro-microcontroller-pocket-
reference-1st-edition-predko/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

C 4 0 Pocket Reference Pocket Reference O Reilly 3rd


Edition Ben Albahari

https://ebookfinal.com/download/c-4-0-pocket-reference-pocket-
reference-o-reilly-3rd-edition-ben-albahari/

Swift pocket reference Second Edition Gray

https://ebookfinal.com/download/swift-pocket-reference-second-edition-
gray/

Perl pocket reference 5th Edition Johan Vromans

https://ebookfinal.com/download/perl-pocket-reference-5th-edition-
johan-vromans/

JavaScript Pocket Reference Third Edition David Flanagan

https://ebookfinal.com/download/javascript-pocket-reference-third-
edition-david-flanagan/
Mac OS X Pocket Reference 1st Edition Chuck Toporek

https://ebookfinal.com/download/mac-os-x-pocket-reference-1st-edition-
chuck-toporek/

C 6 0 Pocket Reference 1st Edition Joseph Albahari

https://ebookfinal.com/download/c-6-0-pocket-reference-1st-edition-
joseph-albahari/

Clinician s pocket reference 9th ed Edition Haist

https://ebookfinal.com/download/clinician-s-pocket-reference-9th-ed-
edition-haist/

HTML Pocket Reference 2nd Edition Jennifer Niederst


Robbins

https://ebookfinal.com/download/html-pocket-reference-2nd-edition-
jennifer-niederst-robbins/

TOAD pocket reference for Oracle 2nd ed Edition Patrick


Mcgrath

https://ebookfinal.com/download/toad-pocket-reference-for-oracle-2nd-
ed-edition-patrick-mcgrath/
PICmicro microcontroller pocket reference 1st Edition
Predko Digital Instant Download
Author(s): Predko, Michael
ISBN(s): 9780071395632, 0071395636
Edition: 1
File Details: PDF, 6.89 MB
Year: 2001
Language: english
5194 Pocket Predko FM 9/25/01 4:20 PM Page i

PICmicro®
Microcontroller
Pocket
Reference
This page intentionally left blank.
5194 Pocket Predko FM 9/25/01 4:20 PM Page iii

PICmicro®
Microcontroller
Pocket
Reference

Myke Predko

McGraw-Hill
New York San Francisco Washington, D.C. Auckland Bogotá
Caracas Lisbon London Madrid Mexico City Milan
Montreal New Delhi San Juan Singapore
Sydney Tokyo Toronto
McGraw-Hill
abc
Copyright © 2001 by The McGraw-Hill Companies. All rights reserved. Manufactured in the United
States of America. Except as permitted under the United States Copyright Act of 1976, no part of
this publication may be reproduced or distributed in any form or by any means, or stored in a data-
base or retrieval system, without the prior written permission of the publisher.

0-07-139563-6

The material in this eBook also appears in the print version of this title: 0-07-136175-8.

All trademarks are trademarks of their respective owners. Rather than put a trademark symbol
after every occurrence of a trademarked name, we use names in an editorial fashion only, and to
the benefit of the trademark owner, with no intention of infringement of the trademark. Where
such designations appear in this book, they have been printed with initial caps.

McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales pro-
motions, or for use in corporate training programs. For more information, please contact George
Hoare, Special Sales, at george_hoare@mcgraw-hill.com or (212) 904-4069.

TERMS OF USE
This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licen-
sors reserve all rights in and to the work. Use of this work is subject to these terms. Except as per-
mitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work,
you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative
works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any
part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommer-
cial and personal use; any other use of the work is strictly prohibited. Your right to use the work
may be terminated if you fail to comply with these terms.

THE WORK IS PROVIDED “AS IS”. McGRAW-HILL AND ITS LICENSORS MAKE NO
GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COM-
PLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUD-
ING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA
HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its
licensors do not warrant or guarantee that the functions contained in the work will meet your
requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its
licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of
cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for
the content of any information accessed through the work. Under no circumstances shall
McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, conse-
quential or similar damages that result from the use of or inability to use the work, even if any of
them has been advised of the possibility of such damages. This limitation of liability shall apply
to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.

DOI: 10.1036/0071395636
This page intentionally left blank.
5194 Pocket Predko FM 9/25/01 4:20 PM Page v

Contents

Chapter 1. Conventions Used in This Book 1

Chapter 2. PICmicro® MCU Part Number


Feature Comparison 3

Feature to Part Number Table 3

Chapter 3. Device Pinouts 7

Low-End 8
Mid-Range 10
PIC17Cxx 14
PIC18Cxx 17

Chapter 4. PICmicro® MCU Instruction Sets 21

Parameters 21
Low-End Instruction Set 22
Mid-Range Instruction Set 31
PIC17Cxx Instruction Set 40
PIC18Cxx Instruction Set 63
Microchip Special Instruction Mnemonics 104
Parallax PICmicro® MCU Instruction Set 111

Copyright 2001 The McGraw-Hill Companies. Click Here for Terms of Use.
5194 Pocket Predko FM 9/25/01 4:20 PM Page vi

vi Contents

Chapter 5. PICmicro® MCU Processor


Architectures 123

The PICmicro® MCU’s Arithmetic Logic Unit 123


Low-End PICmicro® MCUs 125
Register access 126
STATUS register 128
Program counter 128
Mid-Range PICmicro® MCUs 130
Register access 130
STATUS register 132
Program counter 133
Interrupt operation 134
Interrupt handler skeleton 135
PIC17Cxx 136
Register access 137
STATUS register 138
Program counter 139
Interrupt operation 140
Interrupt handler skeleton 142
PIC18Cxx 142
Register access 144
STATUS register 146
Program counter 147
Interrupt operation 150
Interrupt handler skeleton 150

Chapter 6. PICmicro® MCU Register Mappings 151


Low-End PICmicro® MCUs 151
Mid-Range PICmicro® MCUs 154
PIC17Cxx 169
PIC18Cxx 186
5194 Pocket Predko FM 9/25/01 4:20 PM Page vii

Contents vii

Chapter 7. Built-In Hardware Features 207

Configuration Registers 207


Oscillators 208
Sleep 213
Option Register 216
Input/Output Ports and TRIS Registers 217
Watchdog Timer 221
TMR0 222
Prescaler 223
TMR1 224
TMR2 227
Compare/Capture/PWM(CCP) Module 228
USART Module 232
SSP Module 239
SPI operation 239
I2C operation 244
Built-In ADC 252
Built-In Comparators 257
Parallel Slave Port 261
Built-In EEPROM Data Memory Access 263
EPROM Program Memory Access 269
Flash Program Memory Access 271
External Parallel Memory 273

Chapter 8. PICmicro® MCU


Hardware Interfacing 277

Power 277
Reset 281
Digital Logic Interfacing 282
5194 Pocket Predko FM 9/25/01 4:20 PM Page viii

viii Contents

Parallel Bus Device Interfacing 282


Button Interfacing 284
Switch Matrix Keypad/Keyboard Interfacing 287
Combining Input and Output 291
Simulated “Open Collector’’/“Open Drain’’ I/O 292
LEDs 293
Multisegment LED displays 293
LCD Interfaces 296
I2C Bit Banging “Master’’ Interface 334
RS-232 Interfaces 338
RS-485/RS-422 345
Asynchronous Serial I/O Software Routines 347
Dallas Semiconductor One-Wire Interface 357
Reading Potentiometer Using Parallel I/O Pins 363
Motor Drivers 365
R/C Servo Control 370
Audio Output 371
AC Power Control 373
Hall-Effect Sensors 374
Sony Infrared TV Remote Control 374

Chapter 9. PICmicro® MCU Programming 379

“Hex’’ File Format 379


Low-End PICmicro® MCU Programming 381
Mid-Range Serial Programming 385
PIC17Cxx Programming 394
PIC17Cxx ICSP Programming 398
PIC18Cxx Programming 402
Microchip ICSP Programming Connector 405
Third Party/Downloadable Programmers 406
5194 Pocket Predko FM 9/25/01 4:20 PM Page ix

Contents ix

Chapter 10. PC Interfaces 407

Memory Map 407


I/O Space Map 407
Interrupt Function by Number 422
ISA Bus 425
ISA pinouts 425
Interrupts 429
Keyboard and Mouse Ports 430
Connector specification 430
Keyboard operation with timing diagrams 431
Keyboard scan codes 432
Keyboard controller commands 436
BIOS interfaces 436
Keyboard commands 441
Serial Port 441
Connector pinouts 442
8250 block diagram 443
Serial port base addresses 443
8250 registers 444
Interrupts 449
Interrupt 14h–RS-232 communications APIs 451
Parallel Port 455
Block diagram/connector 455
Base registers 457
Registers 457
Data output waveform 458
BIOS interfaces 459

Chapter 11. Useful Code “Snippets’’ 461

Jumping Outside the Current Page 461


Tables 462
Conditional Branching 465
5194 Pocket Predko FM 9/25/01 4:20 PM Page x

x Contents

Time Delays 466


Negating the Contents of a Register 467
Incrementing/Decrementing “w’’ 468
Rotating a Byte in Place 469
Copy Bits from One Register to Another 470
Converting a Nybble to ASCII 470
Converting an ASCII Byte to a Hex Nybble 471
Using T0CKI as an Interrupt Source Pin 471
Dividing by Three 472
Sixteen-Bit Pulse Measurement with
5-Cycle Delay 473
Detect a Change in a Register 474
Test a Byte within a Range 474
Convert ASCII to Upper Case 475
Swap the Contents of “w’’ with a Register 475
Swap the Contents of Two Registers 475
Compare and Swap if Y  X 476
Counting the Number of “1’’s in a Byte 476
Generating Parity for a Byte 477
Keeping a Variable within a Range 477
Swapping Bit Pairs 478
Bitwise Operations 478
Constant Multiplication 479
Constant Division 480

Chapter 12. 16-Bit Numbers 483

Defining 16 Bit Numbers 483


Increments and Decrements 484
Addition/Subtraction 485
Bitwise Operations on Constants and Variables 488
5194 Pocket Predko FM 9/25/01 4:20 PM Page xi

Contents xi

Comparisons with 16-Bit Variables 489


Multiplication 492
Division 495

Chapter 13. PICmicro® MCU


Operations Tables 499

I/O Pin Current Capabilities 500


RC Oscillator Component Values 500
LP Oscillator Operating Characteristics 501
XT Oscillator Operating Characteristics 502
HS Oscillator Operating Characteristics 504

Chapter 14. PICmicro® MCU Application


Debugging Checklist 507

Chapter 15. PICmicro® MCU Application


Software Development Tools 517

Microsoft Compatible Editor “Ctrl’’ Key


Combinations 517
MPSIM.INI 518
MPLAB 519
Stimulus (.STI) files 525
MPLAB assembler directives 526
Standard Declaration and Include (“.inc’’) Files 536
Linking–Linked Applications 536
Application Code Template 539
The BASIC Language 540
Microsoft BASIC Enhancements 542
PicBasic 549
5194 Pocket Predko FM 9/25/01 4:20 PM Page xii

xii Contents

Visual Basic 578


MSComm control 581
The “C’’ Language 588
Declarations 588
Statements 590
Operators 593
Directives 595
“Backslash’’ characters 598
Common C functions 598
PICmicro® MCU enhancement functions 603

Chapter 16. Constants and Data Tables 605

Mathematical and Physical Constants 605


ASCII 606
ASCII control characters 607
ANSI display control sequences 609
IBM PC extended ASCII characters 612
Windows ASCII characters 612
EBCDIC 612
Audio Notes 615
“Touch-Tone’’ Telephone Frequencies 616
Modem “AT’’ Commands 616
Modem registers 622
Morse Code 625
Phonetic Alphabets 626
“Ten’’ Radio Codes 626

Chapter 17. Miscellaneous Electronics 629

Resistor Color Coding 629


Electromagnetic Spectrum 630
Radar bands 632
5194 Pocket Predko FM 9/25/01 4:20 PM Page xiii

Contents xiii

Digital Logic 632


Gates 632
Flip flops 633

Chapter 18. Formulas 635


DC Electronics Formulas 635
AC Electronics Formulas 636
Mathematical Formulas 638
Boolean Arithmetic 638
Conversions 640

Chapter 19. Resources 641


Microchip 641
PICmicro® MCU Books 642
Useful Books 643
PICList Internet List Server 648
Recommended PICmicro® MCU Web Sites 656
Periodicals 658
Useful Web Sites 659
Hardware FAQs 660
Part Suppliers 661
Digi-Key 661
AP Circuits 661
Wirz Electronics 662
Tower Hobbies 663
Jameco 663
JDR 663
Newark 664
Marshall Industries 664
Mouser Electronics 665
Mondo-tronics Robotics Store 665

Index 667
This page intentionally left blank.
5194 Predko Pocket Chapter 1 9/25/01 4:21 PM Page 1

Chapter

1
Conventions Used in
This Book

Hz Hertz (Cycles per Second)


kHz Kilohertz (Thousands of Cycles per Second)
MHz Megahertz (Millions of Cycles per Second)
GHz Gigahertz (Billions of Cycles per Second)
bps Bits per Second
kbps Thousands of Bits per Second
mbps Millions of Bits per Second
KBytes 1,024 Bytes
MBytes 1,048,576 Bytes
GBytes 1,073,741,824 Bytes

Copyright 2001 The McGraw-Hill Companies. Click Here for Terms of Use.
5194 Predko Pocket Chapter 1 9/25/01 4:21 PM Page 2

2 Chapter 1

K 1,000 ohms
uF microfarads
ms/msecs milliseconds
us/usecs microseconds
0x0nn, $nn, Hex Numbers
0nnh, and
H‘nn’
0b0nnn, Binary Number
%nnn,
0nnnb, and
B‘nnn’
nnn, 0nnnd, Decimal Number
and .nnn
AND and & Bitwise “AND”
OR and | Bitwise “OR”
XOR and ^ Bitwise “XOR”
_Label Negative Active Pin. In some manufacturer’s
data sheets this is represented with a leading
“!” character or with a bar over the entire
label.
[parameter] The parameter is optional.
parameter |
parameter One or another parameter can be used.
5194 Predko Pocket Chapter 2 9/25/01 4:22 PM Page 3

Chapter

2
PICmicro® MCU
Part Number
Feature Comparison

Feature to Part Number Table


The following table lists the different PICmicro® MCU
families with the features that are specific to them.

Copyright 2001 The McGraw-Hill Companies. Click Here for Terms of Use.
5194 Predko Pocket Chapter 2
Part Number Features
4

PIC12C5xx 8-Pin PICmicro® MCU. 12-Bit (Low-End) Processor. Internal Reset & Oscillator.
PIC12C6xx 8-Pin PICmicro® MCU. 14-Bit (Mid-Range) Processor. 8-Bit ADC/Internal
Reset & Oscillator/Optional EEPROM Data Memory.
PIC14C000 28-Pin PICmicro® MCU. 14-Bit (Mid-Range) Processor. Advanced
ADC/Internal Voltage Reference/On Chip Temperature Sensor.
PIC16C5x 18- to 28-Pin PICmicro® MCU. 12-Bit (Low-End) Processor.
PIC16C505 14-Pin PICmicro® MCU. 12-Bit (Low-End) Processor. Internal Reset & Oscillator.
PIC16HV540 18-Pin PICmicro® MCU. 12-Bit (Low-End) Processor. Extended Vdd
Capabilities with Built-In Regulator.

9/25/01
PIC16C55x 18-Pin PICmicro® MCU. 14-Bit (Mid-Range) Processor.
PIC16C6x 18- to 40-Pin PICmicro® MCU. 14-Bit (Mid-Range) Processor. Optional TMR1
& TMR2/Optional SPI/Optional USART/Optional PSP.
PIC16C62x 18-Pin PICmicro® MCU. 14-Bit (Mid-Range) Processor. Voltage Comparators

4:22 PM
Built-In with Voltage Reference/Optional EEPROM Data Memory.
PIC16F62x 18-Pin PICmicro® MCU. 14-Bit (Mid-Range) Processor. Flash Program
Memory/Voltage Comparators Built-In with Voltage Reference/Internal Reset
& Oscillator.
PIC16C642 28-Pin PICmicro® MCU. 14-Bit (Mid-Range) Processor. Voltage Comparators

Page 4
Built-In with Voltage Reference.
Discovering Diverse Content Through
Random Scribd Documents
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like