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, microID, MPLAB, PIC, PICmicr o, PICST A RT,
PRO MATE, PowerSmart, rfPIC, and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB,
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, fuzzy LAB,
In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active
Thermistor, Mindi, MiWi, MPASM, MPLIB, MPLINK, PICkit,
PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal,
PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB,
rfPICDEM, Select Mode, Smart Serial, SmartTel, Total
Endurance, UNI/O, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated 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.
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.
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.
INTRODUCTION
®
IDE on-line help.
This chapter contains general information that will be useful to know before using the
MCP9800 Temperature Data Logger Demo Board 2. Items discussed in this chapter
include:
• Document Layout
• Conventions Used in this Guide
• Recommended Reading
• The Microchip Web Site
• Customer Support
• Document Revision History
DOCUMENT LAYOUT
This document describes how to use the MCP9800 Temperature Data Logger Demo
Board 2. The manual layout is as follows:
• Chapter 1. “Product Overview” – Important information about the MCP9800
Temperature Data Logger Demo Board 2.
• Chapter 2. “Installation and Operation” – Demonstrates what programs need
to be installed and how to program the microcontroller on the PCB, as well as
reading the data out and displaying the data in an Excel
• Appendix A. – “Schematic and Bill of Materials (BOM)”
The following Microchip documents are available and recommended as supplemental
reference resources.
MCP9800 Data Sheet, “2-Wire High-Accuracy Temperature Sensor” (DS21909)
24LC16B Data Sheet, “16K I
PIC10F202 Data Sheet, “PIC10F200/202/204/206 Data Sheet” (DS41239)
MCP100/101 Data Sheet, “Microcontroller Supervisory Circuit with Push-Pull
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 listing
• Business of Microchip – Product selector and ordering guides, latest Microchip
press releases, listing of seminars and events, list ings of Microchip sales offices,
distributors and factory representatives
MCP9800 Temperature Data Logger Demo Board 2 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
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
This chapter contains an overview of the MCP9800 Temperature Data Logger Demo
Board 2 and covers the following topics:
• What is the MCP9800 Temperature Data Logger Demo Board 2?
• What does the MCP9800 Temperature Data Logger Demo Board 2 include?
1.2WHAT IS THE MCP9800 TEMPERATURE DATA LOGGER DEMO BOARD 2?
The MCP9800 Temperature Data Logger Demo Board 2 is a PCB assembly that uses
a PIC10F202 to read temperature data using I
MCP9800 temperature sensor, and stores that data, also using I
a 24LC16B Serial EEPROM. The board can then be placed into a SEEVAL
EEPROM Evaluation tool and the content can be read and stored into a .hex file. We
have also provided an Excel spreadsheet that can be used to import the .hex file so
that the data may be graphed on your computer screen.
2
C™ communication from a Microchip
2
C communication, to
®
32 Serial
1.3WHAT DOES THE MCP9800 TEMPERATURE DATA LOGGER DEMO BOARD
2 KIT INCLUDE?
This MCP9800 Temperature Data Logger Demo Board 2 Kit includes:
• Two MCP9800 Temperature Data Logger Demo Boards.
On the data CD provided:
• MCP9800 Temperature Data Logger Demo Board 2 User’s Guide (DS22027)
The MCP9800 Temperature Data Logger Demo Board 2, once programmed, will log
temperature measurements for a predetermined amount of time until the 24LC16B is
fully programmed with temperature data (i.e., 2,048 temperature readings). Each sample uses one byte of memory. The intervals can be changed in the firmware we have
provided by changing the TIMEOUTVAL variable. The firmware will take measurements
for approximately 45 minutes (approx. 1 sample/sec).
2.2FEATURES
The MCP9800 Temperature Data Logger Demo Board 2 has the following features:
• Small PCB layout. Can be placed virtually anywhere you need to measure
temperature.
• Standard ICSP™ pinout so the firmware can be modified using a PICkit™ 2 programmer or any of Microchip’s programming tools using the ICSP programming
adapter.
• Standard Two-Wire 8-pin pinout (inverted) for easy reading of the 24LC16B into
the SEEVAL
MCP9800 TEMPERATURE DATA LOGGER
DEMO BOARD 2 USER’S GUIDE
®
32 evaluation tool software.
2.3GETTING STARTED
This section describes how to get your MCP9800 Temperature Data Logger Demo
Board 2 programmed and ready to take temperature readings. The boards have been
pre-programmed at the factory with the default settings, so it is not necessary to
program them unless the firmware has been modified. It will also show how to read the
logged data from the board into the SEEVAL
show how to export that data from the SEEVAL 32 evaluation tool software and also
how to import and display the data on an Excel spreadsheet.
MCP9800 Temperature Data Logger Demo Board 2 User’s Guide
FIGURE 1-1:MCP9800 Temperature Data Logger Demo Board 2 Functional
Block Diagram
Status LED
(D2)
MCP101
Voltage Supervisor
(U5)
PIC10F202
(U3)
PICkit™ 2
Programmer
Header (J1)
MCP9800
Temp. Sensor
(U4)
24LC16B
Serial EEPROM
(U2)
SEEVAL® 32
Evaluation Tool
Header (U1)
3.3 VDC
(Battery)
Power
Supply
Battery Jumper
(JP1)
2.3.1Programming the PIC10F202
1. Download and Install the PICkit™ 2 programmer software onto your PC.
2. Copy the SEEVALDM-DL.hex file (supplied on the CD that came with this kit)
onto your PC.
3. When the PICkit™ 2 programmer software is started the main window will be
displayed on the PC, as indicated in Figure1-2.
4. Be sure that the battery (BT1) is installed and the jumper for Power is connected
(JP1).
5. Connect the MCP9800 T emperature Data Logger Demo Board 2 to the PICkit™
2 programmer (both programmer and board should be face up when connecting).
6. PICkit™ 2 programmer should have a green led on the front indicating that no
errors have occurred.
FIGURE 1-2:PICkit™ 2 Programmer GUI Window on the PC
7. Select Device Family>Baseline
8. Select PIC10F202 from the Device pull-down menu.
9. Select File>Import Hex
Locate, select, and open SEEVALDM-DL.hex from your PC.
10. Click on the Write Device Button in the PICkit™ 2 Programme r wind ow. The
PIC10F202 will be written to with the SEEVALDM-DL.hex firmware. Once completed, the status bar in the middle of the window will indicate Write Successful.
11. Disconnect the MCP9800 Temperature Data Logger Demo Board 2 from the
PICkit™ 2 programmer. Remove and replace the Power Header (JP1). Led
should begin flashing indicating that the PIC10F202 is reading temperature from
the MCP9800 and storing the data into the 24LC16B.
12. LED will flash indicating that measurements are being taken until the 24LC16B
has reached its storage limit (2,048 bytes).
from the File pull-down menu. A file window will appear.
.
2.3.2Reading Data from the MCP9800 Temperature Data Logger
Demo Board 2 board
1. Download and install the SEEVAL® 32 evaluation tool software using the
SEEVAL
2. When th e SEEVAL
displayed on the PC, as indicated in Figure1-3.
3. Select “I2C” from the Protocol pull-down menu.
4. Select “24AA16/24LC16B” from the Device Name pull-down menu.
®
32 Quick Start User’s Guide.
32 evaluation tool software is started the main window will be
MCP9800 Temperature Data Logger Demo Board 2 User’s Guide
5. Insert the MCP9800 Temperature Data Logger Demo Board 2 into to SEEVAL
32 evaluation board. To do this, flip the board upside down making sure the ICSP
pins are facing the right side of the SEEVAL
®
32 evaluation board. Place the 8
header pins in the rear (right side) of the ZIF socket. Close the socket.
6. Select Read>Entire Device
7. Your data (hexadecimal) will be displayed on the SEEVAL
to read the 24LC16B.
®
32 evaluation tool
software GUI.
FIGURE 1-3:SEEVAL
®
32 Evaluation Tool GUI Window on the PC
®
2.3.3Storing your Data
Select File>Export>Hex File and store your data to your PC (filename.hex).
2.3.4Displaying Temperature Data
1. Open file Temperature Graph.xls (Provided on the CD). Choose enable
macros if prompted. (May need to adjust security settings here if you are unable
to launch the file.)
2. Press the Import Data button.
3. Find your data file on your PC (filename.hex), Press Open Button.
4. Enter “1” for sample period when asked and press OK. If you have changed the
sample period in the firmware you will need to adjust the sample period here,
default is approximately 1 sample/sec.
5. Temperatures both positive and negative will be displayed on the graph. Tabs at
the bottom of the graph will show either °F or °C.
2.4.1The MCP9800 Temperature Data Logger Demo Board 2
Installation and Operation
This demo board was originally developed for the use in a class to teach people the
basics of the I
read and modify should one need to. Table 1-1 and T able 1-2 show some of the basic
subroutines and constant definitions used in the code. The TIMEOUTVAL variable may
be modified to put longer delays between measurements. Any value between 1
(default) and 255 may be used to vary the sample rate. The higher the number, the
slower the sample rate. The TIMEOUTVAL variable is approximately the number of seconds delay between measurements.
2.5I2C™ SUBROUTINES
The following subroutines provide low-level I2C support:
TABLE 1-1:I2C™ SUBROUTINES
SubroutineDescription
BSTART
BSTOP
SEND_ACK
SEND_NACK
BYTEOUT
BYTEIN
The following constants have been defined for communicating with the 24LC16B and
MCP9800:
2
C™ protocol. The code is formatted in such a manner that it is easy to
Generate an I2C™ bus Start condition.
Generate an I2C™ bus Stop condition.
Generate an I2C™ bus Acknowledge condition.
Generate an I2C™ bus Not Acknowledge condition.
Output an entire byte to the I2C™ bus.
Input an entire byte from the I2C™ bus.
Control byte for EEPROM write operation
Control byte for EEPROM read operation
Control byte for temp. sensor write operation
Control byte for temp. sensor read operation
Temperature register address for temp. sensor
Configuration register address for temp. sensor
Configuration value for Shutdown mode
Configuration value for One-Shot mode
Subroutine Descriptions
BSTART
Description:Generate an I2C bus Start condition.
Arguments:None.
Output:None.
Return Value:0
Code Example:
callBSTART; Generate Start
BSTOP
Description:Generate an I2C bus Stop condition.
Arguments:None.
The MCP9800 comes with user-programmable registers that provide flexibility for temperature-sensing applications. The register settings allow user-selectable 9-bit to 12-bit
temperature measurement resolution, configuration of the power-saving Shutdown and
One-Shot (single conversion on command while in Shutdown) modes and the specification of both temperature alert output and hysteresis limits. When the temperature
changes beyond the specified limits, the MCP9800 outputs an alert signal. The user
has the option of setting the alert output signal polarity as an active-low or active-high
comparator output for thermostat operation, or as a temperature event interrupt output
for microprocessor-based systems.
This device has I
sheet (DS21909) for further details).
2.5.2The 24LC16B
The 24LC16B is a 16 Kbit Electrically Erasable PROM. This device has
2
I
C/SMBus-compatible serial interface. Low-voltage design permits operation down to
1.8V with standby and active currents of only 1μa and 1mA, respectively. The device
also has a page write capability for up to 16 bytes of data.
2.5.3The MCP101
2
C/SMBus-compatible serial interface (refer to the MCP9800 data
The MCP101 is a voltage supervisory device designed to keep a microcontroller in
Reset until the system voltage has reached the proper level and stabilized. It also
operates as protection from brown-out conditions when the supply voltage drops below
a safe operating level.