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 Digital Millennium Copyright Act. If such acts
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 the like is intended through suggestion only
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
No representation or warranty is given and no liability is
assumed by Microchip Technology Incorporated with respect
to the accuracy or use of such information, or infringement of
patents or other intellectual property rights arising from such
use or otherwise. Use of Microchip’s products as critical
components in life support systems is not authorized except
with express written approval by Microchip. No licenses are
conveyed, implicitly or otherwise, under any intellectual
property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, K
EELOQ, microID, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart, rfPIC, and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, MXDEV, MXLAB, PICMASTER, 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, dsPICDEM,
dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR,
FanSense, FlexROM, fuzzyLAB, In-Circuit Serial
Programming, ICSP, ICEPIC, Migratable Memory, MPASM,
MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net,
PICLAB, PICtail, PowerCal, PowerInfo, PowerMate,
PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial,
SmartTel and Total Endurance are trademarks of Microchip
Technology Incorporated 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.
Microchip received ISO/TS-16949:2002 quality system certification for
its worldwide headquarters, design and wafer fabrication facilities in
Chandler and Tempe, Arizona and Mountain View, California in
October 2003. The Company’s quality system processes and
procedures are for its PICmicro
devices, Serial 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.
Index ............................................................................................................................. 49
Worldwide Sales and Service .................................................................................... 52
2004 Microchip Technology Inc.DS51246A-page iii
MCP2120/MCP2150 Developer’s Kit User’s Guide
NOTES:
DS51246A-page iv 2004 Microchip Technology Inc.
MCP2120/MCP2150
DEVELOPER’S KIT 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
on-line help. Select the Help menu, and then Topics to open a list of available on-line
help files.
IDE
INTRODUCTION
The MCP2120/MCP2150 Developer’s Kit demonstrates the capabilities of the
MCP2120 and MCP2150 infrared communication products. The MCP2120 and
MCP2150 Developer’s Board can be connected to either a PC via the DB9 connector,
or to another system (such as a PICDEM™ 2 board) via the four pin header.
The MCP2120/MCP2150 Developer’s Kit comes with the following:
1. Two MCP2120 Developer Boards.
2. One MCP2150 Developer Board.
3. Two serial cables.
4. One 9V power supply, with power cord.
5. One pair 18” (45 cm) power jumper cables.
6. Sample kit (one MCP2120 device and one MCP2150 device) – not shown.
Each kit comes with one MCP2120 device and one MCP2150 device. This
allows a prototype system to be developed that can be used with an MCP2120
Developer’s Board or an MCP2150 Developer’s Board.
7. MCP2120/MCP2150 Developer’s Kit User’s Guide (This document) – not shown.
If you are missing any part of the kit, please contact your nearest Microchip sales
office listed in the back of this publication for help.
2004 Microchip Technology Inc.DS51246A-page 1
MCP2120/MCP2150 Developer’s Kit User’s Guide
FIGURE 1-1:MCP2120/MCP2150 DEVELOPER’S KIT
4
3
4
1
Items discussed in this chapter include:
• About This Guide
• Recommended Reading
• The Microchip Web Site
• Customer Support
3
5
2
1
2
DS51246A-page 2 2004 Microchip Technology Inc.
ABOUT THIS GUIDE
Document Layout
This document describes the MCP2120/MCP2150 Developer’s Kit and tutorials, giving
the user a brief overview of Microchip’s MCP2120 and MCP2150 family of infrared
communication products. Detailed information on the individual device may be found in
the device’s respective data sheet. Detailed information on the PICDEM 2 development
board may be found in the PICDEM 2 User’s Guide (DS30374). The manual layout is
as follows:
• Chapter 1: Getting Started – This chapter gives an overview of the MCP2120
and MCP2150 Developer’s Boards, the hardware features of each Developer’s
Board, the system configurations that can be used to demonstrate the MCP2120
and MCP2150 devices, and the PC requirements.
• Chapter 2: MCP2120 Tutorial – This chapter provides a detailed description of
the steps to get the MCP2120 Developer’s board operating. These steps include
the configuration of the Developer’s boards and the Terminal Emulation program
(Hyperterminal) used on the PC.
• Chapter 3: MCP2150 Tutorial – This chapter provides a detailed description of
the steps to get the MCP2150 Developer’s board operating. These steps include
the configuration of the Developer’s boards, the Terminal Emulation program
(Hyperterminal) used on the PC and the installation and configuration of the PC
IrDA™ standard drivers.
• Chapter 4: Using PICDEM™ 1 or PICDEM 2 Board as Host – This chapter
discusses the use of the PICDEM boards as a demonstration platform as a Host
Controller for an MCP2120 Developer’s Board or an MCP2150 Developer’s
Board. This chapter makes reference to Application Notes which contain
demonstration code.
• Appendix A: Hardware Description – This appendix describes in detail the
hardware of the MCP2120 Developer’s board and MCP2150 Developer’s board.
This includes the component layout of each board (silkscreen) and the schematic
of each board.
Preface
2004 Microchip Technology Inc.DS51246A-page 3
MCP2120/MCP2150 Developer’s Kit User’s Guide
Conventions Used in this Guide
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
DescriptionRepresentsExamples
Arial font:
Italic charactersReferenced booksMPLAB
Emphasized text...is the only compiler...
Initial capsA windowthe Output window
A dialogthe Settings dialog
A menu selectionselect Enable Programmer
QuotesA field name in a window or
dialog
Underlined, italic text with
right angle bracket
Bold charactersA dialog buttonClick OK
‘bnnnnA binary number where n is a
Text in angle brackets < >A key on the keyboardPress <Enter>, <F1>
Courier font:
Plain CourierSample source code#define START
Italic CourierA variable argumentfile.o, where file can be
Choice of mutually exclusive
arguments; an OR selection
Represents code supplied by
user
®
IDE User’s Guide
“Save project before build”
‘b00100, ‘b10
any valid filename
0xFFFF, 0x007A
[options]
errorlevel {0|1}
var_name...]
void main (void)
{ ...
}
DS51246A-page 4 2004 Microchip Technology Inc.
RECOMMENDED READING
The following Microchip documents are available and recommended as supplemental
reference resources.
MCP2120 Data Sheet (DS21618)
MCP2150 Data Sheet (DS21655)
MPASM™ User’s Guide with MPLINK™ Linker and MPLIB™ Library (DS33014)
PRO MATE
PICSTART
MPLAB
MPLAB
AN756, “Using the MCP2120 for Infrared Communication” (DS00756)
AN758, “Using the MCP2150 to Add IrDA
TB046, “Connecting the MCP2150 to the Psion Operating System” (DS91046)
TB047, “Connecting the MCP2150 to the Windows
TB048, “Connecting the MCP2150 to the Windows
TB049, “Connecting the MCP2150 to the Palm™ Operating System” (DS91049)
®
®
Plus User’s Guide (DS51028)
®
ICE User’s Guide (DS51159)
®
ICD User’s Guide (DS51184)
II User’s Guide (DS30082)
Preface
®
Standard Wireless Connectivity” (DS00758)
®
CE Operating System” (DS91047)
®
Operating System” (DS91048)
THE MICROCHIP WEB SITE
Microchip provides online support via our WWW 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 (FAQ), technical
support requests, online discussion groups, Microchip consultant program
member listing
• 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
2004 Microchip Technology Inc.DS51246A-page 5
MCP2120/MCP2150 Developer’s Kit User’s Guide
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
• Development Systems Information Line
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
In addition, there is a Development Systems Information Line which lists the latest
versions of Microchip's development systems software products. This line also
provides information on how customers can receive currently available upgrade kits.
The Development Systems Information Line numbers are:
1-800-755-2345 – United States and most of Canada
1-480-792-7302 – Other International Locations
DS51246A-page 6 2004 Microchip Technology Inc.
DEVELOPER’S KIT USER’S GUIDE
Chapter 1. Getting Started
1.1INTRODUCTION
This chapter covers an overview of the MCP2120 and MCP2150 Developer’s Boards
features, the system configurations that they can be used in and the system
requirements for the tutorials.
1.2HIGHLIGHTS
Items discussed in this chapter are:
• MCP2120 Developer’s Board Features
• MCP2150 Developer’s Board Features
• System Configurations
• PC Requirements
1.3DEVELOPER BOARD FEATURES
1.3.1MCP2120 Developer’s Board Features
MCP2120/MCP2150
The MCP2120 Developer’s Board, as shown in Figure 1-1, has the following hardware
features:
1. On-board +5V regulator for direct input from 9V, 750 mA AC/DC wall adapter or
9V battery.
2. Hooks for a +5V, 750 mA regulated DC supply.
3. DB-9 connector and associated hardware for direct connection to MCP2120
UART (DB-9 interface requires RS-232 signal levels).
5. Two jumpers to select source of UART signals. Either DB-9 connector or the
four-pin header.
6. Three jumpers to select desired baud rate.
7. Green power-on indicator LED.
8. Two IR Transceiver options (two jumpers select transceiver).
9. Jumper to disable MCP2120 device operation.
10. Hardware and Software Baud selection.
11. Jumper for Software Baud control when using RS-232C interface.
12. Socketed crystal.
Note:A schematic of the MCP2120 Developer’s Board is shown in Figure A.25
2004 Microchip Technology Inc.DS51246A-page 7
MCP2120/MCP2150 Developer’s Kit User’s Guide
FIGURE 1-1:MCP2120 DEVELOPER’S BOARD HARDWARE
JP5
R14
DB9
C4
C7
C8
J4
J1
7
R1
Q1
U3
R2
C3
R9D3
Y1
JP3:JP1
000=F
C2
001=F
010=F
011=F
100=F
111=S/W Baud
Open=0
Header
D6 D2
JP4
R4
(MCP2120)
Open=Enabled
R8 R7 R6
OSC/768
OSC/384
OSC/192
OSC/128
OSC/64
RXTXMODE
RTS
J3
456
1
U5
J5
D4
3
C13
C9
C5
C1
J2
MCP2120 Developer’s Board
02-01608 Rev. 1
C15
C12
CR1
C14
U1
11
U2
C17
C6
R3
C10
R10
Component
Transceiver
J6
Integrated
Transceiver
R13
C16
GND
+5V
12
U4
R5
R11
J7
C11
R12
D1
D5
R15
C18
2
9
8
U6
10
DS51246A-page 8 2004 Microchip Technology Inc.
Getting Started
1.3.2Selecting UART Source and Optical Transceiver Interface
Figure 1-2 shows two pairs of jumpers used to route signals to and from the MCP2120.
Jumpers J1 and J4 are used to determine the source of the signals used by the UART
interface. When the header has the pins closest to the “DB9” label jumpered to the
center pin, the DB9 is the source of the UART signal. When the header has the pins
closest to the “Header” label jumpered to the center pin, the four-pin header is the
source of the UART signal.
Jumpers J6 and J7 are used to determine the source and destination of the infrared
data signals used by the interface between the MCP2120 and Optical Transceiver.
When the header has the pins closest to the “Integrated Transceiver” label jumpered to
the center pin, the integrated transceiver is used. When the header has the pins closest
to the “Component Transceiver” label jumpered to the center pin, the component
transceiver logic is used.
FIGURE 1-2:MCP2120 SELECTING SOURCES
C11
R15
C18
U4
R5
R11
D1
D5
J7
R12
U6
U5
J5
C15
D4
C12
C13
C9
C5
C1
J2
MCP2120 Developer’s Board
02-01608 Rev. 1
CR1
C14
U1
JP5
R14
C4
C7
C8
J4
DB9
J1
R9
D3
D6 D2
U2
C17
C6
R3
Y1
R4
(MCP2120)
Open=Enabled
R8 R7R6
R1
Q1
U3
JP3:JP1
OSC/768
000=F
C2
R2
001=F
OSC/384
010=F
OSC/192
OSC/128
011=F
100=F
C3
OSC/64
111=S/W Baud
Open=0
RXTXMODE
Header
JP4
RTS
C10
R10
Component
Transceiver
J6
Integrated
Transceiver
R13
C16
J3
GND
+5V
These two jumpers select the
source of the Host signals.
J1 and J4
Header is source.
These two jumpers select the
optical transceiver logic. Both jumpers
should connect the same pin positions
J6 and J7
Component Transceiver
DB9 is source.
Integrated Transceiver
2004 Microchip Technology Inc.DS51246A-page 9
MCP2120/MCP2150 Developer’s Kit User’s Guide
1.3.3Selecting Baud Rate
Figure 1-3 shows the three Baud Rate Select Jumpers (JP3:JP1) and the baud rate
formula that is specified (baud rate dependant on MCP2120 operational frequency).
Table 1-1 shows the baud rates for some crystal frequencies.
FIGURE 1-3:MCP2120 BAUD RATE
U2
C6
R3
C10
R5
R10
Component
Transceiver
J6
Integrated
Transceiver
R13
C16
GND
+5V
C11
U4
R11
D1
D5
J7
R12
U5
J5
D4
C13
C9
C5
C1
J2
MCP2120 Developer’s Board
02-01608 Rev. 1
C15
C12
CR1
C14
U1
JP5
R14
C4
C7
C8
J4
DB9
J1
R1
Q1
U3
R2
C3
These three jumpers select the baud rate:
JP3:JP2:JP1
JP3:JP2:JP1
R9
Y1
C2
Header
D3
JP4
R4
(MCP2120)
Open=Enabled
R8 R7R6
JP3:JP1
OSC/768
000=F
OSC/384
001=F
010=F
OSC/192
OSC/128
011=F
OSC/64
100=F
111=S/W Baud
Open=0
RXTXMODE
D6 D2
RTS
J3
C17
R15
C18
U6
FOSC/768
OSC/384
F
FOSC/192
FOSC/128
OSC/64
F
Software Baud Mode
TABLE 1-1:HARDWARE BAUD RATE SELECTION VS. FREQUENCY
FOSC Frequency (MHz)
BAUD2:BAUD0
000
001
010
011
100
0.6144
2.000 3.6864 4.9152 7.3728 14.7456
80026044800640096001920026042 FOSC / 768
16005208960012800192003840052083 FOSC / 384
320010417 1920025600 3840078600104167 FOSC / 192
480015625 2880038400 57600115200156250 FOSC / 128
960031250 5760078600 115200230400312500 FOSC / 64
(1)
Note 1:An external clock is recommended for frequencies below 2 MHz.
2:For frequencies above 7.5 MHz, the TXIR pulse width (MCP2120 Data Sheet,
Electrical Specification, parameter IR121) will be shorter than the minimum pulse
width of 1.6 ms in the IrDA standard specification.
(2)
20.000
(2)
Bit Rate
DS51246A-page 10 2004 Microchip Technology Inc.
Getting Started
1.3.4UART Mode
Figure 1-4 shows the jumper which determines if the MCP2120 Developer’s Board is
to be used in Hardware Baud operation, or Software Baud operation. When in Software
Baud operation, an additional signal is required, Request To Send (RTS), which is used
to drive the RESET
FIGURE 1-4:MCP2120 UART
pin low to cause a change of baud rate to occur.
R9D3
U5
J5
C15
D4
C12
C13
C9
C5
C1
J2
MCP2120 Developer’s Board
02-01608 Rev. 1
CR1
C14
U1
JP5
R14
C4
C7
C8
J4
DB9
J1
R1
Y1
R4
(MCP2120)
Open=Enabled
R8 R7R6
Q1
U3
JP3:JP1
000=F
C2
R2
C3
OSC/768
001=F
OSC/384
010=F
OSC/192
011=F
OSC/128
OSC/64
100=F
111=S/W Baud
Open=0
RXTXMODE
Header
JP4
RTS
D6 D2
J3
U2
C17
C10
R10
Component
Transceiver
J6
Integrated
Transceiver
+5V
R13
C16
C11
R15
C6
R3
GND
C18
U4
R5
R11
D1
D5
J7
R12
U6
PC UART configuration for Hardware/Software Baud mode
Hardware Baud Selection
Software Baud Selection
2004 Microchip Technology Inc.DS51246A-page 11
MCP2120/MCP2150 Developer’s Kit User’s Guide
1.3.5Disabling the MCP2120
Figure 1-5 shows the jumper, JP4, which will enable or disable the MCP2120 device.
When the MCP2120 is disabled, the device will consume less current.
FIGURE 1-5:MCP2120 ENABLE/DISABLE
U2
C6
R3
C10
U4
R5
R10
Component
Transceiver
J6
Integrated
Transceiver
R13
C16
GND
+5V
J7
R11
C11
R12
D1
D5
U5
J5
C15
D4
C12
C13
C9
C5
C1
J2
MCP2120 Developer’s Board
02-01608 Rev. 1
CR1
C14
U1
JP5
R14
C4
C7
C8
J4
DB9
J1
R9D3
Y1
R1
Q1
U3
JP3:JP1
000=F
C2
R2
001=F
010=F
011=F
100=F
C3
111=S/W Baud
Open=0
Header
D6 D2
JP4
R4
(MCP2120)
Open=Enabled
R8 R7R6
OSC/768
OSC/384
OSC/192
OSC/128
OSC/64
RXTXMODE
RTS
C17
J3
R15
C18
U6
MCP2120 Enable/Disable
Enabled
Disabled
In most cases, this jumper will be open. It may be closed to test system operation when
the MCP2120 is disabled. The Host Controller board may control the operation of the
MCP2120 by connecting a signal to the JP4 header as shown in Figure 1-6.
FIGURE 1-6:HOST CONTROLLER DISABLING THE MCP2120
MCP2120 Developer’s Board
MCP2120
EN
JP4
Host Controller
I/O Pin
(High or Hi Impedance = Enabled
Low = Disabled)
DS51246A-page 12 2004 Microchip Technology Inc.
Getting Started
1.3.6MCP2150 Developer’s Board Features
The MCP2150 Developer’s Board, as shown in Figure 1-7, has the following hardware
features:
1. On-board +5V regulator for direct input from 9V, 750 mA AC/DC wall adapter or
9V battery.
2. Hooks for a +5V, 750 mA regulated DC supply.
3. DB-9 connector and associated hardware for direct connection to MCP2150
UART (DB-9 interface requires RS-232 signal levels).