Microchip Technology 44-PIN DEMO BOARD User’s Guide

44-PIN DEMO BOARD
USER’S GUIDE
© 2007 Microchip Technology Inc. DS41296B
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digit al Millennium Copyright Act. If suc h a c t s allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device applications and t he lik e is provided only for your convenience and may be su perseded by upda t es . It is y our responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life supp ort and/or safety ap plications is entir ely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless M icrochip from any and all dama ges, claims, suits, or expenses re sulting from such use. No licens es are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, K
EELOQ, KEELOQ logo, microID, MPLAB, PIC,
PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, an d SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
AmpLab, FilterLab, Linear Active Thermistor, Migratable Memory, MX DEV, MXLAB, PS logo, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartT el, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology I ncorporat ed in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their respective companies.
© 2007, Microchip Technology Incorporated, Pr inted in the U.S.A., All Rights Reserved.
Printed on recycled paper.
Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona, Gresham, Oregon and Mountain View, California. The Company’s quality system processes and procedures are for its PIC MCUs and dsPIC® DSCs, KEELOQ EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
®
code hopping devices, Serial
DS41296B-page ii © 2007 Microchip Technology Inc.
®
44-PIN DEMO BOARD
USER’S GUIDE
Table of Contents
Preface ........................................................................................................................... 1
Introduction............................................................................................................1
Document Layout .................................................................................................. 1
Conventions Used in this Guide............................................................................ 2
Warranty Reg is tration............................................................................................ 3
Recommended Reading............................... .. ................................................. .. .. ..3
The Microchip Web Site....................... ...................... ...................... .....................4
Development Systems Customer Change Notification Servi ce............................4
Customer Support...................................... ................................... .................. ......5
Document Revision History................................................................................... 5
Chapter 1. 44-Pin Demo Board Overview
1.1 Introduction .....................................................................................................7
1.2 Highlight s ......... ............. .. .. ........................... .. .. ........................... .. .. ................ 7
1.3 Devices Supported by the 44-Pin Demo Board .............................................. 7
1.4 44-Pin De m o Boa r d O v e rview ... .. ........................... .. ...................................... 8
1.5 Running th e D e fa u l t De mo n stration ....... ........................... .. ........................... 8
Chapter 2. Mid-Range PIC® Microcontroller Architectural Overview
2.1 Introduction......................................................................................................9
2.2 Memory Organization......................................................................................9
2.3 Instruct io n Formats................................................................. ... .. .................. 10
2.4 Assembl er Bas ic s............................................................... .. .. ....................... 11
Chapter 3. 44-Pin Demo Board Lessons
3.1 Introduction....................................................................................................13
3.2 44-Pin De m o Boa rd Lessons ............ ............. .. ........................................ .. ...13
3.2.1 Lesson 1: Hello World (Light a LED) .........................................................14
3.2.2 Blink (Delay Loop) .....................................................................................15
3.2.3 Lesson 3: Rotate (Move the LED) .............................................................17
3.2.4 Lesson 4: Analog-to-Digital ....................................................................... 19
3.2.5 Lesson 5: Variable Speed Rotate .............................................................. 22
3.2.6 Lesson 6: Switch Debouncing ................................................................... 23
3.2.7 Lesson 7: Reversible Variable Speed Rotate ............................................ 24
3.2.8 Lesson 8: Function Calls ...........................................................................26
3.2.9 Lesson 9: Timer0 ....................................................................................... 26
3.2.10 Lesson 10: Interrupts ...............................................................................28
3.2.11 Lesson 11: Indirect Data Addressing ......................................................30
3.2.12 Lesson 12: Look-up Table (ROM Array) ..................................................32
© 2007 Microchip Technology Inc. DS41296B-page iii
44-Pin Demo Board User’s Guide
Appendix A. Hardware Schematics
A.1 Introduction...................................................................................................35
Worldwide Sales and Service......................................................................................38
DS41296B-page iv © 2007 Microchip Technology Inc.
44-PIN DEMO BOARD
USER’S GUIDE

Preface

NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is “DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document.
For the most up-to-date information on development tools, see the MPLAB Select the Help menu, and then Topics to open a list of available on-line help files.
®
IDE on-line help.

INTRODUCTION

This chapter contains general information that will be useful to know before using the 44-Pin Demo Board. Items discussed in this chapter include:
• Document Layout
• Conventions Used in this Guide
• Warranty Registration
• Recommended Reading
• The Microchip Web Site
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History

DOCUMENT LAYOUT

This document describes how to use the 44-Pin Demo Board as a development tool to emulate and debug firmware on a target board. The manual layout is as follows:
Chapter 1. “44-Pin Demo Board Ove rvi ew” – This chapter provides an overview of the 44-Pin Demo Board for Microchip’s 44-pin Thin Quad Flatpack (TQFP) PIC
Chapter 2. “Mid-Ra nge PIC chapter provides an overview of the mid-range PIC
Chapter 3. “44-Pin Demo Board Lessons” – This chapter provides lessons that introduce mid-range PIC Demo board features.
Appendix A. “Hardware Schematics” – Illustrates the 44-Pin Demo Board hardware schematic diagram, PCB layout and Bill of Materials.
®
Microcontroller Units (MCU).
®
Microcontroller Ar chitectural Overview” – This
®
MCU assembly instructions and cover basic 44-Pin
®
microcontroller architecture.
© 2007 Microchip Technology Inc. DS41296B-page 1
44-Pin Demo Board User’s Guide

CONVENTIONS USED IN THIS GUIDE

This manual uses the following docum entat io n conven tion s:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic characters Referenced books “MPLAB
Emphasized text ...is the only comp ile r...
Initial caps A window the Output window
A dialog the Settings dialog A menu selection select Enable Programmer
Quotes A field name in a window or
dialog
Underlined, italic text with right angle bracket
Bold characters A dialog button Click OK
N‘Rnnnn A number in verilog format,
Text in angle brac kets < > A key on the keyboard Press <Enter>, <F1>
Courier New font:
Plain Courier New Sam ple source code #define START
Italic Courier New A variable argument file.o, where file can be
Square brackets [ ] Optional arguments mcc18 [options] file
Curly brackets and pipe character: { | }
Ellipses... Replaces r epeated text var_name [,
A menu path File>Save
A tab Click the Power tab
where N is the tota l number of digits, R is th e radi x and n is a digit.
Filenames autoexec.bat File paths c:\mcc18\h Keywords _asm, _endasm, static Command-line options -Opa+, -Opa- Bit values 0, 1 Constants 0xFF, ‘A’
Choice of mutually exclusive arguments; an OR selection
Represents code supplied by user
®
IDE User’s Guide”
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options] errorlevel {0|1}
var_name...] void main (void)
{ ... }
DS41296B-page 2 © 2007 Microchip Technology Inc.

WARRANTY REGISTRATION

Please complete the enclosed Warranty Registration Card and mail it promptly. Sending in the Warranty Registration Card entitles users to receive new product updates. Interim software releases are available at the Microchip web site.

RECOMMENDED READING

This user’s guide describes how to use the 44-Pin Demo Board. Other useful docu­ments are listed below. The following Microchip documents are available and recommended as supplemental reference resources.
PIC16F88X Data Sheet (DS41291)
Consult this document for information regarding the PIC16F88X 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology device specification.
PICkit
Consult this document for instructions on how to use the PICkit 2 Microcontroller Programmer software and hardware.
MPLAB
Consult this document for more information pertaining to the features and functions of the MPLAB In-Circuit Debugger (ICD) software.
MPLAB
Consult this document for more information pertaining to the installation and features of the MPLAB Integrated Development Environment (IDE) Software.
Readme Files
For the latest information on using other tools, read the tool-specific Readme files in the Readmes subdirectory of the MPLAB IDE installation directory. The Readme files contain update information and known issues that may not be included in this user’s guide.
2 Microcontroller Programmer User’s Guide (DS51553)
®
ICD User’s Guide (DS51184)
®
IDE User’s Guide (DS51519)
Preface
© 2007 Microchip Technology Inc. DS41296B-page 3
44-Pin Demo Board User’s Guide

THE MICROCH IP WEB SITE

Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the web site contains the following information:
Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software
General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip consultant program member listin g
Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives

DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE

Microchip’s customer notification service helps keep customers current on Microchip products. Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest.
To register, access the Microchip web site at www.microchip.com, click on Customer Change Notification and follow the registration instructions.
The Development Systems product group categories are:
Compilers – The latest information on Microchip C compilers and other language tools. These include the MPLAB C18 and MPLAB C30 C compilers; MPASM™ and MPLAB ASM30 assemblers; MPLINK™ and MPLAB LINK30 object linkers; and MPLIB™ and MPLAB LIB30 object librarians.
Emulators – The latest information on Microchip in-circuit emulators.This includes the MPLAB ICE 2000 and MPLAB ICE 4000.
In-Circuit Debuggers – The latest information on the Microchip in-circuit debugger, MPLAB ICD 2.
MPLAB Integrated Development Environment for development systems tools. This list is focused on the MPLAB IDE, MPLAB SIM simulator, MPLAB IDE Project Manager and general editing and debugging features.
Programmers – The latest information on Microchip programmers. These include the MPLAB PM3 and PRO MATE Plus and PICkit™ 2 development programmers.
®
IDE – The latest information on Microchip MPLAB IDE, the Windows®
®
II device programmers and the PICSTART®
DS41296B-page 4 © 2007 Microchip Technology Inc.

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. A listing of sales offices and locations is included in the back of this document.
Technical support is available through the web site at: http://support.microchip.com

DOCUMENT REVISION HISTORY

Revision A (August 2006)
• Initial release of this document.
Revision B (December 2006)
• Updated Chapter 1. “PICkit™ 2 Overview”.
• Added Chapter 2. “ Mid- Rang e PIC
• Added Chapter 3. “44- Pin Demo Board Lesson s”.
• Changed PICmicro
• Changed PICkit® to PICkit™.
• Removed Development Systems Information Line from Customer Support bulleted list.
• Updated schematic in Appendix.
®
to PIC
®.
Preface
®
Microcontroller Archi te ctur al Overv iew ” .
© 2007 Microchip Technology Inc. DS41296B-page 5
44-Pin Demo Board User’s Guide
NOTES:
DS41296B-page 6 © 2007 Microchip Technology Inc.

Chapter 1. 44-Pin Demo Board Overview

1.1 INTRODUCTION

44-PIN DEMO BOARD
USER’S GUIDE
The 44-Pin Demo Board is a small and simple demonstration PCB for Microchip’s 44-pin Thin Quad Flatpack (TQFP) PIC with a PIC16F887 MCU, eight LEDs, push button and potentiometer. The demo board has several test points to access the I/O pins of the MCU and a surface mount prototyping area. The MCU can be programmed with the PICkit™ 2 Microcontroller Programmer or the MPLAB
®
ICD 2 using the RJ-11 to 6-pin inline adapter (AC1641 10).
®
Microcontroller Units (MCU). It is populated

1.2 HIGHLIGHTS

This chapter discusses:
• Devices supported by the 44-Pin Demo Board
• The 44-Pin Demo Board Overview
• Running the Default Demonstration

1.3 DEVICES SUPPORTED BY THE 44-PIN DEMO BOARD

The 44-Pin Demo Board can be used with virtually any 44-pin Thin Quad Flatpack (TQFP) PIC MCU. The assembled 44-Pin Demo Board is populated with a PIC16F887-I/PT microcontroller.
Additional 44-Pin Demo Boards can be ordered from Microchip Technology and distrib­utors. Part number, DM164120-2, comes with one assembled and two blank 44-Pin Demo Boards. The blank demo board can be used for evaluating or prototyping circuits using any of the 44-pin devices listed below.
44-pin TQFP Flash Devices:
• PIC16F74 • PIC16F747 • PIC16F77
• PIC16F777 • PIC16F871 • PIC16F874A
• PIC16F877A • PIC16F887 • PIC16F914
• PIC16F917 • PIC18F4220 • PIC18F4221
• PIC18F4320 • PIC18F4321 • PIC18F4331
• PIC18F4410 • PIC18F4420 • PIC18F4423
• PIC18F4431 • PIC18F4450 • PIC18F4455
• PIC18F4480 • PIC18F44J10 • PIC18F4510
• PIC18F4515 • PIC18F4520 • PIC18F4523
• PIC18F4525 • PIC18F4550 • PIC18F4580
• PIC18F4585 • PIC18F45J10 • PIC18F4610
• PIC18F4620 • PIC18F4680 • PIC18F4682
• PIC18F4685
© 2007 Microchip Technology Inc. DS41296B-page 7
44-Pin Demo Board User’s Guide

1.4 44-PIN DEMO BOARD OVERVIEW

The 44-Pin Demo Board is populated with a PIC16F887 MCU (U1), eight LEDs (DS1-DS8), push button (SW1) and potentiometer (RP1). The board layout is shown in Figure 1-1. The demo board has several test points to access the I/O pins of the MCU and a surface mount prototyping area. The MCU can be programmed with the PICkit™ 2 Microcontroller Programmer from header P1.
FIGURE 1-1: 44-PIN DEMO BOARD
PICkit™ 2 Programming Header
Potentiometer RP1
Push Button SW1
LEDs DS1-DS8
Surface Mount
Prototyping
Area

1.5 RUNNING THE DEFAULT DEMONSTRATION

The assembled 44-Pin Demo Board comes preprogrammed with a demonstration program. To use this program, power the demo board (3.0-5.5 V Microcontroller Programmer , or a bench power supply connected to header P2. To use the PICkit™ 2 Microcontroller Programmer , connect it to a PC USB port using the USB cable. St art the PICkit™ 2 Microcontroller Progr ammer PC app lication and click on the target power box to apply power to the demo board. The demo program will blink the eight red lights in succession. Press the push button switch, labeled SW1, and the sequence of the lights will reverse. Rotate the potentiometer, RP1, and the light sequence will blink at a different rate.
DS41296B-page 8 © 2007 Microchip Technology Inc.
DC) using a PICkit™ 2
44-PIN DEMO BOARD
USER’S GUIDE

Chapter 2. Mid-Range PIC® Microcontroller Architectural Overview

2.1 INTRODUCTION

This chapter provides a simple overview of the mid-range PIC® microcontroller architecture.
FIGURE 2-1: SIMPLIFIED MID-RANGE PIC
DIAGRAM
INT
13
Program Counter
8-Level Stack (13-bit)
Direct Addr
Program
OSC1/CLKI
OSC2/CLKO
Flash
4k x 14
Program
Memory
14
Bus
Instruction Reg
8
Instruction
Decode and
Control
Timing
Generation
®
MICROCONTROLLER BLOCK
Data Bus
RAM
256 bytes
File
Registers
9
Addr MUX
7
3
8
W Reg
8
FSR Reg
STATUS Reg
MUX
ALU
8
RAM Addr
Indirect
Addr
Internal
Oscillator
Block

2.2 MEMORY ORGANIZATION

PIC® microcontrollers are designed with separate program and data memory areas. This allows faster execution as the address and data busses are separate and do not have to do double duty.
© 2007 Microchip Technology Inc. DS41296B-page 9
Loading...
+ 29 hidden pages