2004 Microchip Technology Inc. DS51487A
MCP2140 IrDA® Standard
Wireless Temperature Sensor
Demo Board Users Guide
DS51487A-page ii 2004 Microchip Technology Inc.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR WAR-
RANTIES OF ANY KIND WHETHER EXPR ESS 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. Us e 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 Microchip intellectual property
rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICST AR T ,
PRO MAT E, PowerS mart , rfPIC , and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, MX DE V, MXLAB, PICMASTER, SEEV AL,
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, dsP ICworks, ECAN, ECONOMONITOR,
FanSense, FlexROM, fuzzy LAB , In-Circuit Serial
Programming, ICSP, ICEPIC, Migratable Memory, MPASM ,
MPLI B, MPLIN K, MPSIM, PICki t, PICDEM, PICDEM.net ,
PICL AB, PICtail, PowerCal, Pow erInfo , PowerMat e,
PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial,
SmartTel and Total Endurance are trademarks of Microchip
Tec hnology Incorporat ed in the U.S.A. and other countries.
SQTP is a service mark of Microchip T echnology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2004, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
Note the following details of the code protectio n feature on Microchi p 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 i ts 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 integrit y 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 ar e committed to continuously improving the c ode pr otection 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.
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® 8-bit MCUs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipher als, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page iii
Table of Contents
Preface ...........................................................................................................................1
Chapter 1. Product Overview........................................................................................ 5
1.1 Introduction ..................................................................................................... 5
1.2 What is the MCP2140 IrDA® Sta ndard Wireless Temperature
Sensor Demo Board? .....................................................................................5
1.3 What the MCP2140 IrDA Standard W ireless Temperature Sensor
Demo Board Kit Includes ...... ......................................................................... .5
Chapter 2. MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board ...7
2.1 Introduction ..................................................................................................... 7
2.2 Fe a t u re s ..... ....... ....... .. ...... ....... ....... ...... ....... ...... ....... .. ....... ....... ...... ....... ...... ... 7
2.3 Ge tting St a rted ...... ....... ....... ...... ....... ...... ... ...... ....... ....... ...... ....... ...... ....... ....... 7
2.4 R u nn i n g th e d emos .... .. .. ....... ...... ....... ....... ...... ....... ....... .. ...... ....... ....... ...... ... 11
2.5 MCP2140 IrDA Standard Wireless Temperatur e Se nsor Demo Board
Des cr ip t io n ....... ...... ....... ....... ...... ....... ...... ....... .. ....... ....... ...... ....... ...... ....... ..... 19
Appendix A. Schematic and Layouts ........................................................................25
A.1 Intr oduction ..................................................................................................25
A.2 Schematics and PCB Layout . ................. .............. .. ............................. .. ...... 25
A.3 ECNs .......................... ..................................................................................32
Appendix B. Bill-Of-Materials (BOM) .........................................................................33
Appendix C. MCP2140 Connection Sequence Overview ........................................35
Appendix D. MCP2140 250 Byte Data Transmit Table .............................................37
Appendix E. Alternate Optical Transceiver Implementation ................................... 39
E.1 Intr oduction ..................................................................................................39
E.2 Vishay® TFDU 4300 Implementation ...........................................................40
E.3 Agilent® HSDL 3000 Implementation ...........................................................41
Appendix F. Using AN888 Program with a Palm™ PDA ..........................................43
F.1 Introduction ..................................................................................................43
Worldwide Sales and Serv ice ....................................................................................48
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page iv 2004 Microchip Technology Inc.
NOTES:
MCP2140 IrDA ® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 1
Preface
INTRODUCTION
This chapter contains general information that will be useful to know before using the
MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board. Items discussed
in this chapter include:
About This Guide
Recommended Reading
The Microchip Web Site
Customer Support
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 ref er
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 inform ation on development tools, see the MPLAB® IDE
on-line help. Select the Help menu, and then Topics to open a list of available on-line
help files.
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 2 2004 Microchip Technology Inc.
ABOUT THIS GUIDE
Document Layout
This document describes how to use the MCP2140 IrDA® Standard
Wireless Temperature Sensor Demo Board User’s Guide.
The manual layout is as follows:
Chapter 1: Product Overview Information about the MCP2140 IrDA Standard
Wireless Temperature Sensor Demo Board.
Chapter 2: MCP2140 IrDA Standard Wireless Temperature Sensor Demo
Board – This chapter includes a detailed description of the hardware instructions
on how to get started with this demo board, a description of functions of the demo
board and instructions on running the demos.
Appendix A: Schematic and Layouts – Shows the schematic and layout
diagrams for the MCP2140 IrDA Standard Wireless Temperature Sensor Demo
Board.
Appendix B: Bill of Materials Lists the parts used to build the MCP2140 IrDA
Standard Wireless Temperature Sensor Demo Board.
Appendix C: Connection Sequence – Shows the high-level connection
sequence between a Primary device and the MCP2140 (Secondary device). This
connection sequence is shown at an overview level and does not detail exact
operation.
Appendix D: 250 Byte Transmit Table – This table shows the data that is
transmitted by the program when in 250 Byte Transmit mode.
Appendix E: Alternative Optical Transceiver Selection – This boa rd was
designed to support the Vishay® TFDU 4100 (default selection), TFDU 4300 and
the Agilent® HSDL 3000. This section describes what needs to be done to
implement one of the other two options.
Appendix F: Using AN888 Program with a Palm™ PDA – Shows how to use
the Palm PDA and Application Note 888, “Programming the Palm OS® for
Embedded IR Applications” (DS00888), to demonstrate the demo board.
Preface
2004 Microchip Technology Inc. DS51487A-page 3
Conventions Used in this Guide
This manu al us es the followi ng docum entatio n conv en tion s:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic char acters Referenced books MPLAB® IDE User’s Guide
Emphasized text ...is the only compile 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 “Save project before build”
Underlined, italic text with
right angle bracket A menu path File>Save
Bold characters A dialog button Click OK
A tab Click the Power tab
‘bnnnn A binary number where n is a
digit ‘b00100, ‘b10
Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>
Courie r fo nt:
Plain Courie r Sample source code #define START
Filenames autoexec.bat
File paths c:\mcc18\h
Keywords _asm, _endasm, static
Command-line options -Opa+, -Opa-
Bit values 0, 1
Italic Courier A variable argument file.o, where file can be
any val id filena me
0xnnnn A hexade cimal nu mber whe re
n is a hexadecimal digit 0xFFFF, 0x007A
Square brackets [ ] Optional arguments mcc18 [options] file
[options]
Curly brackets and pipe
character: { | } Choice of mutually exclusive
arguments; an OR selection errorlevel {0|1}
Ellipses... Replac es repeated text var_name [,
var_name...]
Represents code supplied by
user void main (void)
{ ...
}
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 4 2004 Microchip Technology Inc.
RECOMMENDED READING
This user's guide describes how to use the MCP2140 IrDA S t andard Wireless Temper-
ature Sensor Demo Board. Other useful documents are listed below. The following
Microchip documents are available and recommended as supplemental reference
resources.
MCP2140 Data Sheet (DS21790 )
This data sheet provides detailed information regarding the MCP2140 device.
THE MI CR O C H IP WEB SIT E
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 SupportData 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 and the Microchip consultant program
member listing
Business of Microchip – Product selector and ordering guides, latest Microchip
press rele ases, listing of seminars and events, listings of Microchip sales offices,
distributors and factory representatives
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 ad dit ion , th ere i s a Deve lopm ent S ys tems I nfo rma tion Line wh ich l ist s t he l ates t ve r-
sions 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-73 02 – Othe r Interna tional Loca tio ns
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 5
Chapter 1. Product Overview
1.1 INTRODUCTION
This ch ap ter pro vid es an ov er vi ew of th e MC P2 14 0 Ir DA ® Standard Wireless
Temp er a tur e Sens or D emo Bo ard an d co vers the follow in g t opics:
What is the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board?
What the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board kit
includes
1.2 WHAT IS THE MCP2140 IrDA STANDARD WIRELESS TEMPERATURE
SENSOR DEMO BOARD?
The MCP2140 IrDA Standard Protocol Stack Controller device allows the system
designer to implement a low-cost wireless IR port in any application, providing support
for the IrDA standard protocol stack and IrDA standard bit encoding/decoding.
The MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board is used to
evaluate and demonstrate the MCP2140 device in a data-logging application by
transmitting ambient temperature to a PDA (e.g., Palm™ PDA) or laptop computer. It
is intended to serve as an example to assist system designers in developing an IrDA
standard node using the MCP2140 device.
1.3 WHAT THE MCP2140 IrDA ST ANDARD WIRELESS T EMPERATURE SENSOR
DEMO BOARD KIT INCLUDES
This MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board Kit includes:
The MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board
Demo Board Firmware
MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board User’s
Guide
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 6 2004 Microchip Technology Inc.
NOTES:
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 7
Chapter 2. MCP2140 IrDA Standard W ireless
Tempera ture Sensor Demo Board
2.1 INTRODUCTION
The MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board
demonstrates the MCP2140 device in a real-world application. In addition, the system
designer will be able to use this design as an example of how to integrate an IR port
into their system.
2.2 FEATURES
The MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board has the
following features:
Demo board communicates directly to Primary device (PDA or laptop computer)
running a terminal emulation application program
Data is transmitted in an easy-to-read format
Reprogrammable PIC18F1320 with In-Circuit Debugger (ICD) interface for user
application development
Header that allows either several board signals to be monitored or allows the
MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board to be
interfaced to user’s system
Three LEDs that indicate MCP2140 status (CTS, DSR and PHACT activity)
Powered by three AAA batteries
Power jumper and power LED indicator
2.3 GETTING STARTED
The MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board is fully assem-
bled and test ed for evaluation and demonstration of the MCP2140 features. A block
diagram of the d emo board is shown in Figu re 2-1. Refer to Appendix A. “Schematic
and Layout s” and Appendix B. “Bill-Of-Materials ( BOM)” for more detailed circuit
information.
FIGURE 2-1: MCP2140 DEMO BOARD BLOCK DIAGRAM
Power
PIC18F1320
Optical
Transceiver
MCP2140
IrDA®
Standard Controller
Temp
Sensor
TC1047A
ICD Header
DSR
CTS
PHACT
J1 U1
U11
U2
Three AAA
1.5V Batteries
LEDs
System
Power
Control/Status
UART
72TXIR
RXIR
3
RESETS2
(for programming)
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 8 2004 Microchip Technology Inc.
2.3.1 The Hardware
Figure 2-2 shows the layout of the MCP2140 IrDA Standard Wireless Temperature
Sensor Demo Board with points of interest encircled.
Figure 2-3 shows the switches used to reset the PIC18F1320 and selects one of two
demo programs. The RESET switch resets the PIC18F1320, while switch S2 is used
for pr ogram selection.
FIGURE 2-2: MCP2140 IrDA® STANDARD WIRELESS TEMP SENSOR DEMO BOARD
Signal Header
ICD Header
PIC18F1320
LED Signal Indic a tors
Demo Board Power Jumper
Shorted = Board connected to battery supply
Open = Board NOT connected to battery supply
Optical Transceiver
MCP2140
Switches
Supports:
TFDU 4100 (Default)
TFDU 4300 (Optional)
HSDL 3000 (Optional
)
2004 Microchip Technology Inc. DS51487A-page 9
FIGURE 2-3: MCP2140 IrDA® STANDARD WIRELESS TEMP SENSOR DEMO BOARD
When RESET switch Depressed to not Depressed
If: S2 = Depressed: temperature sensor firmware routine is initialized.
S2 = Not depressed: data upload firm ware routine is initialized.
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 10 2004 Microchip Technology Inc.
2.3.2 The Embedded System Firmware
There are two programs that can be demonstrated on the demo board. These are:
The transmission of a 250 byte data string from a table in the PIC18F1320 to the
Primary device.
The transmission of the “temperature” reading of the TC1047A to the Primary
device.
T ypical Primary devices include Palm or Pocket PC PDAs and Laptop PCs with an IrDA
standard infrared port.
The PIC18F1320 source code for the MCP2140 IrDA S t andard Wireless Temperature
Sensor Demo Board is available for download from the Microchip web site at
www.microchip.com.
2.3. 2.1 “TRANSMIT 250 BYTE DATA STRING” PROGRAM DESCRIPTION
This program will be selected when the RESET switch is depressed and then released
(wi th th e S2 switch not pressed). The PIC18F1320 will initialize the system and wait to
receive a data byte. Once a data byte is received, the PIC18F1320 will transmit a
250-byte table from memory to the MCP2140.
The PIC18F1320 follows the flow control of the MCP2140 to ensure that data is not lost.
The MCP2140 handles all the IrCOMM protocol for the data packets that it receives
from the PIC18F132 0.
Once the table has completed transmission, the PIC18F1320 will wait to receive the
next character that will cause the 250-byte table to be transmitted (again).
The 250-byte data table transmitted from the MCP2140 IrDA S tandard Wireless Temper-
ature Sensor Demo Board to the Primary device is shown in Appendix D. “MCP2140
250 Byte Data Transmit Table”. These values will be displayed in the Primary device’s
Terminal Emulation program window.
2.3.2.2 “TRANSMIT TEMPERATURE” PROGRAM DES CRIPTION
This program will be selected when both the RESET and S2 switches are depressed,
the RESET switch is released and the S2 switch is held momentarily . The PIC18F1320
will initialize the system and wait to receive a data byte. Once a data byte is received,
the PIC18F1320 will continuously transmit the following string:
“Temp = xx” to the MCP2140, approximately once per second, where xx is the
temperature in °C.
The PIC18F1320 follows the flow control of the MCP2140 to ensure that data is not lost.
The “measured” temperature will vary as a result of the system voltage of the demo
board. This is due to the PIC18F1320 being powered directly from the AAA batteries
and the A/D module using VDD as its reference voltage.
The current firmware implementation will transmit a larger value to the Primary device
as the battery voltage decreases, given a constant temperature.
A firmware technique to correct for this would be to use the PIC18F1320 LVD module.
A hardware technique would be to use a voltage regulator to ensure that the system
voltage remains constant, regardless of the voltage output of the batteries.
2004 Microchip Technology Inc. DS51487A-page 11
2.4 RUNNING THE DEMOS
This demo board can interface to any Primary device that implements the IrCOMM
9-wire “cooked” protocol layer. Some typical Primary devices include:
1. Palm PDA
2. Pocket PC PDA
3. Laptop PC with IrDA Standard P ort
To communicate with the MCP2140 IrDA Standard Wireless Temperature Sensor
Demo Board, these devices must run a terminal emulation program (such as
HyperTerminal® on the PC).
For the Palm OS® devices, there is a program called Online. For more information
about Online and the setup of this application, refer to page 23 of Application Note 858,
“Interfacing the MCP215X to a Host Microcontroller”, or go to the Mark S pace web site
(www.MarkSpace.com).
Microchip has not evaluated any Terminal Emulation programs for Pocket PC OS
dev ices at thi s time. Refe r to Section 2.4.1 “Alternative Primary Device Programs”
for an alternative Primary device program.
For a Windows® XP system, a 3rd-party driver needs to be installed to “create” the
“virtual port” that HyperTerminal needs to connect to that allows it to use the IR port for
communications. This driver is called IrCOMM2K and is available at
www.IRCOMM2K.de. Please evaluate this product before installing onto your system
to ensure that it will meet your requirements.
Microchip does not imply any suitability to your system requirements of any of these
3rd-party products. Please evaluate each product’s specifications and requirements
before installing onto your system.
Two step-by-step examples for this demo will be presented. Section 2.4.2 “Using a
Palm PDA or Equivalent as the Primary Device shows the steps using a Palm PDA,
while Section 2.4.3 “Using a Laptop PC as the Primary Device” shows the steps
using a Windows® XP based laptop with IR port.
2.4.1 Alternative Primary Device Programs
Microchip also has some example Primary Device programs that could be used to
demonstrate the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board.
These programs were not developed for this demo board and may not display all
modes of operation in a straight-forward manner (such as the “Tr ansmit Temperature”
program). These programs are discussed in the following application notes:
For Palm OS - Application Note 888, “Programming the Palm OS® for Embedded
IR Applications” (DS00888)
For Pocket PC OS - Application Note 926, “Programming the Pocket PC OS for
Embedded IR Applications” (DS00926)
For Windows XP - Application Note 941, “Prog rammi ng Windows ® XP for
Embedded IR Applications” (DS00941)
Appendix F. “Using AN888 Program with a Palm™ PDA” shows how to use the
Palm PDA and AN888 to demonstrate the demo board. The operation for the Pocket
PC and Windows XP applications are similar and are discussed in AN926 and AN941.
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 12 2004 Microchip Technology Inc.
2.4.2 Using a Palm PDA or Equivalent as the Primary Device
Section 2.4.2.1 “Operating the “Transmit 250 Byte Data String” program”
discusses how to operate the “Transmit 250 Byte Data S tring” program, while Section
2.4.2.2 “Operating the “Transmit Temperature” Program discusses how to
operate the “Transmit Temperature” program.
2.4.2.1 OPERATING THE “TRANSMIT 250 BYTE DATA STRING” PROGRAM
1. Ensure 3 AAA batteries are properly inserted into the battery holder.
2. Connect JP1 (closed position). The power LED (D5) will turn on. After a few
seconds, the PHACT LED (D4) will also turn on, indicating that the MCP2140’s
protocol handler is in the Non-Discovery Mode (NDM) state or the MCP2140 is
in the Low-power mode.
3. Depress and release the RESET button.
4. Turn on the Palm (or equivalent) PDA.
5. With both devices on a flat surface, place the Palm PDA about 25 cm (10”) away
from the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board,
pointing the IR port of the Palm PDA (dark red window at the top of the PDA)
toward the two clear LEDs (D1, D6) on the MCP2140 IrDA Standard Wireless
Temperature Sensor Demo Board.
6. Open the Online program on the Palm PDA.
7. Tap the ON button.
8. Tap the 123 button.
9. Tap any number (0-9). This is the command that will be received by the
MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board, instructing
the program to send a data string back to the Palm PDA. At this time, the DSR
(D2), CTS (D3) and PHACT (D4) LEDs are turned off.
10. Send the command by tapping the DONE button. Once the DONE button has
been tapped, the DSR and PHACT LEDs will turn on and the CTS LED will strobe
until all the data has been transmitted.
11. The Palm PDA window should receive a string of data as shown in Figure 2-4.
FIGURE 2-4: ONLINE WINDOW AFTER RECEIVING 250 BYTE DATA
STRING
12. Repeating steps 8 through 10 will cause the Palm PDA to transmit another data
byte and receive another data string.
13. In the Palm window , tap the ON button (it becomes unshaded - normal display).
The DSR and CTS LEDs will immediately turn off and the PHACT LED will turn
on in about 10 seconds .
abc123 Intl Ctl Esc
On Log <^v>Macros
i
32345678
4bcdefgh
52345678
6BEDEFGH
72345678
8bcdefgh
92345678
ABCDEFGH
B2345678
Cbcdefgh
D2345678
EBCDEFGH
F2345678
1bcdefgh
22345678
2004 Microchip Technology Inc. DS51487A-page 13
2.4.2.2 OPERATING THE “TRANSMIT TEMPERATURE” PROGRAM
1. Ensure 3 AAA batteries are properly inserted into the battery holder.
2. Connect JP1 (closed position). The power LED (D5) will turn on. After a few
seconds, the PHACT LED (D4) will also turn on, indicating that the MCP2140’s
protocol handler is in the NDM (Non-Discovery Mode) state or the MCP2140 is
in the Low-power mode.
3. Depress the RESET and S2 buttons, then release the RESET button (keep the
S2 button depressed).
4. Release the S2 button.
5. Turn on the Palm (or equivalent) PDA.
6. With both devices on a flat surface, place the Palm PDA about 25 cm (10”) away
from the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board,
pointing the IR port of the Palm PDA (dark red window at the top of the PDA)
toward the two clear LEDs (D1, D6) on the MCP2140 IrDA Standard Wireless
Temperature Sensor Demo Board.
7. Open the Online program on the Palm PDA.
8. Tap the ON button. (it becomes shaded - reverse video).
9. Tap the 123 button.
10. Tap any number (0-9). This is the command that will be received by the
MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board, instructing
the program to begin sending temperature data to the Palm PDA. At this time,
the DSR (D2), CTS (D3) and PHACT (D4) LEDs are turned off.
11. Send the command by tapping the DONE button. Once the DONE button has
been tapped, the DSR and PHACT LEDs will turn on and the CTS LED will strobe
until all the data has been transmitted.
12. The Palm PDA window should receive a string of data about every second, as
shown in Figure 2-5.
FIGURE 2-5: ONLINE WINDOW AFTER RECEIVING TEMPERATURE DAT A
STRING
13. Device U4 is the TC1047A temperature sensor device. The output is connected
to an A/D channel of the PIC18F1320. Changing the temperature of this device
will effect the ”temperature” value that is transmitted to the Primary device.
14. In the Palm window , tap the ON button (it becomes unshaded - normal display).
The DSR and CTS LEDs will immediately turn off and the PHACT LED will turn
on in about 10 seconds .
abc123 Intl Ctl Esc
On Log <^v>Macros
i
Temp = 28
Temp = 28
Temp = 28
Note: Temperature value transmitted by the PIC18F1320 will be dependent on
battery voltage (see Section 2.3.2.2 ““Transmit Temperature” Program
Description”).
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 14 2004 Microchip Technology Inc.
2.4.3 Using a Laptop PC as the Primary Device
To use a Laptop PC with an IrDA standard port as the Primary device, the Terminal
Emulation program needs to be able to “connect” to the IR port. In Windows 2000 and
Windows XP systems, this requires the installation of a 3rd Party driver . One 3rd Party
driver is called “IrCOMM2K (www.IRCOMM2K.de). Once the IrCOMM2K driver is
installed, it creates a “new” com port (such as COM7). This is a virtual serial port that
the PC Terminal Emulation application program (such as HyperTerminal) can be con-
nected to. Then HyperTerminal needs to be configured. Refer to Section
2.4.3.1 “Configuring HyperTerminal”.
After configuring Hyper Termina l, Section 2.4.3.2 “Running the Demo Using
HyperTerminal” di sc usse s ho w to operate the MCP 2140 Ir DA Standar d Wirele ss
Temperature Sens or Demo Boar d via Hy perTerminal .
2.4.3.1 CONFIGURING HYPERTERMINAL
1. S tart the HyperTerminal Emulation program (usually located under the Programs
> Accessories > Communications directory.
FIGURE 2-6: CONNECTION DESCRIPTION WINDOW
2. In the Connection Description window, select the Cancel button.
3. In the programs menu, select File > Properties.
4. In the New Connection Properties window on the Connect To tab, go to the
Connect Using” pull-down and select the virtual serial port created by the
IrCOMM2K driver installation (such as COM7).
FIGURE 2-7: NEW CONNECTION PROPERTIES WINDOW
2004 Microchip Technology Inc. DS51487A-page 15
5. Select the Configure button.
FIGURE 2-8: COM7 PROPERTIES WINDOW
6. In the COMx (COM7) Properties window, configure the Port Set ting for:
-“Bits per second:” = 115200
-“Data Bits:” = 8
-“Parity:” = None
-“Stop Bit:” = 1
-“Flow Control:” = None
7. Select the OK button.
8. In the New Connection Properties window, select the Settings tab.
FIGURE 2-9: NEW CONNECTION PROPERTIES WINDOW - SETTINGS TAB
9. Configure the New Connection Properties Settings.
- Under the “Function, arrow and control keys act as” item, select the
Terminal Keys radio button.
- Under the “Backspace key sends” item, select the Ctrl+H radio but ton.
-From theEmulation” pull-down menu, select Auto-detect.
-For “Telnet Terminal ID”, enter ANSI.
-ForBackscroll buffer lines”, select 500 from the pull-down menu.
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 16 2004 Microchip Technology Inc.
10. Select the AS CII Setup button, this will open a new window.
FIGURE 2-10: NEW CONNECTION PROPERTIES - ASCII SETUP
11. In the “ASCII Sending” portion of the window:
-CheckSend Line ends with line feeds”.
-CheckEcho typed char ac ters loc al ly” .
- Set the “Line Delay” and the “Character Delay to ‘0 milliseconds.
12. In the “ASCII Receiving” portion of the window:
- Uncheck “Append line feeds to incoming line ends.
- Uncheck “Force incoming data to 7-bit ASCII.
-CheckWrap lines that exceed terminal width”.
13. Select the OK button.
14. Select the Input Translation button.
- In the “Host System Encoding Method” window , select Shift-JIS. Then
sele ct t he OK button in the New Connection Properties window.
FIGURE 2-11: NEW CON NECTION PROPERTIES - HOST SYSTEM
ENCODING METHOD
15. Now that all the settings are configured, in HyperTerminal’s pull-down menu,
select File > Sa ve As . Select the name that you wish.
2004 Microchip Technology Inc. DS51487A-page 17
2.4.3.2 RUNNING THE DEMO USING HYPERTERMINAL
Now that the HyperTerminal application program is configured, the PC can communi-
cate with the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board.
Section 2.4.3.2.1 “Operating the “Transmit 250 Byte Data String” Program”
discusses how to operate the “Transmit 250 Byte Data String” program, while Section
2.4.3.2.2 “Operating the “Transmit Temperature” Program” discusses how to
operate the “Transmit Temperature” program.
2.4.3.2.1 Operating the “Transmit 250 Byte Data String” Program
1. Ensure 3 AAA batteries are properly inserted into the battery holder.
2. Connect JP1 (closed position). The power LED (D5) will turn on. After a few
seconds, the PHACT LED (D4) will also turn on, indicating that the MCP2140 is
in the Non-Discovery Mode (NDM) state.
3. Depress and release the RESET button.
4. Turn on the PC laptop.
5. With both devices on a flat surface, place the Palm PDA about 25 cm (10”) away
from the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board,
pointing the IR port of the PC toward the two clear LEDs (D1, D6) on the
MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board.
6. If the PC is configured to show the IR icon in the system tray, a single IR LED
icon will be displayed. Placing the mouse cursor over this icon will display the
message “MCP2140 A5 is in range”, where “MCP2140 A5” is the Device ID of
the MCP2140.
7. Start the HyperTerminal program using the saved setting from Section
2.4.3.1 “Configuring HyperTerminal”. When HyperTerminal starts, it is in the
connected state. To disconnect, click on the telephone icon (4th icon from left on
toolbar). To connect, click on the telephone icon (3rd icon from left). Depending
on the current state of the HyperTerminal session, only one of the two telephone
icons will be active (the other will be grayed out).
8. Ensure that the HyperTerminal session indicates “Connected” (lower-left of
HyperTerminal window) and the icon in the system tray changes to two IR LEDs
facing each other and “talking”.
9. Place the mouse cursor over the IR icon in the system tray. The message
displayed now says “Wireless link with MCP2140 A5 at 9600 bps”. This shows
that a link is established for data communication and that the IR communication
rate is 9600 bps (even though the HyperT erminal program is “talking” to the driver
at 115200, the IrDA standard hardware is communicating at the rate negotiated
with the MCP2140.
10. Type any number (0-9) in the HyperTerminal window. The MCP2140 IrDA Stan-
dard Wireless Temperature Sensor Demo Board requires a receive byte before
transmitting it s data. This is due to t he requirement of most PDAs needing to
transmit a data byte before opening the IR Link. The data byte is sent as it is
typed. At this time, the DSR (D2), CTS (D3) and PHACT (D4) LEDs are turned off.
11. The HyperTerminal window should receive a string of data as shown in
Appendix D. MCP2140 250 Byte Data Transmit Table.
12. Repeating steps 10 and 11 will cause the PC to transmit another data byte and
to receive another data string.
13. Disconnect (close) the HyperTerminal session. The DSR and CTS LEDs will
immediately turn off and the PHACT LED will turn on in about 10 seconds.
Note: Hyperterminal® should be disabled before establishing a connection
between the PC and the MCP2140 IrDA Standard Wireless Temperature
Sensor Demo Board. Make sure that any other programs (e.g., HotSync®)
connected to the IR ports are disabled.
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 18 2004 Microchip Technology Inc.
2.4.3.2.2 Operating the “Transmit Temperature” Program
1. Ensure 3 AAA batteries are properly inserted into the battery holder.
2. Connect JP1 (closed position). The power LED (D5) will turn on. After a few
seconds, the PHACT LED (D4) will also turn on, indicating that the MCP2140 is
in the NDM (Non-Discovery Mode) state.
3. Depress the RESET and S2 buttons, then release the RESET button (keep the
S2 button depressed).
4. Release the S2 button.
5. With both devices on a flat surface, place the MCP2140 IrDA S tandard Wireless
Temperature Sensor Demo Board about 25 cm (10”) away from the PC (dark red
window at the front or sides of the PC) toward the two clear LEDs (D1, D6) on
the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board.
6. If the PC is configured to show the IR icon in the system tray, a single IR LED
icon will be displayed. Placing the mouse cursor over this icon will display the
message “MCP2140 A5 is in range”, where “MCP2140 A5” is the Device ID of
the MCP2140.
7. Start the HyperTerminal program by using the saved setting from Section
2.4.3.1 “Configuring HyperTerminal”. When HyperTerminal starts, it is in the
connected state. To disconnect, click on the telephone icon (4th icon from left on
toolbar). To connect, click on the telephone icon (3rd icon from left). Depending
on the current state of the HyperTerminal session, only one of the two telephone
icons will be active (the other will be grayed out).
8. Ensure that the HyperTerminal session indicates “Connected” (lower-left in
HyperTerminal window) and that the icon in the system tray changes to two IR
LEDs facing each other and “talking”.
9. Place the mouse cursor over the IR icon in the system tray. The message
displayed now says “Wireless link with MCP2140 A5 at 9600 bps”. This shows
that a link is now established for data communication, and that the IR
communication rate is 9600 bps (even though the HyperTerminal program is
“talking” to the driver at 115200, the IrDA standard hardware is communicating
at the rate negotiated with the MCP2140).
10. Type any number (0-9) in the HyperTerminal window. The MCP2140 IrDA Stan-
dard Wireless Temperature Sensor Demo Board requires a receive byte before
transmitting it’s data. This is due to the requirement of most PDAs needing to
transmit a data byte before opening the IR Link. The data byte is sent as it is
typed. At this time, the DSR (D2), CTS (D3) and PHACT (D4) LEDs are turned
off.
11. The PC HyperTerminal window should receive a string of data about every
second. This data string has the format “Temp = xx”, where xx is the measured
temperature in °C.
12. Device U4 is the TC1047A Temperature Sensor device. The output is connected
to an A/D channel of the PIC18F1320. Changing the temperature of this device
will effect the ”temperature” value that is transmitted to the Primary device.
13. Disconnect (close) the HyperTerminal session. The DSR and CTS LEDs will
immediately turn off and the PHACT LED will turn on in about 10 seconds.
Note: Temperature value transmitted by the PIC18F1320 will be dependent on
battery voltage (see Section 2.3.2.2 ““Transmit Temperature” Program
Description”).
2004 Microchip Technology Inc. DS51487A-page 19
2.5 MCP2140 IrDA STANDARD WIRELESS TEMPERATURE SENSOR DEMO
BOARD DESCRIPTION
The MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board is designed
to demonstrate and evaluate an IR port implementation using the MCP2140 device.
The following sections describe each element of this demo board in further detail.
2.5.1 Power
The MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board is powered
by three AAA batteries, generating a nominal voltage of 4.5V. Jumper JP1 is the power
switch on the board. LED D5 is the power indicator, turning on when power is applied
via JP1.
2.5.2 MCP2140 IrDA Protocol Stack Con troller Device
This demo board highlights the MCP2140 IrDA Protocol Stack Controller device (U2)
to demonstrate the implementation of an IR port in an embedded system application.
The MCP2140 device handles all IrDA standard protocol tasks, while allowing the
system designer to easily interface the device to a microcontroller via a standard UART
port.
The key signals for the MCP2140-to-microcontroller interface are shown in Table 2-1.
Further information on the Host Controller interface may be obtained from the
MCP2140 data sheet (DS21790).
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 20 2004 Microchip Technology Inc.
TABLE 2-1: MCP2140 HOST UART INTERFACE PINS
Pin Name Pin
Number
(SSOP)
Pin
Type Buffer
Type Description
TX 8 I TTL Asyn ch rono us rec ei ve; from Ho st C o ntro lle r UA R T
RX 9 O Asynchronous transmit; to Host Controller UART
RI 10 I TTL Ring Indicator. The state of this bit is
communicated to the IrDA® standard Primary
device.
1 = No Ring Indicate Present
0 = Ring Indicate Present
DSR 11 O Data Set Ready. Indicates that the MCP2140 has
established a valid infrared link with a Primary
device. This signal is locally emulated and not
related to th e DTR bit of the IrDA st and ard Primar y
device. (Note 1)
1 = An IR link has not been established
(No IR Link)
0 = An IR link has been established (IR Link)
DTR 12 I TTL D at a Termin al Ready. Indicates th at the e mbed ded
device connected to the MCP2140 is ready for IR
data. The state of this bit is communicated to the
IrDA Prima ry device , via the IrDA st andard DSR bit
carried by IrCO MM .
1 = Embedded device not ready
0 = Embedded device ready
CTS 13 O Clear to Send. Indicates that the MCP2140 is
ready to receive dat a form the Hos t Controller. This
signal is locally emulated and not related to the
CTS/RTS bit of the IrDA standard Primary device.
1 = Host Controller should not send data
0 = Host Controller m ay send data
RTS 14 I TTL Request to Send. Indic ates that a Host Controll er is
ready to receive data from the MCP2140. This
signal is locally emulated and not related to the
CTS/RTS bit of the IrDA standard Primary device.
1 = Host Controller not ready to receive data
0 = Host Controller ready to receive data
CD 19 I ST Carrier Detect. The state of this bit is
commu nicated to th e IrDA stan dard Primary de vice
via the IrDA standard CD bit.
1 = No Carrier Present
0 = Carrier Present
Legend: TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels
I = Input O = Output
Note 1: The state of the DTR output pin does not reflect the state of the DTR bit of the IrDA
standard Primary device.
2004 Microchip Technology Inc. DS51487A-page 21
The key signals for the MCP2140-to-IR transceiver circuit are shown in Table 2-2.
Further information on the IR transceiver interface may be obtained from the MCP2140
data sheet (DS21790).
TABLE 2-2: MCP2140 IR INTERFACE PINS
In addition to the signals described in T ables 2-1 and 2-2, the PHACT (Protocol Handler
Active) output signal indicates which mode the MCP2140 IrDA standard protocol
controller state machine is in (0 = NDM or Low-power mode,1 = Discovery or NRM)
and is connected to the PHACT LED (D4); the RESET input is connected to the RESET
output of the Host Controller (I/O pin RA4), which asserts low after the RESET
push-button switch is asserted; the RI (Ring Indicator) input is pulled to ground; and the
OSC1 and OSC2 pins are connected to an external 7.3728 MHz oscillator, as specified
in the MCP2140 data sheet (allowing the device to transmit at 9600 baud).
2.5.2.1 MCP2140 OPERATION
The MCP2140 (U3) implements the 9-wire “cooked” service class in the IrCOMM
application layer protocol of the IrDA standard specification. IrCOMM is the IrDA
standard specification for the replacement of the communication ports (serial and
parallel) of a PC. The MCP2140 allows the replacement of the serial cable with a wire-
less interface. The MCP2140 implements the entire protocol layer, and the Host
Controller (PIC18F1320) “talks” to the MCP2140 as if it were a serial port with flow
control.
The MCP2140 operates as a Secondary device only, so it will not initiate IrDA standard
communication with other IrDA standard devices (neither a Secondary device nor a
Primary device).
Appendix C. “MCP2140 Connection Sequence Overview” shows the connection
sequence between a Primary device and the MCP2140 (Secondary device). This
connection sequence is shown at an overview level and does not show exact
operation.
Pin Name Pin
Number
(SSOP)
Pin
Type Buffer
Type Description
RXPDREF 1 I A IR Receiv e Photo Detect Diode reference voltage.
This voltage will typically be in the range of V DD/2.
TXIR 2 O Asynchronous transmit to IrDA® standard
transceiver.
RXPD 20 I A IR RX Phot o Dete ct D i ode inp ut. This in put signal is
required to be a pulse to indicate an IR bit. When
the amplitude of the signal crosses the amplitude
threshold set by the RXPDREF pin, the IR bit is
detected. The pulse has minimum and maximum
requirements as specified in the MCP2140 data
sheet, Electrical Characteristics table,
Parameter IR131A.
Legend: A = Analog P = Power
I = Input O = Output
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 22 2004 Microchip Technology Inc.
2.5.3 PICmicro® Microcontroller Functions
The MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board interfaces to
the PIC18F1320 microcontroller (U1). This device was chosen for this application
because it has a UART port, an A/D Converter (ADC) for the temperature sensor
analog output, Flash memory for reprogrammability, a small footprint (package) and is
low-power.
The PIC18F1320 interfaces to the MCP2140 as described in Section 2.5.2 MCP2140
IrDA Protocol St ack Controller Device”.
The TC1047A temperature sensor indicates the temperature by outputting an analog
signal whose magnitude corresponds to the temperature of the device. This signal is
input on analog channel AN0 (pin 1).
The MCLR input of the PIC18F1320 is connected to the RESET push button switch.
The device is reset when the RESET push button is depressed.
I/O pin RB0 is connected to the S2 push button switch. The state of the switch is polled
immediately after the device is reset (via the RESET push button), allowing the
microcontroller to determine which firmware program (“Data String Transmit” or
“Temperature Transmit)” to execute.
The PIC18F1320 is connected to a standard In-Circuit Serial Programming™ (ICSP™)
header (J1) to allow easy program access to the device.
2.5.4 IR Transceiver Circuit
The IR transceiver circuit utilizes an integrated optical transceiver. The circuit allows
any one of three devices to be used. These are:
1. Vishay® TFDU 4100 (default device)
2. Vishay TFDU 4300
3. Agilent® HSDL 3000
If you wish to test with either of the other optical transceivers, the TFDU 4100 and
associated components need to be removed and the components for the desired
optical transceiver need to be installed (see the Appendix B. “Bill-Of-Materials
(BOM)”).
Figure 2-12 shows the circuit that is used to shape the waveform of the optical Trans-
ceiver’s RXD output. This is done to ensure that the RXD pulse width does not exceed
the specifications of the MCP2140 RXPD input (IR131A) (refer to Parameter IR131A
in the MCP2140 data sheet, DS21790). The resistor divider R18 and R13 sets the
RXPDREF reference threshold. T ransistor Q8 (MMUN211 1LT1) has internal resistors.
If you wish to evaluate a simple PNP device, Q8 can be replaced and resistors for R15
and R20 may need to be added. If R20 is added, do not forget to cut the trace that
shorts-out the resistor.
FIGURE 2-12: MCP2140 RXPD WAVEFORM SHAPING CIRCUIT
VDD
RXD
(From Optical
Transceiver)
3
1
2
TP1
TP2
RXPDREF
RXPDREF
RXPD RXPD
R13
10 k
R16
4.7 k
Q6
R18
10 k
VDD R7
100
R15
OPT
R20
OPT
C9
47 pF
2004 Microchip Technology Inc. DS51487A-page 23
2.5.5 Signal Header
To allow easy access to many of the system signals, a header (J2) was placed on one
of the edges of the board. This allows the signals from the MCP2140, PIC18F1320 and
other system signals to be accessed.
The header (J2) RESET signal is the RESET pin of the MCP2140 and not the signal
from the RESET switch.
If desired, the PIC18F1320 could be electrically removed, and the remaining MCP2140
circuitry could be interfaced to another system board for quick system validation. The
PIC18F1320 can be electrically removed by either:
1. Physically removing the device.
2. Erasing the PIC18F1320’s program memory (after device reset, all pins are
inputs).
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 24 2004 Microchip Technology Inc.
NOTES:
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 25
Appendix A. Schematic and Layouts
A.1 INTRODUCTION
This appendix contains the following schematics and layouts for the MCP2140 IrDA
Standard Wireless Temperature Sensor Demo Board:
Board Schematic - Digital circuitry
Board Schematic - Analog circuitry
Board - Top Layer
Board - Bottom Layer
Board - Ground Layer
Board - Power Layer
A.2 SCHEMATICS AND PCB LAYOUT
Figure A-2 shows the schematic of the digital circuitry, while Figure A-3 shows the
analog circuitry for the MCP2140 receiver circuitry and transmitter circuitry.
Figure A-4 through Figure A-7 show the layout for the four different layers of the
MCP2140 IrDA S t andard Wireless Temperature Sensor Demo Board. The layer order
is shown in Figure A-1.
FIGURE A-1: LAYER ORDER
A.2.1 Electronic Change Notice (ECN)
There are 3 ECNs to the Re v. 1 version of the board. Two relate to the use of altern ate
optical transceivers and are discussed in Appendix E. “Alternate Optical T ransceiver
Implementation”. The third relates to the pinout o f transistor Q6 (M MUN2111LT1). An
incorrect pinout was specified, so the device needs to be rotated 1 pin in the clockwise
direction. Figure A-8 shows how this change will appear.
Top Layer
Ground Layer
Power Layer
Bottom Layer
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 26 2004 Microchip Technology Inc.
FIGURE A-2: MCP214 0 IrDA® STANDARD WIRELESS TEMPERATURE SENSOR DEMO
BOARD SCHEMATIC - PAGE 1
M
3
1
2
3
1
2
13 CTS
10 RI
8TX
3
PHACT
17
OSC2/CLK0
15
VDD
5VSS
9RX
14 RTS
11 DSR
12 DTR
16
VDD
18
OSC1/CLKI
1
RXPDREF 2
TXIR
4
RESET
6VSS 7
NC
3
1
2
2004 Microchip Technology Inc. DS51487A-page 27
FIGURE A-3: MCP21 40 IrDA® STANDARD WIRELESS TEMPERATURE SENSOR DEMO
BOARD SCHEMATIC - PAGE 2
M
3
1
2
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 28 2004 Microchip Technology Inc.
FIGURE A-4: MCP214 0 IrDA® STANDARD WIRELESS TEMPERATURE SENSOR DEMO
BOARD LAYOUT - T OP LAYER
2004 Microchip Technology Inc. DS51487A-page 29
FIGURE A-5: MCP21 40 IrDA® STANDARD WIRELESS TEMPERATURE SENSOR DEMO
BOARD LAYOUT - BOTTOM LAYER
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 30 2004 Microchip Technology Inc.
FIGURE A-6: MCP214 0 IrDA® STANDARD WIRELESS TEMPERATURE SENSOR DEMO
BOARD LAYOUT - GROUND LAYER
2004 Microchip Technology Inc. DS51487A-page 31
FIGURE A-7: MCP21 40 IrDA® STANDARD WIRELESS TEMPERATURE SENSOR DEMO
BOARD LAYOUT - POWER LAYER
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 32 2004 Microchip Technology Inc.
A.3 ECNS
This section discusses the ECNs for this board. There are three (3) ECNs associated
with this board. Two are related to the alternate transceiver circuits and are discussed
in Appendix E. “Alternate Optical Transceiver Implementation”.
The last ECN relates to all transceiver circuits. Transistor Q6 was laid out with the
wrong pinout. To correct for this, transistor Q6 needs to be rotated clockwise by 1 pin.
Figure A-8 shows how to connect transistor Q6 on the PCB.
FIGURE A-8: TRANSISTOR Q6 ECN
R13 U6
R18
TP1
R16
R20
TP2
Q6
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 33
Appendix B. Bill-Of-Materials (BOM)
TABLE B-1: BILL OF MATERIALS
Qty Reference Description Mfgr. Part Number
5 C1 , C2, C3, C4,
C11 Capacitor, 0.1 µF, 25V, Ceramic, X7R 0603 Kemet®C0603C104K3RACTU
4 C5, C6, C13,
C14 Capacitor, Ceramic, 22 pF, 50V, NP0 0603 Yageo America CAP CERAMIC 22PF
50V NP0 0603
1 C9 Capacitor, Ceramic, 33 pF, 50V, NP0 0603 Yageo America 0603CG330J9B200
2 R16 Resistor, 4.75 k, 1/16w, 1%, 0603 SMD Panasonic®ERJ-3EKF4751V
3 R1,R8,R13,R18,
R22 Resistor, 10.0 k, 1/16w, 1%, 0603 SMD Panasonic ERJ-3EKF1002V
3 R21,R23,R24 Resistor, 20.0 k, 1/16w, 1%, 0603 SMD Panasonic ERJ-3EKF2002V
2 R5,R7 Resistor, 100, 1/16w, 1%, 0603 SMD Panasonic ERJ-3EKF1000V
4 R4,R19 Resistor, 100 k, 1/16w, 1%, 0603 SMD Panasonic ERJ-3EKF1003V
4 R2,R3,R6,R11 Resistor, 475, 1/16w, 1%, 0603 SMD Panasonic ERJ-3EKF4750V
2 R25 (Optional - Not Populated) Not Used NOT USED
4 D2, D3, D4, D5 Led, Red, Clear, 0805 SMD Lite-on LTST-C170CKT
3 Q3,Q4,Q5 Transistor, GP, PNP, AMP, SOT-23 Fairchild®
Semiconductor MMBT3906
1 Q6 RF, Bipolar Transistor, 50V Collector- Emit-
ter Voltage, 5.0 mA Current Rating ON Semi®MMUN2111LT1
1 U1 PIC18F1320 Microcontroller Microchip
Technology Inc. PIC18F1320-I/SS
1 U3 MCP214 0, Infra red C om munic ati ons
Controller Microchip
Technology Inc. MCP2140
1 U4 TC1047A, Linear Voltage Output
Temperature Sensor Microchip
Technology Inc. TC1047AVNB
2 Y1,Y2 Crystal, 7.3728 MHZ, 20 pF, SMD Esc Inc. ECS-73-20-5PDN
2 S2, Reset Switch, Tact, 6MM, MOM, 100 GF Omron®B3F-1000
1 BAT1 Holder, Battery, 3-Cell, AAA, pc mount Keystone
Electronics®2479
1 JP1 Conn, Header, 2-Pos .100 Vert Tin Moldex/Waldom 22-28-4020
1 J1 Conn, Mod Jack ,6-6 R/A PCB 50AU AMP/Tyco
Electronics A9049-ND
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 34 2004 Microchip Technology Inc.
Default Optical Transceiver - TFDU 4100
1 U2 TFDU4100-TR3, Infrared Transceiver,
900 nM, wavelength, 3 Vishay®TFDU4100-TR3
1 R10 Resistor, 47.5, 1/10w, 1%, 0805 SMD Panasonic®ERJ-6ENF47R5V
1 R26 Resistor, 14.0, 1/10w, 1%, 0805 SMD Panasonic ERJ-6ENF14R0V
1 C17 Cap ac ito r, Tantalu m, 4 .7 µF, 16V, 10% SMD Kemet®T491B475K016AS
1 C18 Capacitor, 0.1 µF, 25V, Ceramic, X7R 0603 Kemet C0603C104K3RACTU
Alternate Optical Transceiver 1 - TFDU 4300
1 U5 TFDU4300 Vishay TFDU4300
1 R14 Resistor, 47.5, 1/10w, 1%, 0805 SMD Panasonic ERJ-6ENF47R5V
1 R28 Optional Current limiting Resistor 1/16w,
1%, 0603 S MD Panasonic Application dependant
2 C7, C12 Capacitor, 0.1 µF, 25V, Ceramic, X7R 0603 Kemet C0603C104K3RACTU
2 C15, C16 Capacitor, Tantalum, 4.7 µF, 16V, 10%
SMD Kemet T491B475K016AS
Alternate Optical Transceiver 2 - HSDL 3000
1 U6 HSDL-3000#007 Agilent®
Technologies HSDL-3000#007
1 R27 Resistor, 6.80, 1/8w, 1%, 0805 SMD Yageo America 9C08052A6R80FGHFT
1 C19 Capacitor, Ceramic, .47 µF, 10V, X5R 0603 Kemet C0603C474K8PACTU
1 C20 Capacitor, 6.8 µF, 16V, Tantalum TE Smd Panasonic ECS-T1CY685R
TABLE B-1: BILL OF MATERIALS (CONTINUED)
Qty Reference Description Mfgr . Part Number
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 35
Appendix C. MCP2140 Connection Sequence Overview
FIGURE C-1: HIGH-LEVEL MCP2140 CONNECTION SEQUENCE
Normal Disconnect Mode (NDM)
Send XID Commands
(time slots n, n+1, ...)
No Response
XID Response in time slot y,
Finish sending XIDs
(max time slots - y frames)
Broadcast ID No Response to these XIDs
claiming this time slot, (MCP214X
No Response to Broadcast ID
Primary Device MCP2140
Discovery
Normal Response Mode (NRM)
Send SNRM Command
(w/ parameters and
connection address)
Open channel for IAS Queries
Send IAS Queries
Open channel for data
Send Data or Status
Shutdown link
UA response with parameters
using connect address
Confirm channel open for IAS
Provide IAS responses
Confirm channel open for data
Send Data or Status
Confirm shutdown
(back to NDM state)
(approximately 70 ms
between XID commands)
Send Data or Status
Send Data or Status
(MCP2140 DS R pin driven low)
(Secondary Device)
always claims time slot 0)
No IR Activ i ty
(for 10 seconds) PHACT pin driven low
PHACT pin driven high
No IR Activ i ty
(for 10 seconds) PHACT pin driven low
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 36 2004 Microchip Technology Inc.
NOTES:
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 37
Appendix D. MCP2140 250 Byte Data Transmit Table
TABLE D-1: PIC18F1320 250 BYTE DATA TRANSMIT TABLE
TXTBL DT D’250’ ; the first byte is the byte count
; 1 Characters
DT “12345678”, 0x0D, 0x0A ; 10 Characters
DT “2BCDEFGH”, 0x0D, 0x0A ; 10 Characters
DT “32345678”, 0x0D, 0x0A ; 10 Characters
DT “4bcdefgh”, 0x0D, 0x0A ; 10 Characters
DT “52345678”, 0x0D, 0x0A ; 10 Characters
DT “6BCDEFGH”, 0x0D, 0x0A ; 10 Characters
DT “72345678”, 0x0D, 0x0A ; 10 Characters
DT “8bcdefgh”, 0x0D, 0x0A ; 10 Characters
DT “92345678”, 0x0D, 0x0A ; 10 Characters
DT “ABCDEFGH”, 0x0D, 0x0A ; 10 Characters
DT “B2345678”, 0x0D, 0x0A ; 10 Characters
DT “Cbcdefgh”, 0x0D, 0x0A ; 10 Characters
DT “D2345678”, 0x0D, 0x0A ; 10 Characters
DT “EBCDEFGH”, 0x0D, 0x0A ; 10 Characters
DT “F2345678”, 0x0D, 0x0A ; 10 Characters
DT “1bcdefgh”, 0x0D, 0x0A ; 10 Characters
DT “22345678”, 0x0D, 0x0A ; 10 Characters
DT “3BCDEFGH”, 0x0D, 0x0A ; 10 Characters
DT “42345678”, 0x0D, 0x0A ; 10 Characters
DT “5bcdefgh”, 0x0D, 0x0A ; 10 Characters
DT “62345678”, 0x0D, 0x0A ; 10 Characters
DT “7BCDEFGH”, 0x0D, 0x0A ; 10 Characters
DT “82345678”, 0x0D, 0x0A ; 10 Characters
DT “9bcdefgh”, 0x0D, 0x0A ; 10 Characters
DT “a2345678”, 0x0D, 0x0A ; 10 Characters
;
; NOTE: 0x0D = Carriage Return, 0x0A = Line Feed
;
MCP2140 250 Byte Data Transmit Table
2004 Microchip Technology Inc. DS51487A-page 38
NOTES:
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 39
Appendix E. Alternate Optical Transceiver Implementation
E.1 INTRODUCTION
This appendix contains the description for implementing either of the other two optical
transceiver implementations.
E.2 HIGHLIGHTS
Diagrams inclu ded in thi s appe ndi x:
Vishay TFDU 4300 implementation
Agilent HSDL 3000 implementation
Note 1: When performing either of these alternate optical transceiver
implementations, please make sure to remove all of the components that
are related to the TFDU 4100 implementation.
2: Some component value modifications may be required to ensure that the
IR131A electrical specification is met. This may require different values
for the following components R13, R18, R16, R17, C9 and Q6 (which
may then require R15 and R20).
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 40 2004 Microchip Technology Inc.
E.3 VISHAY® TFDU 4300 IMPLEMENTATION
Figure E-1 shows the schematic for the TFDU 4300 circuit and the ECN change that
needs to be implemented. Figure E-2 shows how to make this correction on the layout.
FIGURE E-1: TFDU 4300 OPTICAL TRANSC EIVER ECN - SCHEMATIC
FIGURE E-2: TFDU 4300 OPTICAL TRANSC EIVER ECN - LAYOUT
VDD
ECN
ECN Blue wire
Resistor R14 to C16 and C12
connection to VDD (via below
R10)
2004 Microchip Technology Inc. DS51487A-page 41
E.4 AGILENT® HSDL 3000 IMPLEMENTATION
Figure E-3 shows the correction to the schematic for the HSDL 3000 to be
implemented. Figure E-4 shows how to make this correction on the layout.
FIGURE E-3: HSDL 3000 OPTICAL TRANSCEIVER ECN - SCHEMATIC
FIGURE E-4: HSDL 3000 OPTICAL TRANSCEIVER ECN - LAYOUT
VDD
ECN
ECN Blue wire
HSDL 3000 Pin 5 at C20
connection to VDD (via at
top of R18)
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 42 2004 Microchip Technology Inc.
NOTES:
MCP2140 IrDA® STANDARD
WIRELESS TEMPERATURE SENSOR
DEMO BOARD USERS GUIDE
2004 Microchip Technology Inc. DS51487A-page 43
Appendix F. Using AN888 Program with a Palm™ PDA
F.1 INTRODUCTION
Microchip also has some example Primary device programs that could be used to
demonstrate the MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board.
These programs were not developed for this demo board and may not be straight-for-
ward to display all modes of operation (such as the “T ransmit Temperature” program).
These programs are discussed in the following application notes:
For Palm OS - Application Note 888, “Programming the Palm OS® for Embedded
IR Applications” (DS00888)
For Pocket PC OS - Application Note 926, “Programming the Pocket PC OS for
Embedded IR Applications” (DS00926)
For Windows XP - Application Note 941, “Prog rammi ng Windows ® XP for
Embedded IR Applications” (DS00941)
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 44 2004 Microchip Technology Inc.
F.1.1 Using the AN888 Program with a Palm PDA
It is recommended that you read Application Note 888 to better understand the
operation of the program.
After installing the .PRC file on your PDA, launch the program (MCP215xDemo) and
you will see the screen in Figure F-1.
FIGURE F-1: MCP215XDEMO MAIN FORM
The following procedure describes how to operate the “Transmit 250 Byte Data S tring“
program on the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board.
2004 Microchip Technology Inc. DS51487A-page 45
F.1.1.1 OPERATING THE “TRANSMIT 250 BYTE DATA STRING” PROGRAM
1. Ensure 3 AAA batteries are properly inserted into the battery holder.
2. Connect JP1 and JP2 (closed position). The power LED (D5) will turn on. After a
few seconds, the PHACT LED (D4) will also turn on, indicating that the MCP2140
is in the Non-Discovery Mode (NDM) state.
3. Depress and release the RESET button.
4. Turn on the Palm (or equivalent) PDA.
5. With both devices on a flat surface, place the Palm PDA about 25 cm (10”) away
from the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board,
pointing the IR port of the Palm PDA (dark red window at the top of the PDA)
toward the two clear LEDs (D1, D6) on the MCP2140 IrDA Standard Wireless
Temperature Sensor Demo Board.
6. Open the MCP215 xDe mo progr am on the Palm PDA.
7. Tap the Connect button.
8. Tap the 123 button.
9. Tap any number (0-9). This is the command that will be received by the
MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board, instructing
the program to send a data string back to the Palm PDA. At this time, the DSR
(D2), CTS (D3) and PHACT (D4) LEDs are turned off.
10. Tap on the DONE button. The number selected in step 9 will be displayed on the
line “TX Data (ASCII) = x” (where x is the number). Notice that the line that shows
“Trace:” indicates 0 byte s.
11. To transmit this data byte, tap on the Send button. Notice that the value in the
trace buffer increases up to 250 bytes.
The DSR LED will turn on, the CTS LED will strobe until all the data has been
transmitted and the PHACT LED will turn off.
12. To see the received data, tap on the Show button. This shows the contents of the
trace buffer. The trace buffer window should display a string of data as shown in
Figure F-2.
FIGURE F-2: MCP215XDEMO TRACE BUFFER WINDOW AFTER
RECEIVING 250 BYTE DATA STRING
13. To close the trace buffer, tap the OK button.
14. Repeating steps 8 through 11 will cause the Palm PDA to transmit another data
string of 250 byte. Notice that the trace buffer counter increments by 250 each
time.
15. To clear the trace buffer, tap on the Clear button
16. To disconnect the IR link, tap the Disconnect button. The DSR and CTS LEDs
will immediately turn off and the PHACT LED will turn on in about 10 seconds.
32345678
4bcdefgh
52345678
6BEDEFGH
72345678
8bcdefgh
92345678
ABCDEFGH
B2345678
Cbcdefgh
D2345678
EBCDEFGH
F2345678
1bcdefgh
22345678
MCP2140 IrD A® Standard Wir eless Temp Sensor Demo Board
DS51487A-page 46 2004 Microchip Technology Inc.
F.1.1.2 OP ERATING THE “TRANSMIT TEMPERATURE” PROGRAM.
1. Ensure 3 AAA batteries are properly inserted into the battery holder.
2. Connect JP1 and JP2 (closed position). The power LED (D5) will turn on. After a
few seconds, the PHACT LED (D4) will also turn on, indicating that the MCP2140
is in the Non-Discovery Mode (NDM) state.
3. Depress the RESET and S2 buttons, then release the RESET button (keep the
S2 button depressed).
4. Release the S2 button.
5. Turn on the Palm (or equivalent) PDA.
6. With both devices on a flat surface, place the Palm PDA about 25 cm (10”) away
from the MCP2140 IrDA Standard Wireless Temperature Sensor Demo Board,
pointing the IR port of the Palm PDA (dark red window at the top of the PDA)
toward the two clear LEDs (D1, D6) on the MCP2140 IrDA Standard Wireless
Temperature Sensor Demo Board.
7. Open the MCP215 xDe mo progr am on the Palm PDA.
8. Tap the Connect button.
9. Tap the 123 button.
10. Tap any number (0-9). This is the “command” that will be received by the
MCP2140 IrDA S tandard Wireless Temperature Sensor Demo Board, instructing
the program to send a data string back to the Palm PDA. At this time, the DSR
(D2), CTS (D3) and PHACT (D4) LEDs are turned off.
11. Tap on t he DONE button. The number selected in step 9 will be displayed on the
line “TX Data (ASCII) = “x” (where x is the number). Notice that the line that
shows “Trace:” indicates 0 bytes.
12. To transmit this data byte, tap on the Send button. Notice that the value in the
trace buffer increases by 11 bytes approximately once every second.
The DSR LED will turn on and the CTS LED will strobe until all the data has been
transmitted, and the PHACT LED will turn off.
13. To see the received data, tap on the Show button. This shows the contents of the
trace buffer . The trace buffer window should display a string of data as shown in
Figure F-3.
FIGURE F-3: MCP215XDEMO TRACE BUFFER WINDOW AFTER RECEIVING
250 BYTE DAT A STRING
14. To close the trace buffer, tap the OK button.
15. To clear the Trace Buffer, tap on the Clear button
16. To disconnect the IR link, tap the Disconnect button. The DSR and CTS LEDs
will immediately turn off and the PHACT LED will turn on in about 10 seconds.
Temp = 24
Temp = 24
Temp = 25
Temp = 24
Note: Temperature value transmitted by the MCP2140 will be dependent on
battery voltage (see Section 2.3.2.2 ““Transmit Temperature” Program
Description”).
2004 Microchip Technology Inc. DS51487A-page 47
NOTES:
DS51487A-page 48 2004 Microchip Technology Inc.
AMERICAS
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
480-792-7627
Web Address:
www.microchip.com
Atlanta
Alpharetta, GA
Tel: 770-640-0034
Fax: 770-640-0307
Boston
Westford, MA
Tel: 978-692-3848
Fax: 978-692-3821
Chicago
Itasc a , IL
Tel: 630-285-0071
Fax: 630-285-0075
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los A n ge les
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
San Jose
Mountain View, CA
Tel: 650-215-1444
Fax: 650-961-0286
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
ASIA/PACIFIC
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8676-6200
Fax: 86-28-8676-6599
China - Fuzhou
Tel: 86-591-750-3506
Fax: 86-591-750-3521
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
China - Shanghai
Tel: 86-21-6275-5700
Fax: 86-21-6275-5060
China - Shenzhen
Tel: 86-755-8290-1380
Fax: 86-755-8295-1393
China - Shunde
Tel: 86-757-2839-5507
Fax: 86-757-2839-5571
China - Qingdao
Tel: 86-532-502-7355
Fax: 86-532-502-7205
ASIA/PACIFIC
India - Bangalore
Tel: 91-80-2229-0061
Fax: 91-80-2229-0062
India - New Delhi
Tel: 91-11-5160-8632
Fax: 91-11- 5160-8632
Japan - Kanagawa
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Taiwan - Kaohsiung
Tel: 886-7-536-4816
Fax: 886-7-536-4817
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
Taiwan - Hsinchu
Tel: 886-3-572-9526
Fax: 886-3-572-6459
EUROPE
Austria - Weis
Tel: 43-7242-2244-399
Fax: 43-7242-2244-393
Denmark - Ballerup
Tel: 45-4420-9895
Fax: 45-4420-9910
France - Massy
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Germany - Ismaning
Tel: 49-89-627-144-0
Fax: 49-89-627-14 4-44
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
England - Berkshire
Tel: 44-118-921-5869
Fax: 44-118-921-5820
WORLDWIDE SALES AND SERVICE
08/24/04
Mouser Electronics
Authorized Distributor
Click to View Pricing, Inventory, Delivery & Lifecycle Information:
Microchip:
MCP2140DM-TMPSNS