Note the following details of the code protection feature on Microchip devices:
YSTEM
CERTIFIEDBYDNV
== ISO/TS16949==
•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, AnyRate, AVR, AVR logo, AVR Freaks, BeaconThings, BitCloud, CryptoMemory, CryptoRF,
dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KEELOQ, KEELOQ logo, Kleer, LANCheck, LINK MD, maXStylus, maXTouch, MediaLB, megaAVR,
MOST, MOST logo, MPLAB, OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip Designer, QTouch, RightTouch, SAM-BA, SpyNIC,
SST, SST Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered trademarks of Microchip Technology Incorporated in the U.S.A. and
other countries.
ClockWorks, The Embedded Control Solutions Company, EtherSynch, Hyper Speed Control, HyperLight Load, IntelliMOS, mTouch, Precision
Edge, and Quiet-Wire 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, BodyCom, chipKIT, chipKIT logo, CodeGuard,
CryptoAuthentication, CryptoCompanion, CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN,
EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, Mindi, MiWi, motorBench,
MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit,
PICtail, PureSilicon, QMatrix, RightTouch logo, 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.
Silicon Storage Technology is a registered trademark 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.
DS50002322E-page 2 2014 - 2016 Microchip Technology Inc.
Microchip received ISO/TS-16949:2009 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.
®
MCUs and dsPIC® DSCs, KEELOQ
®
code hopping
Page 3
Object of Declaration: MM7150 Motion Module PICtailTM Plus Evaluation Board (#AC243007) with
Explorer 16 Development Board
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 online help files.
®
IDE online help.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
MM7150 Motion Module PICtail
Explorer 16 development board (#DM240001) to run the demo and sample code. Items
discussed in this chapter include:
• Document Layout
• Audience
• Reference Documents
• Glossary
• The Microchip Web Site
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History
DOCUMENT LAYOUT
This document describes how to use the MM7150-PICtail with Explorer 16
Development Board to perform the demo and modify sample code. The manual layout
is as follows:
• Appendix B. “Reference Schematic & Bill of Materials” – Provides
MM7150-PICtail adapter reference schematic & bill of materials information.
• Appendix C. “Extension Cable for Explorer 16” – Provides signals connection
information for building a custom extension cable to use with MM7150-PICtail.
AUDIENCE
This document is written for developers who are familiar with 9-axis motion sensor
applications. The purpose of this document is to describe the functions and use of the
MM7150-PICtail with Explorer 16 Development Board to perform the demos and modify sample code functions as described in the Host API Design for MM7150 Application
Note.
REFERENCE DOCUMENTS
• DS00001885A - SSC7150 Motion Coprocessor Data Sheet
• DS00001888A - MM7150 Motion Module Data Sheet
• DS00001873A - Host API Design for MM7150 Motion Module Application Note
Note:Please contact your Microchip representative for the above documents and
availability.
Preface
GLOSSARY
This section describes glossary terms and acronyms used in this document.
TERMDEFINITION
EVBEvaluation Board
HIDHuman Interface Device
2
I
CInter-Integrated Circuit
USBUniversal Serial Bus
ECEmbedded Controller
SFSensor Fusion
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
MM7150 Motion Module PICtailTM Plus Evaluation Board (#AC243007)
with Explorer 16 Development Board User’s Guide
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip
products. Subscribers will receive e-mail notification whenever there are changes,
updates, revisions or errata related to a specified product family or development tool of
interest.
To register, access the Microchip web site at www.microchip.com, click on Customer
Change Notification and follow the registration instructions.
The Development Systems product group categories are:
• Compilers – The latest information on Microchip C compilers, assemblers, linkers
and other language tools. These include all MPLAB C compilers; all MPLAB
assemblers (including MPASM assembler); all MPLAB linkers (including MPLINK
object linker); and all MPLAB librarians (including MPLIB object librarian).
• Emulators – The latest information on Microchip in-circuit emulators.This
includes the MPLAB REAL ICE and MPLAB ICE 2000 in-circuit emulators.
• In-Circuit Debuggers – The latest information on the Microchip in-circuit
debuggers. This includes MPLAB ICD 3 in-circuit debuggers and PICkit 3 debug
express.
• MPLAB IDE – The latest information on Microchip MPLAB IDE, the Windows
Integrated Development Environment for development systems tools. This list is
focused on the MPLAB IDE, MPLAB IDE Project Manager, MPLAB Editor and
MPLAB SIM simulator, as well as general editing and debugging features.
• Programmers – The latest information on Microchip programmers. These include
production programmers such as MPLAB REAL ICE in-circuit emulator, MPLAB
ICD 3 in-circuit debugger and MPLAB PM3 device programmers. Also included
are nonproduction development programmers such as PICSTART Plus and
PIC-kit 2 and 3.
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://www.microchip.com/support
DS50002322E-page 8 2014 - 2016 Microchip Technology Inc.
Page 9
DOCUMENT REVISION HISTORY
RevisionCorrection
DS500002322E (11-18-16)
DS500002322D (08-18-15)
DS500002322C (07-02-15)
DS50002322B (02-18-15)
DS50002322A (11-07-14)Initial Release
• Updated information for sample code version 1.4.0
• Removed PIC24 Legacy PLib and replace with MCC
• Added section 3.5.3 for Flash Corruption Recovery
• Added Acc Range 4G/8G/16G configuration in section 3.5.2
• Updated information for sample code version 1.3.4
1.3HARDWARE CONNECTIONS FOR MM7150-PICTAIL TO EXPLORER 16
BOARD
Note:Before attempting to connect the MM7150-PICtail with PICtail™ Plus Edge
connector module to the Explorer 16 board, it is crucial that the power supply to the Explorer 16 be disconnected. Failure to do so may damage the
MM7150 Motion Module.
1.3.1Direct Plug-In
The MM7150-PICtail can be installed directly into the Explorer 16 Board. Insert the
MM7150-PICtail into the PICtail™ header J5 with pin 1 of the module lining up with pin
1 of the header, as seen in Figure 1-1.
FIGURE 1-1:DIRECT CONNECTION OF MM7150-PICTAIL TO THE EXPLORER 16 PICTAIL™
HEADER.
1.3.2Using Extension Cable
The MM7150-PICtail motion module can be connected to the Explorer 16 development
board via a custom extension cable. Using an extension cable will allow freedom of
movement compared with directly inserting the MM7150-PICtail board into the PICtail
header on the Explorer 16 board.
Please see Appendix C. “Extension Cable for Explorer 16” for more information.
MM7150 Motion Module PICtailTM Plus Evaluation Board (#AC243007)
with Explorer 16 Development Board User’s Guide
• With Explorer 16 power applied, make the project and download to Explorer 16
flash as shown in Figure 2-4:
FIGURE 2-4:SELECT DOWNLOAD OPTION
• Output screen during build process as shown in Figure 2-5:
FIGURE 2-5:BUILD PROCESS OUTPUT
DS50002322E-page 14 2014 - 2016 Microchip Technology Inc.
Page 15
Chapter 3. Demo Setup
3.1RUNNING THE MOTION DEMO
Note:Using a debugger will necessitate cycling power to the connected
MM7150-PICtail to reset its onboard EC (embedded controller). The easiest way to accomplish this while debugging code is to remove/install power
to the Explorer 16 Development board with the MM7150-PICtail installed in
J5 header. DO NOT attempt to unplug the MM7150-PICtail while power is
applied to it through its connection to the Explorer 16 Development board.
This can cause a power spike to the MM7150-PICtail and cause it to
become inoperative.
Once the program has been built and downloaded/programmed successfully to
Explorer 16 Flash, the user should observe a sequence of LED flashes on the Explorer
16 board’s LED panel.
The user should then observe the following message on the Explorer 16 board’s LCD
screen:
MM7150 Demo v140
Select mode:
Additionally the following message will appear in the serial terminal window on the connected computer:
MM7150 MOTION MODULE PICTAIL
(TM)
PLUS
EVALUATION BOARD (#AC243007)
WITH EXPLORER 16 DEVELOPMENT BOARD
USER’S GUIDE
Note:Beginning with revision 1.3.4 of the sample code, the build number of the
firmware currently loaded on the SSC7150 device is displayed (as shown).
Once this message has been displayed, the user can begin navigating the user menu
using the Explorer 16 push buttons (S3/S6/S5/S4). The buttons are coded as follows:
FIGURE 3-2:MM7150-PICTAIL ON EXP16 OVERVIEW
As the UP/DOWN buttons are pressed, the Explorer 16 LCD screen will refresh and
change the position of the selection cursor (“>") to a list of available sensor types. The
output to the serial monitor will also change to indicate the current sensor type which
can be selected by pressing the (S5) SELECT button. Once the user selects a sensor
from the menu, the sensor data output will be displayed and updated on both the LCD
and serial monitor.
3.2CALIBRATING SENSORS
3.2.1Calibration Mode
In order for the sensors to function properly and indicate accurate data the user will
need to calibrate the MM7150 each time power has been removed. This calibration is
done by selecting the “Calibration” mode as shown in Figure 3-3, holding the
MM7150-PICtail which is attached via an extension cable (see Appendix C. “Extension
Cable for Explorer 16” for more information), or if not using an extension cable, by hold-
ing the entire Explorer 16 board with MM7150-PICtail installed, and moving it through
space a few times (~ 5 seconds) to make an “infinity” symbol or a “figure 8”.
DS50002322E-page 16 2014 - 2016 Microchip Technology Inc.
Page 17
FIGURE 3-3:CALIBRATION MODE
Demo Setup
3.2.2
One-time Calibration Mode
Calibration of sensors is based on magnetic fields and magnetic flux present at the time
of calibration. In the event that the MM7150-PICtail was factory calibrated in a part of
the world where the magnetic flux differs significantly from its present location, the
one-time calibration may be useful. One-time calibration is similar to normal calibration
with one distinct difference, the final calibration will be save to NVM (Non-Volatile-Memory) upon completion.
CAUTION: Although one-time calibration appears to be a viable solution to the normal
“quick” calibration each time power is removed from the MM7150-PICtail, extreme caution must be exercised in the use of the one-time calibration. The MM7150-PICtail, like all
devices containing flash memory, has a limited life-cycle for updating flash memory. It is
strongly recommended that the one-time calibration is only used for cases where the
MM7150-PICtail’s calibration is drastically inaccurate due to magnetic field conditions
that are vastly different in new locations. Even in such cases, the one-time calibration
and update to NVM should be used “sparingly”.
Note:One-time calibration requires sleep/wake cycle in order to affect the
changes to NVM. The HOST_TO_SH_WAKE signal MUST be provided if
using an Exp16 to MM7150-PICtail extension cable.
The one-time calibration can only be completed if the NVM (Non-Volatile Memory)
update flag has not been set for the current power cycle. If the NVM update flag is
already set the only recourse is to Power-On Reset (POR) the Explorer16 with connected MM7150-PICtail.
FIGURE 3-4:ONE-TIME CALIBRATION - NVM UPDATE FLAG IS SET
Press push-button S4 to start calibration. Similar to the “normal” calibration the
MM7150-PICtail is moved through space in a figure-8 to facilitate calibration. For this
mode the program will collect calibration data for at least 5 seconds and then check that
the “high accuracy” flag has been set. Once this state has been achieved, the
MM7150-PICtail is put to sleep and wakes in order to save the calibration settings to
NVM
FIGURE 3-6:ONE-TIME CALIBRATION COMPLETED
DS50002322E-page 18 2014 - 2016 Microchip Technology Inc.
Page 19
3.3SENSOR DATA DISPLAY
Demo Setup
Once calibrated the active sensors on the MM7150 motion module will send updates
to the PIC24 on the Explorer 16 board running the application program via I
2
C in the
form of HID packets including all relevant dimensions of data to be retrieved from the
device. These sensor readings will be displayed on the LCD (as well as the COM port
in a ‘linear’ formatting):
1D data
3D data
4D data:
: 79.0
: X: 50.3Y: 75.6Z: -32.9
X: 1.021Y:-.642Z:-.458W: .348
Note:Significant digits will vary based on resolution of specific sensor. This reso-
lution can be determined by the unit exponent scaling factor. Serial data will
always be displayed to 3 significant digits.
Sample output to COM port running Tera Term serial emulator:
FIGURE 3-7:DISPLAY INCLINOMETER DATA
The sensor data is updated to the display every time a data register has changed since
the previous update.
3.4SLEEP/WAKE
The MM7150 motion module can be set to enter deep sleep to achieve its lowest power
consumption. In the Explorer 16 sample code this can be accomplished by selecting
the SLEEP command from the main menu. The Explorer 16 host will send a POWER_OFF command through the I
MM7150 motion coprocessor is halted and the I
Select the WAKE command from the Explorer 16 main menu to wake the MM7150
motion module. This command will toggle the HOST_TO_SH_WAKE signal to alert the
MM7150 to wake, send the POWER_ON command via I
required time to allow the MM7150 to fully wake and allow sensor activity to resume.
C interface. As a result of this SLEEP command the
2
C interface is stopped.
2
C interface, and wait the
Page 20
MM7150 Motion Module PICtail
(TM)
Plus Evaluation Board (#AC243007)
with Explorer 16 Development Board User’s Guide
The sleep/wake process requires that certain timing constraints must be observed
(shown below in Figure 3-1).
TABLE 3-1:SLEEP / WAKE TIMING CONSTRAINTS
Delay periodReason
1Required delay between sending the SLEEP
command & toggling WAKE
2Required delay between toggling (3 µs min) the
wake signal and sending power ON command
3Required delay between D3 wake and enumer-
ation sequence start
3.5FLASH UPDATE
The MM7150 motion module firmware can be updated with the appropriate binary
image (please refer to Section 2.1 “Software/Firmware requirements” for more informa-
tion) by selecting Flash Update from the Explorer 16 main menu. The Explorer 16 sample code will reset the MM7150 module into a state able to accept the new binary
image, download and CRC-check a valid binary image, program new MM7150 firmware binary via I
Note:The Explorer 16’s UART connection will be used to download the flash
2
C interface, and finally perform image verification.
update binary and, as such, must be connected to a HOST PC running a
terminal emulator (such as Ter a Ter m as described in
Section 1.2 “Preparing the Explorer 16 Development Board”).
70msThis is required for the coefficient write
in flash during D3 plus other housekeeping activities to go into D3 state
11msThis is required for clock source
switching after coming out of D3 state
30msThis is required for sensor initialization
after D3 state
3.5.1
Flash Update command
Figure 3-8 shows the Flash Update Command from the Exp 16 sample code select
menu.
FIGURE 3-8:FLASH UPDATE COMMAND
DS50002322E-page 20 2014 - 2016 Microchip Technology Inc.
Page 21
Select “File->Send file…” from Tera Term utility (NOTE: Select Binary Option).
Selection of the Flash Update mode will require cycling power to the Explorer 16 (and
attached MM7150-PICtail) regardless if the flash update procedure is successful,
aborted, or an error is encountered. Initial setup for this flash update sequence
requires the MM7150 to enter "BootLoader" mode from which normal operation is not
possible, therefore a POR to the MM7150-PICtail is required.
3.5.2
Flash Configuration Update Command
The X/Y/Z orientation of the MM7150 module on the customer’s design can be modified
and saved to the MM7150’s flash. The default orientation of the A/M/G sensors of
MM7150 (placed horizontally) is:
DS50002322E-page 22 2014 - 2016 Microchip Technology Inc.
Page 23
Demo Setup
For this case, the inputs to the motion algorithm (running in MM7150 firmware) can be
represented by the following 3x3 matrix (Accelerometer for example):
So, for the horizontal orientation shown above and assuming that X/Y/Z are data read
from the hardware sensor and X’/Y’/Z’ are data input to the motion algorithm:
X’ = A00*x + A01*y + A02*z
Y’ = A10*x + A11*y + A12*z
Z’ = A20*x + A21*y + A22*z
Since the input matrix corresponds one to one in X/Y/Z to the output matrix, we obtain
the following:
X’ = 1*x + 0*y + 0*z
Y’ = 0*x + 1*y + 0*z
Z’ = 0*x + 0*y + 1*z
i.e. Resulting matrix[3, 3] = [1,0,0; 0,1,0; 0,0,1;]
This orientation configuration data must be sent to the appropriate sector in the
MM7150 firmware in the following format:
TABLE 3-2:CONFIGURATION DATA FORMAT FOR HORIZONTAL
For MM7150_Exp16_Sample_Code_v1.4.0, the flash configuration data needs to be in
the following binary file format (derived from the above text file):
FIGURE 3-12:CONFIGURATION DATA BINARY FOR HORIZONTAL
Similarly, for the A/M/G sensors of the MM7150 placed vertically (such as when
plugged into the Explorer 16 card):
DS50002322E-page 24 2014 - 2016 Microchip Technology Inc.
Page 25
Demo Setup
For the vertical orientation shown above and assuming that X/Y/Z are data read from
the hardware sensor and X’/Y’/Z’ are data input to the motion algorithm with respect to
the default X/Y/Z settings:
X’ = A00*x + A01*y + A02*z
Y’ = A10*x + A11*y + A12*z
Z’ = A20*x + A21*y + A22*z
Since, for this case, the input matrix does not correspond one to one in X/Y/Z to the
output matrix, we obtain the following translations:
X’ = 1*x + 0*y + 0*z
Y’ = 0*x + 0*y - 1*z
Z’ = 0*x + 1*y + 0*z
i.e. Resulting matrix[3, 3] = [1,0,0; 0,0,-1; 0,1,0;]
This vertical configuration data can be sent to the appropriate sector in the MM7150
firmware in the following format:
TABLE 3-3:CONFIGURATION DATA FORMAT FOR VERTICAL
NameValues
HeaderA5A5A5A5
Serial_num00000000
ACC_matrix0100000000FF000100
MAG_matrix0100000000FF000100
GYR_matrix0100000000FF000100
Reserved00
ACC_config01010110
MAG_config02010112
GYR_config03010168
Reserved04010144
Reserved05010177
Reserved06000000
Reserved07000000
Reserved08000000
Reserved09000000
ACC_range00030000 (see Note 1)
Chk_sum16070000 (see Note 2)
PaddedFF’s for 128 byte package
For MM7150_Exp16_Sample_Code_v1.4.0, the flash configuration data must adhere
to the following binary file format:
FIGURE 3-13:CONFIGURATION DATA BINARY FOR VERTICAL
Using the sample code’s Flash Configuration Update mode:
FIGURE 3-14:FLASH CONFIGURATION DATA MODE
Select “File->Send file...” from TeraTerm utility: (NOTE: Select Binary Option).
DS50002322E-page 26 2014 - 2016 Microchip Technology Inc.
Page 27
FIGURE 3-15:SELECT BINARY FILE
Demo Setup
Select “Open” to download binary file to flash.
Following successful completion of the flash configuration update procedure (or if any
error is encountered), the Explorer 16 must be power cycled (POR).
Note:Should an issue arise due to incorrect formatting of binary data, the
MM7150 Flash can be restored using the Flash Update command in
If flash update was not completed in an orderly manner, the flash ROM in SSC7150
may be corrupted. For example, when the power is down while the flash update is in
progress. In such case, the SSC7150 will power up into a boot loader mode when the
flash ROM is corrupted. The sample code has a capability to detect the boot loader
mode and re-flash the firmware binary to recovery the device.
At boot, if the boot loader mode is detected, then the flash update function runs automatically. The user can select and download the firmware binary file as described in
Section 3.5.1 “Flash Update command” to recover from the flash corruption state.
DS50002322E-page 28 2014 - 2016 Microchip Technology Inc.
Page 29
FIGURE 3-17:BOOTLOADER MODE
Demo Setup
3.6FREEFALL MODE
Free-fall detection by the MM7150 at the present time is not supported in the MM7150
firmware. Included in the Explorer16 with MM7150 sample code version 1.3.4 is a software solution to demonstrate free-fall detection of the MM7150.
Free-fall is the acceleration of a device due to the effects of gravity. The simplest type
of free-fall is “linear” free-fall wherein the orientation of the device remains constant
along its three axes as it moves or falls. Output from the accelerometer is based on the
effects (or acceleration) of gravity. The accelerometer is used to detect when a device
is free-falling. Starting from a stationary or static orientation, a device will have X=0g,
Y=0g, and Z =-1g accelerometer readings. The X and Y 0g readings occur because
these vectors are perpendicular to gravity and thus gravity has no effect on them. However, for the Z = -1g reading, the 1g is due to the Z axis or vector being parallel to the
gravity component acting on the device in the downward direction and “-“ refers to the
direction opposite the effect of gravity.
For example, a MM7150-PICtail with a horizontal configuration (stored in flash, see
Section 3.5.2 “Flash Configuration Update Command”) is held in a static horizontal
position then the X,Y, and Z components (of acceleration) are found to be: X=0, Y=0,
Z=-1. (Refer to Figure 3-18 below, X = 0g because this vector is perpendicular to gravity, so also for Y = 0g. Z = -1g because its axis is parallel and opposite the direction of
gravity.) When the MM7150-PICtail device is dropped, and considering linear free-fall
only, all three axes will converge to ideally 0g.
FIGURE 3-18:MM7150 IN HORIZONTAL POSITION (GRAVITY IN NEGATIVE Z-AXIS)
For the sample code demonstration, the accelerometer is configured for maximum sensitivity (= 0) and data rate (=10 ms). In order to achieve a data rate = 10 ms per sample,
the output to the UART and LCD screens, which cause a viable delay during output display, are disabled temporarily while the accelerometer data is collected. An extension
cable must be used (see Appendix C. “Extension Cable for Explorer 16”) for the
Explorer 16 to MM7150-PICtail in order to drop the device onto a soft landing surface.
It is virtually impossible to preserve the orientation of the MM7150-PICtail (i.e. prevent
it from tilting, rotating, or spinning) during the fall without a specialized test setup so the
sample code factors-in an offset for the X,Y, and Z readings during the collection of the
accelerometer data. When the X, Y, and Z readings are within the expected range, all
approaching zero, and continue for successive readings, free-fall is determined to be
occurring. Free-fall can be detected at heights above ~1” from the soft landing pad.
Impact with the landing pad will also be determined by observing accelerometer readings in excess of 1g.
DS50002322E-page 30 2014 - 2016 Microchip Technology Inc.
Page 31
FIGURE 3-19:FREE FALL DETECTION MODE
The data logging begins when the first X,Y,Z readings are below the expected threshold
and all approaching zero. The “free-falling” determination is made if two successive
readings are within the predetermined range. Any discrepancies in the data logging are
due to changes in orientation of the MM7150-PICtail device as it falls. Finally, as seen
in Figure 3-20, “impact” with the “ground” or landing pad is also determined.
This chapter describes troubleshooting potential issues and fixes.
4.1FAILURE TO DISPLAY WELCOME SCREEN
If the welcome message fails to display on the Explorer 16 LCD screen and error messages depicted below appear in the debugger’s output (using Microchip ICD3 or REAL
ICE debugger for instance), the most likely cause is a failure to disconnect and reconnect power to the MM7150-PICtail. This is accomplished by disconnecting and reconnecting power to the Explorer 16 board before restarting the demo. This process serves
as a ‘hard reset’ for the SSC7150 on the MM7150-PICtail, allowing I
to reinitialize and restart.
FIGURE 4-1:ERROR MESSAGE IN DEBUGGER’S TAB
USER’S GUIDE
2
C communication
Note:If user is running on a different debugger (eg: ICD3, Real ICE etc.) the mes-
Note:Please refer to “DS00001873A - Host API Design for MM7150-PICtail
VREG functions which fail to complete due to certain hardware events may display
error information via error handling output on the Explorer 16 board’s LCD screen and
on the serial terminal window on the connected computer.
For example, in the case of a VREG Read operation of register 16h which encounters
a problem while reading data in response to receiving a HIDI2C_HOST_INT (which
indicates that a MM7150 sensor has data available) the following will be displayed on
the Explorer 16 board’s LCD:
where:
VRRd:16 - Attempting a VREG Read operation on register 16h (VREG ACXD register)
err=0x31 – Error code generated (see error code definitions in Section 4.2.3)
Push S5 to cont - Press button S5 to attempt to recover from the reported error
The same error is displayed on the serial terminal window on the connected computer:
Troubleshooting
Motion Module Application Note” for more information regarding virtual registers (VREG) defined and used in the sample code.
VRRd:16 err=0x31
Push S5 to cont
FIGURE 4-3:SERIAL TERMINAL GENERAL ERROR HANDLING DISPLAY
TABLE 4-1:GENERAL ERROR HANDLER FUNCTION ABBREVIATION
MM7150 Motion Module PICtailTM Plus Evaluation Board (#AC243007)
with Explorer 16 Development Board User’s Guide
4.2.2I
Upper level functions which employ I2C function calls for the Explorer 16 board’s PIC24
to MM7150 interface that fail to complete will display error information. The I
2
C Error Handling
2
C error
handling display is output on the Explorer 16 board’s LCD screen and on the serial terminal window on the connected computer.
Note:Most, if not all, I
specific to the PIC24 on the Explorer 16 board, I
as an error to illustrate where the issue was encountered. For this demo, in
the rare event that a fully functional I
2
C errors are hardware dependent. As this sample code is
2
C interface encounters an error, the
2
C errors are simply flagged
error “recovery” method will require resetting the Explorer 16 board and,
hence, the connected MM7150-PICtail.
For example, in the case of an i2cIO operation which encounters an issue, wherein the
MM7150 fails to ACK properly, the following will be displayed on the Explorer 16
board’s LCD:
i2c error=0x29
POR Exp16 Board
where:
i2c - error occurred in i2cIO() function
error=0x29 – error code generated (see error code definitions in Section 4.2.3)
POR Exp16 Board - Power On Reset Explorer 16 board (and connected
MM7150-PICtail)
The same error is displayed on the serial terminal window on the connected computer:
TABLE A-1:DIRECTORY STRUCTURE OF THE SENSOR FUSION SAMPLE CODE
FilesDescription
\source\headers\app.hInclude for all other underlying h files and typedefs
\source\headers\err.hFunctions and parameters for error handling
\source\headers\flash_update.hFunctions for flash update
\source\headers\i2cIO.hFunctions and parameters specific to I
with MM7150 module
\source\headers\lcd.hFunctions relevant to LCD operation
\source\headers\sf.hFunctions relevant to decoding and encoding HID com-
mands and packets
\source\headers\system.hFunctions relevant to running the demo
\source\headers\vregs.h
Functions relevant to the creation of the virtual register
layer of the MM7150 API library
\source\src\err.c
\source\src\flash_update.c
\source\src\i2cIO.c
\source\src\lcd.c
\source\src\mmain.c
Error handling functions for I
Functions for flash update.
Functions to communicate with MM7150 Module via
2
I
C
LCD support for Explorer 16 board
Functions to setup Explorer 16 board environment,
2
C and VREG operations
COM port UART2, interrupts, timers, I
HID_initialization, start HID handshaking with EC via
2
I
C commands
\source\src\sf.c
Functions to get HID tables from MM7150 Module,
send power and reset HID commands, get HID report
descriptors, parse descriptors, get input from sensor
devices
\source\src\system.c
Initiates the motion demo by configuring LED’s, LCD,
Serial, and buttons
DS50002322E-page 41 2014 - 2016 Microchip Technology Inc.
MM7150 Motion Module PICtail
with Explorer 16 Development Board User’s Guide
TM
Plus Evaluation Board (#AC243007)
Page 42
MM7150 MOTION MODULE PICTAILTM PLUS
EVALUATION BOARD (#AC243007)
WITH EXPLORER 16 DEVELOPMENT BOARD
USER’S GUIDE
Appendix C. Extension Cable for Explorer 16
Please refer to MM7150-PICTail Reference Schematic (B.1.2 “Reference Sche-
matic”) and create an extension cable of up to 20” (with proper shielding) for ease of
motion during calibration.
Note:Per industry data, I2C bus at 400KHz without buffer can have length up to
2 meters with limiting factor of wiring capacitance. Designers should take
this into consideration if planning to build longer extension cable which is
out of scope of this user’s guide.
C.1SIGNALS CONNECTION
TABLE C-1:CONNECTION SUMMARY BETWEEN MM7150 TO EXP16 BOARD