2 2 Programming the Sensor Toolbox Hardware The following items are required to program the sensor toolbox hardware: A PE Micro USB multilink device capable of programming HCS08 targets. Freescale CodeWarrior for Microcontrollers v6.2 or higher. This project was developed with CodeWarrior for Microcontrollers v6.2 which has the classic IDE environment. The project can be imported into the newer CodeWarrior for Microcontrollers v10.x releases which have the Eclipse environment utilizing the CodeWarrior Classic Project Importer feature (File > Import ). Please see corresponding documentation and help for details. The following steps are necessary for programming the sensor toolbox board using CodeWarrior for Microcontrollers v Connect the sensor toolbox board to the host PC using the USB cable included in the kit. For most cases, the FTDI drivers will be installed automatically. If a driver cannot be found by Windows go to to download them. 2. Connect the PE Micro multilink device to the host PC. If this is the first time the device is connected to the PC, the drivers will be installed automatically. 3. Connect the PE Micro multilink device to the sensor toolbox board using the 6-pin ribbon cable attached to the multilink. Figure 1. PE Micro multilink and sensor toolbox board 4. Turn the board on using the ON/OFF switch. The red LED light will turn on indicating that the board is powered up. 2 Freescale Semiconductor, Inc.

3 5. Start CodeWarrior and open the project file with *.mcp extension. Debug Icon Figure 2. FXOS8700CQ command line interface project inspector window 6. Click on the green Debug icon for debugging to flash program on to the board. Freescale Semiconductor, Inc. 3

4 7. Click the Connect (Reset) button in the initial dialog window. Figure 3. PEMICRO Connection Manager window NOTE Keep in mind that this dialog may not appear depending on the state of the microcontroller prior to launching the debugger. 8. Click Yes to erase and flash the program in the next dialog window. Once programming is completed, close the debugger and CodeWarrior, and power down the sensor toolbox board using the ON/OFF switch. The command line interface program is now ready to be executed once the sensor toolbox board is powered up again. Figure 4. Erase and Program Flash window 4 Freescale Semiconductor, Inc.

6 Once the terminal program is set up as specified, press the Enter key; this will result in the displaying of the program header which indicates the compile date and time of the firmware image firmware revision number detected iic address and whoami of the sensor on board the details of the operating mode of the device followed by the command prompt. Pressing the Enter key after the startup of the program will generate an output similar Example 1. ** Freescale Semiconductor ** ** FXOS8700CQ Demo ** ** using the MC9S08QE8 ** ** ** ** Aug :42:43 ** Example 1. Command Line Interface Software Revision: 1.00 This version of command line interface does not support external flash FXOS8700CQ : IIC Address = 0x1E, WhoAmI = 0xC7 Operating Mode = Hybrid (Accel+Mag), ACTIVE, ODR = 50Hz, Hybrid auto inc = ON, Mag OSR = 16, Accel OSR = Normal, HP = 2Hz, Accel FSR = 2g 6 Freescale Semiconductor, Inc.

11 4.4 Display XYZ Data as Signed Counts (CN) This command displays the sensor data from a single acquisition cycle from enabled sensors. If device is in Hybrid (Accel+Mag) mode XYZ data from both sensors will be displayed. If device is in Accel Only or Mag Only mode, then XYZ data from a single sensor will be displayed accordingly. Format CN<ENTER> Input Parameter(s) None Output XYZ data will be displayed based on current configuration. Acceleration data will be in the range [-8192,+8191]. Magnetometer data will be in the range [-32768,32767]. Example 7. Display Sensor Data as Signed Counts sample output CN Xacc=-00770;Yacc=-00040;Zacc=+04136;Xmag=-00502;Ymag=-00677;Zmag= Freescale Semiconductor, Inc. 11

12 4.5 Display XYZ Data as Signed Counts, with HPF Enabled (CH) Identical to Section 4.4 except accelerometer data is fed through a high-pass filter before being displayed. Please note that the high-pass filter may only be applied to the accelerometer data. This command displays sensor data from a single acquisition cycle from enabled sensors. If device is in Hybrid (Accel+Mag) mode XYZ data from both sensors will be displayed. If device is in Accel Only or Mag Only mode, then XYZ data from a single sensor will be displayed accordingly. Format CH<ENTER> Input Parameter(s) None Output XYZ data will be displayed based on current configuration. Acceleration data will be in the range [-8192,+8191]. Magnetometer data will be in the range [-32768,32767]. Example 8. Display sensor data as counts, with HPF enabled CH ******************************************************************* * WARNING - HPF requires samples to settle after an activation * ******************************************************************* Xacc=-00008;Yacc=-00004;Zacc=-00012;Xmag=-00494;Ymag=-00660;Zmag= Freescale Semiconductor, Inc.

13 4.6 Display XYZ Data in Signed Units (GN) This command displays sensor data from a single acquisition cycle from enabled sensors. If device is in Hybrid (Accel+Mag) mode XYZ data from both sensors will be displayed. If device is in Accel Only or Mag Only mode, then XYZ data from a single sensor will be displayed accordingly. Format GN<ENTER> Input Parameter(s) None Output XYZ data will be displayed based on current configuration. Data read from the sensors will be converted to g and µt units for acceleration and magnetic field respectively. Acceleration data will be in the range as specified in Accel FSR (for Accel FSR = 2g, in the range [ g, g]). Magnetometer data will be in the range [ µt, µt]. Example 9. Display Sensor Data in Signed Units output sample GN Xacc= g;Yacc= g;Zacc= g;Xmag=-00047uT;Ymag=-00063uT;Zmag=-00023uT Freescale Semiconductor, Inc. 13

14 4.7 Display XYZ Data in Signed Units, with HPF Enabled (GH) Identical to Section 4.6 except accelerometer data is fed through a high-pass filter before being displayed. Please note that the high-pass filter may only be applied to the accelerometer data. This command displays sensor data from a single acquisition cycle from enabled sensors. If device is in Hybrid (Accel+Mag) mode XYZ data from both sensors will be displayed. If device is in Accel Only or Mag Only mode, then XYZ data from a single sensor will be displayed accordingly. Format GH<ENTER> Input Parameter(s) None Output XYZ data will be displayed based on current configuration. Data read from the sensors will be converted to g and µt units for acceleration and magnetic flux density respectively. Acceleration data will be in the range as specified in Accel FSR (for Accel FSR = 2 g, in the range [ g, g]). Magnetometer data will be in the range [ µt, µt]. Example 10. Display Data in Signed Units, with HPF Enabled sample output GH ******************************************************************* * WARNING - HPF requires samples to settle after an activation * ******************************************************************* Xacc= g;Yacc= g;Zacc= g;Xmag=-00046uT;Ymag=-00059uT;Zmag=-00020uT 14 Freescale Semiconductor, Inc.

15 4.8 Stream XYZ Data by Polling (S) Stream sensor XYZ data (by polling). The characteristic of the streamed data will be the same as the output generated by one of the four display commands explained above in Section 4.4 through 4.7; this will be specified via the aa parameter of this command. NOTE Streaming data is not recommended for ODR settings faster than 100 Hz in Hybrid (Accel+Mag) mode and faster than 200 Hz in Accel Only and Mag Only modes due to the limitations of the serial port. Streaming faster than recommended may lead to missed samples. Press <ENTER> to stop streaming at any time. This command will disable all interrupt sources routed to pins INT1 and INT2. It will put the device in ACTIVE mode if it is not in ACTIVE mode already. Format S aa<enter> Input Parameter(s) aa: CN or CH or GN or GH Output Data will be streamed based on command parameter and current configuration. S CN Example 11. Stream Data by Polling sample output *Recommended Streaming ODR<=100Hz for HYBRID mode,* *ODR<=200Hz for Mag Only or Accel Only modes* - Streaming XYZ data as signed counts Xacc=-00096;Yacc=+00020;Zacc=+04104;Xmag=-00353;Ymag=+00088;Zmag= Xacc=-00102;Yacc=+00036;Zacc=+04108;Xmag=-00360;Ymag=+00092;Zmag= Xacc=-00098;Yacc=+00026;Zacc=+04076;Xmag=-00360;Ymag=+00098;Zmag= Xacc=-00110;Yacc=+00030;Zacc=+04110;Xmag=-00372;Ymag=+00109;Zmag= Xacc=-00096;Yacc=+00026;Zacc=+04122;Xmag=-00354;Ymag=+00082;Zmag= Xacc=-00102;Yacc=+00026;Zacc=+04078;Xmag=-00341;Ymag=+00081;Zmag= Xacc=-00108;Yacc=+00026;Zacc=+04062;Xmag=-00362;Ymag=+00108;Zmag= Xacc=-00100;Yacc=+00018;Zacc=+04088;Xmag=-00360;Ymag=+00099;Zmag= Xacc=-00106;Yacc=+00030;Zacc=+04096;Xmag=-00357;Ymag=+00089;Zmag= Xacc=-00108;Yacc=+00030;Zacc=+04090;Xmag=-00357;Ymag=+00106;Zmag= Xacc=-00102;Yacc=+00028;Zacc=+04084;Xmag=-00372;Ymag=+00106;Zmag= Xacc=-00103;Yacc=+00034;Zacc=+04110;Xmag=-00361;Ymag=+00104;Zmag= Xacc=-00106;Yacc=+00023;Zacc=+04108;Xmag=-00349;Ymag=+00100;Zmag= Xacc=-00098;Yacc=+00020;Zacc=+04128;Xmag=-00359;Ymag=+00105;Zmag= Xacc=-00096;Yacc=+00045;Zacc=+04088;Xmag=-00362;Ymag=+00112;Zmag= Freescale Semiconductor, Inc. 15

17 4.10 Stream XYZ Data via the FIFO Buffer (F) This command streams sensor XYZ data (via the FIFO buffer). The characteristic of the streamed data will be the same as the output generated by one of the four display commands explained above in Section 4.4 through 4.7; this will be specified via the aa parameter of this command. Format F aa ww<enter> Input Parameter(s) NOTE Streaming data is not recommended for ODR settings faster than 100 Hz in Hybrid (Accel+Mag) mode and faster than 200 Hz in Accel Only and Mag Only modes due to the limitations of the serial port. Streaming faster than recommended may lead to missed samples. Press <ENTER> to stop streaming at any time. This command will enable the FIFO interrupt on INT2 pin as push-pull, active low and disable all other interrupt sources. It will put the device in ACTIVE mode if it is not in ACTIVE mode already. aa: CN or CH or GN or GH, specifying the data format for streaming. ww: 1-31 samples per FIFO acquisition, utilizing the watermark detection feature. 0 for filling the whole buffer, utilizing the overflow detection feature. Output Data will be streamed based on command parameter and current configuration. Freescale Semiconductor, Inc. 17

19 5 Recovering the Bootloader for Sensor Toolbox In the zipped file, AN4460SW.zip, in the directory named Bootloader, there is an s19 image file named Bootloader.s19. This image must be programmed into the flash memory of the microprocessor on the sensor toolbox board in order to use with the PC software. The following steps recover the bootloader using CodeWarrior v6.x. NOTE For instructions using CodeWarrior v10.x, go to Start > Programs > Freescale CodeWarrior > CW for MCU v10.x > Documentation. On the webpage that opens up click on the FAQ Guide link and search for How can I flash or download a binary file to the target in the FAQ document. 1. Go to the following path C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.2\prog NOTE Note that actual path may be different depending on where the application is installed on host PC. 2. Double-click on the file hiwave.exe., this will initiate the True-Time Simulator & Real-Time Debugger as shown in Figure 6. If the Connection Manager window (Figure 3 on page 4) appears, click Abort. Figure 6. True-Time Simulator and Real-Time Debugger Freescale Semiconductor, Inc. 19

21 Figure 8. Load Executable File 6. Click on Open. In the next prompt window, click Yes (Figure 4 on page 4). A window will display information about the programming process. Once complete, the window shown in Figure 6 will remain. The bootloader is now programmed into the flash memory of the microprocessor on the sensor toolbox board. Disconnect the PE Micro device from sensor toolbox board and switch off and on the power prior to using the board with sensor toolbox PC software. Freescale Semiconductor, Inc. 21

22 How to Reach Us: Home Page: freescale.com Web Support: freescale.com/support Information in this document is provided solely to enable system and software implementers to use Freescale products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. Freescale reserves the right to make changes without further notice to any products herein. Freescale makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters that may be provided in Freescale data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including typicals, must be validated for each customer application by customer s technical experts. Freescale does not convey any license under its patent rights nor the rights of others. Freescale sells products pursuant to standard terms and conditions of sale, which can be found at the following address: freescale.com/salestermsandconditions. Freescale, the Freescale logo, AltiVec, C-5, CodeTest, CodeWarrior, ColdFire, C-Ware, Energy Efficient Solutions logo, Kinetis, mobilegt, PowerQUICC, Processor Expert, QorIQ, Qorivva, StarCore, Symphony, and VortiQa are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Airfast, BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, MagniV, MXC, Platform in a Package, QorIQ Qonverge, QUICC Engine, Ready Play, SafeAssure, SMARTMOS, TurboLink, Vybrid, and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners Freescale Semiconductor, Inc. Document Number: AN4460 Rev. 1 04/2013

www.freescale.com/frdm-kl46z These documents are available as part of the Quick Start Package: Name Type Description Quick Start Guide PDF This document OpenSDA Applications Folder OpenSDA Applications

www.freescale.com/frdm-kl46z These documents are available as part of the Quick Start Package: Name Type Description Quick Start Guide PDF This document OpenSDA Applications Folder OpenSDA Applications

Quick Start Guide for FRDM-FXS-MULTI-B Contents: Quick Start Package Overview Get to Know the FRDM-FXS-MULTI-B Getting Started Out of the Box Explore Further freescale.com/frdm-multi-b External Use FRDMFXSMULTIBQSG

Installation Manual NXP reserves the right to change the detail specifications as may be required to permit improvements in the design of its products. 2016 Freescale Semiconductor, Inc. 2017 NXP All rights

Purchase Agreement P&E Microcomputer Systems, Inc. reserves the right to make changes without further notice to any products herein to improve reliability, function, or design. P&E Microcomputer Systems,

Software and Support Activation Quick Start Guide Quick Start Guide Welcome Welcome to the Freescale Software Development tools and support activation guide. This document guides you through the registration

NXP Semiconductors Document Number: AN5338 Application Note Rev. 0, 09/2016 How to use FlexMemory as D-Flash and EEPROM in KE1xF 1. Introduction The FlexMemory (FlexNVM and FlexRAM) is available on NXP's

USER GUIDE EDBG Description The Atmel Embedded Debugger (EDBG) is an onboard debugger for integration into development kits with Atmel MCUs. In addition to programming and debugging support through Atmel

Programmers and Debuggers EDBG USER GUIDE Description The Atmel Embedded Debugger (EDBG) is an onboard debugger for integration into development kits with Atmel MCUs. In addition to programming and debugging

DT0095 Design tip Datalogging the SensorTile through a PC By Mauro Scandiuzzo Main components STEVAL-STLKT01V1 STSW-STLKT01 SensorTile development kit Embedded software samples for SensorTile, including