Note the following details of the code protection feature on Microchip devices:
•Microchip products meet the specification contained in their particular Microchip Data Sheet.
•Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•Microchip is willing to work with the customer who is concerned about the integrity of their code.
•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is 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
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 support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, Adaptec,
AnyRate, AVR, AVR logo, AVR Freaks, BesTime, BitCloud, chipKIT,
chipKIT logo, CryptoMemory, CryptoRF, dsPIC, FlashFlex,
flexPWR, HELDO, IGLOO, JukeBlox, KeeLoq, Kleer, LANCheck,
LinkMD, maXStylus, maXTouch, MediaLB, megaAVR, Microsemi,
Microsemi logo, MOST, MOST logo, MPLAB, OptoLyzer,
PackeTime, PIC, picoPower, PICSTART, PIC32 logo, PolarFire,
Prochip Designer, QTouch, SAM-BA, SenGenuity, SpyNIC, SST,
SST Logo, SuperFlash, Symmetricom, SyncServer, Tachyon,
TempTrackr, TimeSource, tinyAVR, UNI/O, Vectron, and XMEGA
are registered trademarks of Microchip Technology Incorporated in
the U.S.A. and other countries.
APT, ClockWorks, The Embedded Control Solutions Company,
EtherSynch, FlashTec, Hyper Speed Control, HyperLight Load,
IntelliMOS, Libero, motorBench, mTouch, Powermite 3, Precision
Edge, ProASIC, ProASIC Plus, ProASIC Plus logo, Quiet-Wire,
SmartFusion, SyncWorld, Temux, TimeCesium, TimeHub,
TimePictra, TimeProvider, Vite, WinPath, and ZL are registered
trademarks of Microchip Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any
Capacitor, AnyIn, AnyOut, BlueSky, BodyCom, CodeGuard,
CryptoAuthentication, CryptoAutomotive, CryptoCompanion,
CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average
Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial
Programming, ICSP, INICnet, Inter-Chip Connectivity, JitterBlocker,
KleerNet, KleerNet logo, memBrain, Mindi, MiWi, MPASM, MPF,
MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach,
Omniscient Code Generation, PICDEM, PICDEM.net, PICkit,
PICtail, PowerSmart, PureSilicon, QMatrix, REAL ICE, Ripple
Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI,
SuperSwitcher, SuperSwitcher II, Total Endurance, TSHARC,
USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, 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.
The Adaptec logo, Frequency on Demand, Silicon Storage
Technology, and Symmcom are registered trademarks of Microchip
Technology Inc. in other countries.
GestIC is a registered trademark of Microchip Technology Germany
II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in
other countries.
All other trademarks mentioned herein are property of their
respective companies.
Appendix B. Bill of Materials (BOM) ...........................................................................43
B.1 MCP331X1D Evaluation Board – Bill of Materials (BOM) ............................ 43
Worldwide Sales and Service .....................................................................................48
DS50002733B-page 4 2018-2019 Microchip Technology Inc.
MCP331X1D 16/14/12-BIT,
1 MSPS SAR ADC EVALUATION KIT
USER’S GUIDE
Preface
NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and
documentation are constantly evolving to meet customer needs, so some actual dialogs
and/or tool descriptions may differ from those in this document. Please refer to our website
(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
“DSXXXXXXXXA”, where “XXXXXXXX” 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 online help files.
®
IDE online help.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit. Items discussed in this
chapter include:
• Document Layout
• Conventions Used in this Guide
• Recommended Reading
• The Microchip Website
• Customer Support
• Document Revision History
DOCUMENT LAYOUT
This document describes how to use the MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC
Evaluation Kit to demonstrate the performance of the MCP331X1 device family. The
manual layout is as follows:
Choice of mutually exclusive
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
DS50002733B-page 6 2018-2019 Microchip Technology Inc.
RECOMMENDED READING
This user’s guide describes how to use the MCP331X1D 16/14/12-Bit, 1 Msps SAR
ADC Evaluation Kit. Another useful document is listed below. The following Microchip
document is available and recommended as a supplemental reference resource.
• MCP33131D/21D/11D-XX Data Sheet – “1 Msps /500 ksps 16/14/12-Bit
Differential Input SAR ADC” (DS20005947)
THE MICROCHIP WEBSITE
Microchip provides online support via our website at www.microchip.com. This website is
used as a means to make files and information easily available to customers. Accessible
by using your favorite Internet browser, the website 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
Preface
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Embedded System Engineer (ESE)
• 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 website at:
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
NOTES:
DS50002733B-page 8 2018-2019 Microchip Technology Inc.
MCP331X1D 16/14/12-BIT,
1
2
7
6
5
4
3
8
9
MCP331X1D Evaluation
Board
PIC32MZ EF Curiosity
Development Board
1 MSPS SAR ADC EVALUATION KIT
USER’S GUIDE
Chapter 1. Quick Start Guide for Hardware Setup
The following nine steps provide a quick start guide for setting up the MCP331X1D 16/14/12-Bit, 1 Msps
SAR ADC Evaluation Board and the PIC32MZ EF Curiosity Development Board.
FIGURE 1-1:MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit (default).
1. On the PIC32MZ EF Curiosity Development Board, move the PWR IN jumper to connect pins, V
2. Connect the Micro-USB cable from the PC to J12 on the PIC32MZ EF Curiosity Development Board.
3. If using a preprogrammed PIC32MZ EF Curiosity Development Board, skip to Step 5. If using a
4. Once the firmware is loaded, remove the programmer and wait for LED4 to illuminate with a solid red
5. Connect the MCP331X1D Evaluation Board (ADM00873) to the top right mikroBUS™ header (J10),
6. Connect a 9V power supply to the barrel jack connection point using either the supplied 9V wall power
and V
This USB is used for both power and data transfer for the PIC32MZ EF board.
non-programmed version of the PIC32MZ EF Curiosity Development Board, then program the
PIC32MZ with the latest MCP331X1D Evaluation Board (ADM00873) Hex file (available on
www.microchip.com) using an external programmer (MPLAB
the ICSP™ HDR (J16).
light. A solid red lit LED indicates that the firmware is loaded and the board is working as intended.
as displayed in Figure 1-1.
supply or, alternatively, connect 9V from an external power source to the H1 headers. D1, directly
below the barrel jack, will illuminate to confirm that 9V is being supplied to the evaluation board.
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
7. Connect either a fully differential or single-ended signal source.
a) When using a Fully Differential signal source:
-Connect positive input to J1 SMA connector
-Connect negative input to J2 SMA connector
b) When using Single-Ended input signal:
-Connect positive input to J1 SMA connector
-Populate jumper at J6 headers to connect the negative input to V
Note:When the jumper J6 is connected, V
driver). The U1 output swings with V
/2 is automatically provided to input pin IN- of U1 (ADC
REF
+/2 centered at the V
IN
COM
is used in this board.
8. PC GUI: Install and launch SAR_ADC_Utility.exe (available on www.microchip.com). The
software will automatically recognize the plugged in device and launch the GUI.
9. Once the GUI is open, use the blue Play button to run single or continuous acquisitions. The GUI will
display all performance analysis data related to the acquired signal.
/2
REF
voltage. Where V
REF
= 4.048V
DS50002733B-page 10 2018-2019 Microchip Technology Inc.
MCP331X1D 16/14/12-BIT,
1 MSPS SAR ADC EVALUATION KIT
USER’S GUIDE
Chapter 2. Product Overview
2.1INTRODUCTION
This chapter provides an overview of the MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC
Evaluation Kit and covers the following topics:
• MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board Features
• MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit Contents
• MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit Requirements
• MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board Overview
• SAR ADC Device Configuration
• PIC32MZ EF Curiosity Development Board (DM320104) Overview
• SAR ADC Utility Software Overview
2.2MCP331X1D 16/14/12-BIT, 1 MSPS SAR ADC EVALUATION BOARD
FEATURES
This MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit is a fully assembled,
programmed and tested solution to evaluate and demonstrate the MCP33131D
operating performance.
The MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit features:
• Full-Scale Analog Input Range: -V
- ADM00873 with Differential Input Configuration: -4 VPP to +4 V
- ADM00873 with Single-Ended Input Configuration: 0V to +4 V
• Dynamic Performance Monitoring
• Evaluation of Performance Parameters, such as: SNR, SFDR, THD, INL, DNL,
Voltage Measurement and so on
• Evaluate Input Signal in Time Domain
• Ability to Save and Load Software Configurations
• Ability to Save and Load Raw Data for User Post-Processing
For information about the device features, refer to the “MCP331X1 Data Sheet”.
REF
to +V
REF
PP
PP
2.3MCP331X1D 16/14/12-BIT, 1 MSPS SAR ADC EVALUATION KIT CONTENTS
The MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board includes the
following items:
• MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board with On-Board
Reference (V
• PIC32MZ EF Curiosity Development Board, Preprogrammed with SAR ADC
Firmware (ADM320104)
• 9V Wall Plug-in Power Supply
• USB Cable from Curiosity PIC32 Development Board to PC
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
9V Power Supply5V Power Supplied via USB
USB
MCP331X1D
Evaluation Board
(Note 1)
Curiosity PIC32MZEF
Development Board
(DM320104) (Note 2)
PC GUI
(SAR ADC Utility
Software)
(Note 3)
Note 1: The ADC part is available on this board.
2: This board collects ADC data from the evaluation board and passes them to the PC GUI.
3: This GUI provides various user interfaces to test the performance of the MCP331X1 device.
Signal
Input
SPI
2.4MCP331X1D 16/14/12-BIT, 1 MSPS SAR ADC EVALUATION KIT
REQUIREMENTS
The MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board requires:
• Curiosity PIC32MZEF Development Board (DM320104)
• Type A Male to Micro-B USB Cable
• External Signal Input:
- Supplied by the user
• SAR ADC Utility Software (GUI):
- Available on the Microchip website
2.5MCP331X1D 16/14/12-BIT, 1 MSPS SAR ADC EVALUATION BOARD OVERVIEW
The MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board is intended to
demonstrate the performance of the MCP331X1 device family. This evaluation board
is used together with:
• Curiosity PIC32MZEF Development Board (DM320104)
• SAR ADC Utility Software
Figure 2-1 displays the system setup.
FIGURE 2-1:MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit System Setup.
This evaluation board supports the MCP331X1D-10 device family, which is Microchip
Technology’s fully differential single channel 12/14/16-bit, 1 Msps SAR Analog-to-Digital
Converter (ADC).
The MCP331X1D Evaluation Board comes with the MCP331X1 device on board. All
conditions and features can be evaluated using this evaluation board. Refer to Figure 2-2
and Figure 2-3 for photos of the evaluation boards, and refer to Ta bl e 2 -1 for our currently
available fully differential device offerings compatible with this evaluation board.
TABLE 2-1:DEVICES SUPPORTED BY MCP331X1D EVALUATION KIT
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
2.6SAR ADC DEVICE CONFIGURATION
Each evaluation board features a 4-way SPST DIP switch (schematic designator:
SW1) that allows the user to manually configure the board for a variety of available
Microchip SAR ADC devices. Ta ble 2 -2 lists each available switch setting. Refer to
Figure 3-1 from Chapter 3. “Installation and Operation”to view the location of SW1.
TABLE 2-2:SW1 DEVICE CONFIGURATION SETTINGS
Part NumberResolutionSpeed
MCP33111-0512500 kspsSingle-Ended0-0-0-0
MCP33111D-0512500 kspsDifferential0-0-0-1
MCP33121-0514500 kspsSingle-Ended0-0-1-0
MCP33121D-0514500 kspsDifferential0-0-1-1
MCP33131-0516500 kspsSingle-Ended0-1-0-0
MCP33131D-0516500 kspsDifferential0-1-0-1
MCP33111-10121 MspsSingle-Ended1-0-1-0
MCP33111D-10121 MspsDifferential1-0-1-1
MCP33121-10141 MspsSingle-Ended1-1-0-0
MCP33121D-10141 MspsDifferential1-1-0-1
MCP33131-10161 MspsSingle-Ended1-1-1-0
MCP33131D-10161 MspsDifferential1-1-1-1Default
Input
Configuration
SW1 Setting:
(ID3:ID2:ID1:ID0)
Notes
DS50002733B-page 14 2018-2019 Microchip Technology Inc.
Product Overview
2.7PIC32MZ EF CURIOSITY DEVELOPMENT BOARD (DM320104) OVERVIEW
Note 1:The PIC32MZ EF Curiosity Development Board is used for data capture
from the MCP331X1D Evaluation Board. This board can be purchased
with preprogrammed SAR ADC firmware compatible with the
MCP331X1D Evaluation Board (ADM00873).
2:The PIC32MZ EF Curiosity Development Board included in the
MCP331X1D Evaluation Kit is already preprogrammed with SAR ADC
firmware.
The PIC32MZ EF Curiosity Development Board (DM320104) is a fully-integrated,
32-bit development platform featuring the high-performance PIC32MZ EF Series PIC
Microcontroller (PIC32MZ2048EFM100), which is utilized for capturing the digital data
received from the MCP331X1D Analog-to-Digital Converter (ADC) Evaluation Board.
Figure 2-1 shows the connection of the PIC32MZ EF Curiosity Development Board
directly between the MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board
and the SAR ADC Utility Software.
The Curiosity Development Board (DM320104) connects to the PC through a USB
cable, providing the user with two functionalities:
• The ability to send user commands directly to the device from the SAR ADC Utility
Software.
• The ability to collect data from the evaluation board and send them to the SAR
ADC Utility Software.
Figure 2-3 displays a close-up of the PIC32MZ EF Curiosity Development Board. More
information, including user’s guides and other resources for the Curiosity Development
Board, can be found by visiting www.microchip.com.
®
FIGURE 2-3:PIC32MZ EF Curiosity Development Board (DM320104).
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
2.7.1Using the PIC32MZ EF Curiosity Development Board for
Firmware Development Tool
The PIC32MZ EF Curiosity Development Board includes the PICkit™ On-Board
(PKOB) debugger based on the PIC24FJ256GB106 USB microcontroller. In addition,
it provides the option to use external debuggers, such as MPLAB
MPLAB ICD 3, by connecting to the In-Circuit Serial Programming™ (ICSP™) header,
J16.
By default, the on-board debugger is connected to the programming pins (PGEC and
PGED) of the PIC32 device. To use an external debugger, remove jumper J2 to
disconnect the on-board debugger from driving the programming pins.
Note:More details about this can be found in the “PIC32MZ EF Curiosity
Development Board User’s Guide” (DS70005282), available for download
at www.microchip.com.
TABLE 2-3:DEBUGGER SELECTION
J2 Jumper Positions
On-Board DebuggerExternal Debugger
Pins 1-2 ShortedPins 1-2 Open
Pins 3-4 ShortedPins 3-4 Open
®
REAL ICE™ or
2.8SAR ADC UTILITY SOFTWARE OVERVIEW
The SAR ADC Utility Software is the Graphical User Interface (GUI) used to
communicate with the device and to configure its operating parameters. The software
communicates with the ADC through the PIC32MZ EF Curiosity Development Board
and a USB cable. When the user interacts with the software, the user’s commands are
passed to the MCP331X1 device through the PIC32MZ EF Curiosity Development
Board. Once the commands are executed by the MCP331X1D Evaluation Board, the
software receives the requested data from the PIC32MZ EF Curiosity Development
Board. The software then analyzes the data, performs an FFT or other analysis and
displays the results. Refer to Figure 2-1 for a diagram of the system setup.
Figure 2-4 through Figure 2-10 show screen captures of the various performance
displays available within the SAR ADC Utility.
The SAR ADC Utility Software is available for download at www.microchip.com. For
instructions on using the GUI, refer to the software’s supporting documentation
included with the installation file, as well as within the application Help menu.
DS50002733B-page 16 2018-2019 Microchip Technology Inc.
Product Overview
1
2
3
FIGURE 2-4:SAR ADC Utility Software Displaying a Typical FFT Waveform.
1. Click the Single Conv. button for a single shot of the conversion results. Click
Continuous for continuous repeated conversion results.
2. Click Calibrate to manually send an ADC calibration command. ADC automatically
self-calibrates on initial hardware start-up.
3. Device selected automatically based on DIP setting at SW1. See
Section 2.6 “SAR ADC Device Configuration” for details.
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
1
2
3
FIGURE 2-5:SAR ADC Utility Software Displaying a Single Acquisition Bit Position Digital Output.
1. This feature is only available in Single Conversion One-Shot mode.
2. Select Single-Shot from Operating Mode drop-down menu to enable the single
acquisition bit position digital output display.
3. V
value must be manually entered based on the ADC’s supplied V
REF
ADM00873 defaults on board to V
REF
=4V.
REF
.
This feature is very useful for the MCU firmware developer for using a known input
signal, and seeing the output code and voltage to validate the firmware.
DS50002733B-page 18 2018-2019 Microchip Technology Inc.
Product Overview
1
FIGURE 2-6:INL DNL Performance Display.
1. Select INL DNL from the Domain menu in order to enable INL DNL Measurement
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
NOTES:
DS50002733B-page 24 2018-2019 Microchip Technology Inc.
1 MSPS SAR ADC EVALUATION KIT
Chapter 3. Installation and Operation
3.1CONFIGURATION REQUIREMENTS
To power up and run the evaluation kit, the following are required:
• SAR ADC Utility Software
• MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board
• PIC32MZ EF Curiosity Development Board (DM320104)
• Type A Male to Micro-B USB Cable
• External Signal Source, Differential or Single-Ended Output (see
Section 3.2.1 “Input Signal”)
3.1.1Power Input Connection
This MCP331X1D Evaluation Board comes with a 9V wall plug-in switching power
supply (CUI INC P/N: SWI12-9-N-P6). This power supply is able to provide a 9V, 1.2A
maximum output. It can be connected to an AC wall outlet rated between 100V AC and
240V AC, at a frequency of 50 Hz to 60 Hz. The other end of the power supply is a
2.1 mm barrel plug that connects to the MCP331X1D Evaluation Board (see
Figure 3-1). If the user chooses to connect a different external power supply, a mini-
mum output of 500 mA is required, with a voltage output between 6V-12V. There is no
on-board 9V regulator, so the 9V OUT pin (TP4) will read a voltage equal to the voltage
input value selected by the user.
MCP331X1D 16/14/12-BIT,
USER’S GUIDE
Avoid connecting a power supply with a voltage greater than what is recommended in
this user guide. Doing so can damage the voltage regulators, requiring them to be
replaced.
3.2EVALUATION KIT SETUP
1. Connect the MCP331X1D Evaluation Board and the PIC32MZ EF Curiosity
Development Board, as shown in Figure 3-1.
2. Connect the PIC32MZ EF Curiosity Development Board to a computer using a
Type A male to Micro-B USB cable. In order to power the Curiosity Board through
USB, the USB cable must be plugged into the USB connection located at J12. In
addition to this, the headers located at J8 need to have the jumper connecting
the V
3. Power up the MCP331X1D Evaluation Board using the provided 9V power
supply.
4. Connect a differential or single-ended analog input signal to the MCP331X1D
Evaluation Board SMA terminals. For single-ended operation, populate jumper
J6 (see Figure 3-1 for jumper location). By populating this jumper, the negative
signal input will be tied to V
negative signal input (J2) with 0Ω. This can be done by shorting C34.
5. Run the SAR ADC Utility Software. See Section 2.8 “SAR ADC Utility
Software Overview”.
pin to VIN. Figure 3-1 shows the component locations.
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
- +
Configuration
Switch (SW1)
PIC32MZ EF Curiosity Development Board (DM320104)
Analog Inputs
ADC Power Circuit
Power
Supply
Input (9V)
Alternate
Power
Supply (9V)
MCP331X1D 16/14/12-Bit, 1 Msps SAR
ADC Evaluation Board (ADM00873)
Differential Driver (U1)
V
REF
Regulator (U2)
MCP6286 Op Amp (U5)
ADC Device (U3)
USB Power
Supply (J12)
Curiosity Power
Source Selection
Header (J8)
V
COM (VREF
/2 for S.E.
Source) Jumper (J6))
Driver Enable (J8)
-1V/GND Driver Input Select (J4)
FIGURE 3-1:The MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Board (ADM00873)
connected to the PIC32MZ EF Curiosity Development Board (DM320104).
3.2.1Input Signal
The best way to evaluate the MCP331X1D device is to use a clean analog input signal
with as little noise as possible and no harmonic contents. The AP2722 Audio Analyzer
from Audio Precision can be used to generate a clean analog signal for evaluation
purposes
source and EVB to remove any noise outside of the desired frequency.
. If using a less pure signal source, a filter can be added between the signal
DS50002733B-page 26 2018-2019 Microchip Technology Inc.
1 MSPS SAR ADC EVALUATION KIT
Chapter 4. Firmware
4.1PIC32MZ2048EFM100 INITIALIZATION
MPLAB® X IDE and MPLAB Harmony were used to develop the firmware for the
PIC32MZ2048EFM100 on the PIC32MZ EF Curiosity Development Board
(DM320104).
The MCU runs at 130 MHz and the SPI prescaler is set to perform a division by 2 in
order to obtain an SPI clock frequency of 65 MHz. This is the minimum SPI speed
required to successfully read 16 bits of data out of the ADC at 1 Msps.
In the firmware for this demo, a USB stack was used to achieve communication with
the GUI. Direct Memory Access (DMA) was used together with SPI and Output
Compare in order to acquire data, and to gate the clock during acquisition.
4.2DATA ACQUISITION
In this demonstration, the ADC acquisition is triggered by the CONV pulse (RPD5),
which is generated by the OC2. The OC2 is generated by Timer3 (OCTSEL = 1).
Timer3 is also used to generate OC1 which triggers the DMA SPI transfer. Because
both the SPI transfer and CONV pulse are generated by the same timer, they are
synchronous. Figure 4-1 displays the timing diagram between the CONV pulse and
SPI transfer.
MCP331X1D 16/14/12-BIT,
USER’S GUIDE
FIGURE 4-1:SPI Transfer and CONV Pulse.
The reason for using OC2 and not SS is related to Electromagnetic Interference (EMI).
By using OC2, the user can control the timing between the falling edge of the CONV
pulse and SPI transfer, and also the timing between the data transfer and CONV rising
edge/ADC conversion start. For best EMI performance, it is recommended to keep a
few nanoseconds between the SPI data transfer and ADC conversion start.
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
The ADC’s data conversion time is fixed (700 ns for the MCP33131D-10), but the input
acquisition time (300 ns for 1 Msps sampling rate) can be increased by the user for a
lower sampling rate. The ADC output data are transferred during the input acquisition
time (300 ns for 1 Msps sampling rate).
It is important to reduce external noises during the data conversion time for accurate
performance (i.e., higher SNR and SFDR). The high-speed SPI operation can disturb
the ADC’s data conversion during the data conversion time. Therefore, it is highly
recommended to allow at least 10 ns of quiet time between the last edge on the SPI
clock/data and the rising edge on the ADC conversion start pulse.
FIGURE 4-2:Input Acquisition (Input Sampling) and Data Conversion of the
ADC Operation Sequence.
Once the data are transfered from the ADC to SPI, the DMA will place it in a 8192 word
buffer (ADC_BUFFER[]). Since the sampling speed is 1 Msps, this buffer will be
updated every 8.1 ms, making timing less critical for other tasks.
The GUI requires a larger amount of data to be processed in order to indicate accurate
performance characteristics: FFT, THD, SINAD, etc. Because of this, a larger data
buffer is created in RAM (storage[]) with a length of 262144 bytes. 32 DMA
transfers are required to fill this buffer. The flowchart in Figure 4-3 provides a simple
overview of the sample acquisition process and an overview of the entire firmware
process.
DS50002733B-page 28 2018-2019 Microchip Technology Inc.
Firmware
Start (Power On)
Sample ADC Input
(Standby Mode)
USB Transfer
Commands
Start (Power On)Start (Power On)
Calibrate ADC
(0x70)
Request Device ID
(0x60)
Configure SPI Speed
(0x81)
Request Single Shot
(0x50)
Transfer Data to GUI
(0x80)
ADC Self-Calibration
Self-Calibration
Complete
No
CNVST Rising
Edge Detected
No
Yes
Yes
ADC Input Conversion
CNVST Set to Logic Low
ADC Input
Conversion
Complete
No
Yes
ADC Transmits
Converted Data (SPI)
MCU Receives Incoming
Data (SPI)
Store Incoming Data in
ADC_BUFFER[]
(8192 bytes)
ADC_BUFFER[] Full
No
Transfer
ADC_BUFFER[]
Contents to Storage[]
(262144 bytes)
Yes
> 32768 Bytes
in Storage[]
No
Construct USB Transfer Packet:
(32768 bytes of sampled data +
512 bytes configuration and
settings information)
Yes
USB Transfer
Packet Ready
No
Transmit USB Transfer
Packet to GUI
Yes
Double Buffering
SPI DMA CH1
SPI DPA CH2
Get Calibration Status
(0x71)
ADC Calibrated?
Verify ADC Calibration
[0x71, 0x1] Chip is
Calibrated
[0x71, 0x0] Chip is
Uncalibrated
NoYes
4 Sampling Speeds:
1000 ksps
500 ksps
250 ksps
125 ksps
In this Mode, the Hardware SPI
SPI is Disabled and Switched
to Software SPI with a
Lower Speed.
It will Acquire One Sample and
Enable the Hardware SPI
Again.
512 bytes for
configuration
32768 bytes – samples
33280 bytes USB trans fer packet
FIGURE 4-3:Firmware Flowchart.
4.3USB TRANSFER
The MCU firmware implements a WinUSB device to handle the data transfer between
the USB host (a PC for example) and the USB device (evaluation board).
Each USB transfer has a length of 33280 bytes out of which the first 512 bytes are
configuration and setting bytes. The remaining 32768 bytes will contain samples. This
will require eight logical transfers to be executed (Figure 4-4). The physical USB layer will
split the 33280 byte packets into 512 byte chunks before transmitting on the USB bus.
MCP331X1D 16/14/12-Bit, 1 Msps SAR ADC Evaluation Kit User’s Guide
4.4ADC FUNCTIONS
In addition to the actual sample transfer from MCU to PC, there are other ADC
functions available: Calibration, Read Device ID and Sampling Speed Change.
The PC not only receives data from the EVB, but it also sends 512 bits of data
back to the MCU. The 512-bit length size is required because of the USB
high-speed endpoint size. Out of these, only the first five are meaningful. The
first element, receivedDataBuffer[0], indicates to the MCU the desired function. For
0x80, the MCU will send samples. For 0x81, the transfer is stopped and the MCU RAM
is filled with samples from the ADC. The code will not perform transfers in the same
time as the acquisition of ADC samples.
The calibration function is executed when value 0x70 is received. Calibration status
function has code 0x71. Ta b le 4 - 1 provides the command structure byte values sent to,
and the responses from, the PIC32MZ2048EFM100 on the PIC32MZ EF Curiosity
Development Board (DM320104). Figure 4-5 displays the timing diagram of the
calibration process.
TABLE 4-1:COMMAND STRUCTURE BYTE VALUES
receivedDataB uffe r[x]transmitD ataBu ffer [x]
Command
Byte[0]
Send
Samples
Change
Sampling
Speed
Calibrate ADC 0x70——0x700x01——[0x70, 0x01] – Command received
[0-511] – Irrelevant,
[512-33279] – Data samples,
Combine the read data into a 16b
signed value as follows:
dataH: dataL = read[odd index]:
read[even index]
change transmitDataBuffer[1] = 0x80 to
start sending data
successfully,
[0x70, 0x00] – Error
[0x71, 0x00] – Calibration failed
DS50002733B-page 30 2018-2019 Microchip Technology Inc.
FIGURE 4-5:ADC Calibration.
Firmware
The Read Device ID code is 0x60. In order to retrieve the Chip ID, more Read registers
are required. Figure 4-6 describes the Read register command format.
To retrieve the samples, the GUI will send to the MCU information on the packet
required to be received as an index, which is a number from 0 to 7. This index is sent
to the MCU in receivedDataBuffer[4].
Another function controlled by the GUI is the sampling speed change. There are four
available sampling speeds. These are selected in accordance with the value received
in receivedDataBuffer[3]. The sampling speed is controlled by changing the
prescaler of the reference system clock.