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 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, dsPIC,
K
logo, rfPIC and UNI/O are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL 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, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified
logo, MPLIB, MPLINK, mTouch, Octopus, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance,
TSHARC, UniWinDriver, WiperLock and ZENA 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 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC
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.
A.3 Board – Top Copper and Pads ....................................................................19
A.4 Board – Top Pads and Silk ...................... .................... .. .................... .. ........20
A.5 Board – Top Copper, Pads and Silk ... ......................... .. ............................ ..21
A.6 Board – Bottom Copper and Pads ...............................................................22
Appendix B. Bill of Materials
Worldwide Sales and Service .................................................................................... 26
2010 Microchip Technology Inc.DS51918A-page 3
MCP3421 Weight Scale Demo Board User’s Guide
NOTES:
DS51918A-page 4 2010 Microchip Technology Inc.
MCP3421 WEIGHT SCALE
DEMO BOARD USER’S GUIDE
Preface
NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and
documentation are constantly evolving to meet customer needs, so some actual dialogs
and/or tool descriptions may differ from those in this document. Please refer to our web site
(www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each
page, in front of the page number. The numbering convention for the DS number is
“DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the
document.
For the most up-to-date information on development tools, see the MPLAB
Select the Help menu, and then Topics to open a list of available on-line help files.
®
IDE online help.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
MCP3421 Weight Scale Demo Board. 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 MCP3421 Weight Scale Demo Board as a
development tool to emulate and debug firmware on a target board. The manual layout
is as follows:
• Chapter 1. “Product Overview” – Provides important information about the
MCP3421 Weight Scale Demo Board hardware.
• Chapter 2. “Installation and Operation” – Describes the MCP3421 Weight
Scale Demo Board firmware.
• Chapter 3. “Weight Scale PC Software Tool” – Provides detailed information
about the board’s PC software tool.
• Appendix A. “Schematics and Layouts” – Shows the schematic and board
layouts for the MCP3421 Weight Scale Demo Board.
• Appendix B. “Bill of Materials” – Lists the parts used to build the MCP3421
Weight Scale Demo Board.
2010 Microchip Technology Inc.DS51918A-page 5
MCP3421 Weight Scale Demo Board User’s Guide
CONVENTIONS USED IN THIS GUIDE
This manual uses the following docum entat io n conven tion s:
DOCUMENTATION CONVENTIONS
DescriptionRepresentsExamples
Arial font:
Italic chara c tersReferenced 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
N‘RnnnnA number in verilog format,
Text in angle brac kets < >A key on the keyboardPress <Enter>, <F1>
Courier New font:
Plain Courier NewSample source code#define START
Italic Courier NewA variable argumentfile.o, where file can be
Choice of mut ually exclus ive
arguments; an OR selection
Represents code supplied by
user
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options]
errorlevel {0|1}
var_name...]
void main (void)
{ ...
}
®
IDE User’s Guide
DS51918A-page 6 2010 Microchip Technology Inc.
RECOMMENDED READING
This user’s guide describes how to use MCP3421 Weight Scale Demo Board. Other
useful documents are listed below. The following Microchip documents are available
and recommended as supplemental reference resources:
• MCP3421 Data Sheet – 18-Bit Analog-to-Digital Converter with I
Interface and On-Board Reference (DS22003)
• MCP3422/3/4 Data Sheet – 18-Bit, Multi-Channel ΔΣ Analog-to-Digital
Converter with I
• MCP6V07 Data Sheet – 300 µA, Auto-Zeroed Op Amps (DS22093)
• PIC18F4550 Data Sheet – 28/40/44-Pin, High-Performance, Enhanced Flash,
USB Microcontrollers with nanoWatt Technology (DS39632)
• AN1030 – Weigh Scale Applications for the MCP3551 (DS01030)
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at www.microchip.com. This web
site is used as a means to make files and information easily available to customers.
Accessible by using your favorite Internet browser, the web site contains the following
information:
• Product Support – Data sheets and errata, application notes and sample
programs, design resources, user’s guides and hardware support documents,
latest software releases and archived software
• General Technical Support – Frequently Asked Questions (FAQs), technical
support requests, online discussion groups, Microchip consultant program
member 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
2
C™ Interface and On-Board Reference (DS22088)
Preface
2
C™
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
Customers should contact their distributor, representative or field application engineer
(FAE) for support. Local sales offices are also available to help customers. A listing of
sales offices and locations is included in the back of this document.
Technical support is available through the web site at: http://support.microchip.com.
DOCUMENT REVISION HISTORY
Revision A (November 2010)
• Initial Release of this Document.
2010 Microchip Technology Inc.DS51918 A-page 7
MCP3421 Weight Scale Demo Board User’s Guide
NOTES:
DS51918A-page 8 2010 Microchip Technology Inc.
1.1OVERVIEW
The MCP3421 Weight Scale Demo Board works with the LabVIEW™ Graphical User
Interface (GUI) PC Software. This demo board demonstrates how to use the MCP3421
18-bit Delta-Sigma ADC for weight scale applications. It uses the PIC18F4550 microcontroller for data processing and USB communication with PC. This board also demonstrates the changes in the system performance by adjusting the parameters of the
sensor signal conditioning circuits using the MCP6V07 auto-zeroed op amp.
1.1.1Feature Highlights
• The LCD displays the user’s selected option and the ADC output code or the
• The user can select the signal averaging factor (1 or 4) by pressing the S3 button.
• System performance analysis using PC GUI: the interface allows various
• Hardware PCB design examples: this demo board utilizes a robust grounding
• Signal conditioning examples using MCP6V07: the low-noise op amp is used to
• 2 Kg load cell with 1 mV/V sensitivity.
MCP3421 WEIGHT SCALE
DEMO BOARD USER’S GUIDE
Chapter 1. Product Overview
calculated results.
The selected option is displayed on the LCD.
interactive post signal processing, such as standard deviations and histogram.
method of analog circuits in PCB design. It also demonstrates how to split analog
and digital ground planes.
boost input signal levels.
FIGURE 1-1: MCP3421 Weight Scale Demo Board.
2010 Microchip Technology Inc.DS51918A-page 9
MCP3421 Weight Scale Demo Board User’s Guide
1.2ANALOG INPUT CONFIGURATION OPTIONS
The MCP3421 Weight Scale Demo Board has an MCP6V07 auto-zeroed op amp, to
investigate different signal conditioning configuration.
As shown in Figure 1-2, the user can configure the input signal chain with the following
three options, combiningthe jumpers:
a) Bypassing the MCP6V07: the MCP3421 input pins are directly connected to the
sensor output. In this case, the PGA of the MCP3421 is set to a gain of 8. The
jumpers must be set as follows: J4 and J5 are on the left position. J10 and J13
are ON, while J8, J9, J11 and J12 are OFF (see Figure 1-3a).
b) Extra gain is added by the low-noise, auto-zeroed op amp MCP6V07, before the
ADC. The added gain is 50x, and the ADC’s PGA is 2x. For this option the jumpers must be set as follows: J4 and J5 are on the right position; J9, J11 and J12
are ON, while J8, J10 and J13 are OFF (see Figure 1-3b).
c) PGA = 1x, but uses the MCP6V07 to add high gain. Extra gain is added by the
low-noise, auto-zeroed op amp MCP6V07, before the ADC. The added gain is
250x, and the ADC’s PGA is 1x. For this option the jumpers must be set as follows: J4 and J5 are on the right position; J8, J11 and J12 are ON, while J9, J10
and J13 are OFF (see Figure 1-3c).
d) Table 1-1 shows the jumper positions and their results.
FIGURE 1-2:Signal Conditioning and ADC on the MCP3421 Weight Scale Demo Board.
DS51918A-page 10 2010 Microchip Technology Inc.
Product Overview
TABLE 1-1:JUMPERS POSITIONS VS. FUNCTION
SymbolJumpers PositionsFunction
(1)
xPGA
xGLo
xGHi
Note 1: x indicates the selected averaging factor (1 or 4).
J4 and J5 connected to J19
J10 and J13 are ON
J8, J9, J11 and J12 are disconnected (
(1)
J4 and J5 connected to GND
J9, J11 and J12 are ON
J8, J10 and J13 are disconnected (
(1)
J4 and J5 connected to GND
J8, J11 and J12 are ON
J9, J10 and J13 are disconnected (
Figure 1-3a)
Figure 1-3b)
Figure 1-3c)
This combination evaluates the ADC performance. The on-board op amp is bypassed.
This combination evaluates the influence of the
extra gain added by the MCP6V07 device.
This combination evaluates the influence of the
extra gain added by the MCP6V07 device, but
with higher extra gain.
FIGURE 1-3:Gain Selection Options on MCP3421 Weight Scale Demo Board.
1.3LOAD CELL
The MCP3421 device with a maximum PGA gain setting (8x) can detect an input signal
level as low as 2 µV. Therefore, it can detect the input with an accuracy of 1g. When
measuring such a low input signal level, to control the noise level at the input pins is
very important. Therefore, using low-noise op amp at the signal conditioning circuit is
necessary. In this demo board, MCP6V07 auto-zeroed op amp is used. This op amp
has the offset voltage less than ±2 µV, and drifts less than ±50 nV/C.
Additional improvement in signal-to-noise ratio can be achieved by doing more averaging in digital domain. The user can tell the difference by selecting the data average
options 1 or 4. The results are shown in the PC GUI.
Note: This demo board uses a low-cost load cell for demonstration purposes. The
load cell can measure up to 2 Kg with 1 mV/V sensitivity. The load cell
output is connected to the demo board PCB through J18 and J19
connectors. The user can also connect their own load cell instead.
2010 Microchip Technology Inc.DS51918A-page 11
MCP3421 Weight Scale Demo Board User’s Guide
1.4UNIVERSAL SERIAL BUS (USB) AND PIC18F4550 MICROCONTROLLER
The MCP3421 Weight Scale Demo Board has a USB connector to communicate with
the PC GUI. The PC GUI allows various user options, such as calibrations and performance evaluation of the system.
The USB communication with the PC is done by the on-board microcontroller.
PIC18F4550 is also communicating with the ADC, and controls the LCD.
The four button switches on the board have the following functions:
• S5 is the Reset pin
• S2 is used to change the LCD indication from “Weight” to “ADC code”, “ADC output”, or “Calibration”
• S3 is used in parallel with the configuration of the signal conditioning chain. By
pressing this button, the LCD indication will change from 1PGA to 1GLo, 1GHi,
4PGA, 4GLo or 4GHi. PGA means that the ADCs PGA only is used at highest
gain. GLo means that the external op amp is being used with low gain, GHi means
that external op amp is used with high gain. The 1 and 4 before the letters indicate
the numbers of averages – no averaging, or averaging on four samples
• S4 is doing the zero calibration. By pressing this button, the “Weight” indication
will go to a value closer to 0g.
1.5WHAT THE MCP3421 WEIGHT SCALE KIT CONTAINS
The MCP3421 Weight Scale Demo Board kit includes:
• MCP3421 Weight Scale Demo Board, 102-00250
• Important Information Sheet
DS51918A-page 12 2010 Microchip Technology Inc.
MCP3421 WEIGHT SCALE
DEMO BOARD USER’S GUIDE
Chapter 2. Installation and Operation
2.1MCP3421 CONFIGURATION BIT SETTINGS AND DATA ACQUISITION
The communication with the ADC is done through I2C, but the I2C peripheral port of the
MCU is not being used. Instead, two pins (RA4, RA5) are being controlled from the firmware.
The MCU is changing the setup of the ADC each time S3 is pressed, to change the
PGA gain: 8x for PGA, 2x for GLo and 1x for GHi. The ADC always operates in 18-bit
mode.
The data received from the MCP3421 device is scaled to a value expressed in grams
by the compute() function, in order to be displayed on the LCD.
There are two calibration steps: offset subtraction and gain scaling. The two values, the
offset and the gain constants, are stored in EEPROM during the calibration, and read
out at Reset, or when the S3 is pressed.
2.2USB COMMUNICATION
The Microchip USB Firmware Framework is a software library developed by Microchip
Technology Inc., that can be used to create new USB applications. It can be
considered as a reference design project, containing the necessary firmware code for
USB operation, also providing a placeholder for user’s code. The whole code project
is contained within one single root project directory, with many subdirectories for
source code organization.
®
Microchip provides a general purpose Windows
dows applications, to interface with a custom class USB device. The driver will not be
used in all USB applications, one of the exceptions being the USB HID class devices,
which would normally use built-in HID class drivers distributed with the OS.
For USB applications that do not easily fit within the constraints of these other device
class options, Microchip’s general purpose driver may be used. Windows applications
can access the USB devices either by directly interfacing with the driver
(mchpusb.sys), or indirectly use the driver through a pre-compiled library.
A custom class Windows application using the Microchip general purpose USB driver
may interface directly with the driver (mchpusb.sys). By doing so, it requires more
effort and more learning time than using a pre-compiled library that exposes a simple
to use API, including basic functions like open(), read(), write() and close().
The MPUSBAPI.DLL file is a library which provides a number of functions, including the
basic ones needed for reading and writing to an USB device. A list of the functions
available and the calling conventions for those functions is currently documented in the
form of in-line comments in the source code for the DLL file. The DLL is compiled using
Borland
in the <System Driver>:
®
C++ Builder™ 6 development environment, and the source code is provided
A load time linking and a run time linking example, showing how to use the DLL, are
included in the System Driver:\MCHPFSUSB\Pc\Mpusbapi\Example Applications
directory.
Note: For running this project, the USB Microchip Stack must be installed on the
user’s machine.
The MCP3421 Weight Scale Demo Board firmware is mainly based on the USB stack
example: “Device – MCHPUSB – Generic Driver Demo”. Most of the firmware changes
of the MPLAB MCP3421 Weight Scale Demo Board project are done in the user v7 eeprom.c file. This project is downloadable from Microchip’s MCP3421 product page
web site: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en520011.
The input offset error voltage is computed when S4 is being pressed. The gain constant
is computed by the PC software and transmitted to the MCU via USB on the OUT-Packet._byte[2] to OUTPacket._byte[7].
The weight scale is sending to the PC software the following values: weight, ADC code,
ADC output, zero calibration and gain calibration, represented by six characters using
INPacket._byte[0] to INPacket._byte[31].
DS51918A-page 14 2010 Microchip Technology Inc.
Chapter 3. Weight Scale PC Software Tool
3.1SOFTWARE INSTALLATION
The Weight Scale PC software is an executable file that does not require installation.
But, to enable running the software, the user must first install two additional programs,
in the following order:
- NI LabVIEW Run-Time Engine
- NI-VISA Run-Time Engine
These programs can be downloaded from www.ni.com
3.2SOFTWARE OVERVIEW
The MCP3421 Weight Scale Demo Board includes a PC graphical user interface (GUI),
that can be used to evaluate the weight scale accuracy and weight scale calibration.
This board is communicating with the software via USB port.
The following figure shows a sample of the software’s GUI in Measurement mode:
The user can control the size of the X axis by writing the desired figure in buffer length.
Several series of statistical analysis are performed on this buffer, the most important
being displayed on the screen, under the Measurement Standard Deviation. This
deviation is measured in grams and represents the RMS noise value of the weight
scale. The actual accuracy of the weight scale can be defined in many ways, but most
commonly it is 10 times the standard deviation.
2010 Microchip Technology Inc.DS51918A-page 15
MCP3421 Weight Scale Demo Board User’s Guide
3.3WEIGHT SCALE CALIBRATION
The MCP3421 Weight Scale Demo Board requires a two points calibration: one at 0g,
to remove the weight scale offset, and another at a known point, for gain calibration.
To perform the complete weight scale calibration the user must follow the next steps:
1. Connect the weight scale to the PC and run the software.
2. Press S3 button to select the desired option (xPGA, xGLo or xGHi).
3. Press S4 to remove the offset. The weight indication does not reach 0 in all
cases. This is a normal behavior, since calibration is not completed at this step.
4. Place a known weight on the scale’s platform.
5. Write the weight value in the “Calibration Weight (g)” field on the GUI.
6. Press Calibrate button from the GUI, or F4 on the keyboard. This last step will
perform the gain calibration.
The offset calibration may be required more often than the gain calibration, for precision
reasons. Once the complete weight scale calibration done, the offset calibration can be
performed at any time, by pressing S4.
It is important to perform complete calibrations for all six signal conditioning options.
The calibration constants are being stored in the MCU EEPROM.