Você está na página 1de 38

Q u i c k S e n s e St u d i o - U G

Q UICK S E N S E S TUD IO U SER S G UIDE


1. Introduction
The QuickSense Studio software facilitates rapid code development and analysis for applications using the Silicon Labs family of QuickSense products. The Studio is comprised of multiple programs that guide users through an intuitive development flow, including graphical configuration wizards, firmware templates, and performance monitoring tools. These programs interface with the QuickSense Firmware API, a highly configurable open-source firmware library that provides support for many different applications, from simple buttons to complex algorithms like gesture recognition. These tools support both Capacitive Sensing and Infrared Sensing methods.

Figure 1. Silicon Labs QuickSense Studio Software


Rev. 0.2 12/09 Copyright 2009 by Silicon Laboratories QuickSenseStudio-UG

QuickSenseStudio-UG
For a detailed description of the QuickSense Firmware API or the Serial Interface, see AN366: QuickSense Firmware API. For a more detailed description of active/inactive thresholds, see AN367: Understanding Capacitive Sensing Signal to Noise Ratios. For a discussion on baselining in the QuickSense Firmware API, see AN418: Baselining in the QuickSense Firmware API.
Note: QuickSense Studio and QuickSense Firmware API version 2.xx support multiple compilers.

1.1. QuickSense Studio Downloads


The QuickSense Studio installation package available on the QuickSense webpage (www.silabs.com/quicksense) includes the following: QuickSense Studio software programs, like the QuickSense Configuration Wizard, QuickSense Calibration Utility, and QuickSense Performance Analysis Tool QuickSense Studio Users Guide (this document) QuickSense Firmware API example code for general-purpose development on Target Boards and ToolStick Daughter Cards General purpose software referenced in QuickSense Studio (e.g., Silicon Labs IDE, CP210x USB-to-UART drivers, etc.) can be downloaded from the Silicon Labs Software Downloads webpage (www.silabs.com/mcudownloads). The example code and documentation for the QuickSense demo kits can be downloaded from the relevant kit websites.

Rev. 0.2

QuickSenseStudio-UG 2. Software Overview and Design Flow


QuickSense Studio is a launcher program that provides links to the available and relevant QuickSense Studio programs, like the QuickSense Configuration Wizard and the QuickSense Performance Analysis Tool. The launcher software also manages the flow of information during the design process, like project location and selected device, so all of the programs opened from the QuickSense Studio launcher have some knowledge of the project. For example, the Hardware Configuration Wizard opened from the launcher will automatically import relevant peripheral settings from the QuickSense Configuration Wizard. The QuickSense Studio software is organized into four different categories of programs: Set Up, Configure, Build/ Debug, and Calibrate. An additional Resources category includes any additional useful documentation or programs for using or developing with the Silicon Labs QuickSense family of products. The sections that follow describe each of the steps illustrated in Figure 2 in greater detail.

Figure 2. QuickSense Studio Design Flow

Rev. 0.2

QuickSenseStudio-UG
The QuickSense Studio project build flow describing the possible paths for project development using the QuickSense Studio programs is shown in Figure 3. These steps are described in detail below and in 3. "Detailed QuickSense Studio Program Descriptions" on page 9.

Figure 3. QuickSense Studio Build Flow

Rev. 0.2

QuickSenseStudio-UG
2.1. Step 1: Creating a New Project
The Set Up pane in QuickSense Studio allows the developer to define the project and a target MCU. Once this information has been determined, the QuickSense Studio launcher will customize the available programs in the rest of the categories based on whats applicable to the target MCU.

Figure 4. QuickSense Studio Set Up Frame


To create a new QuickSense project, open QuickSense Studio and start with the Set Up frame. Clicking on Create a New Project will open up a dialog to select the desired MCU, set the project name, and project location. The software will create a project file in the specified folder with the project name specified in this window. A device can be selected from a list or found using the Select by Features... option:

Figure 5. Silicon Labs QuickSense Studio Device Parametric Search


The project values will be passed on to each subsequent program launched from the Studio.

Rev. 0.2

QuickSenseStudio-UG
2.2. Step 2: QuickSense Firmware API Customization
Once a project and device have been defined in the Set Up frame, the Configure frame can be used to create the QuickSense Firmware API files appropriate for the application.

Figure 6. QuickSense Studio Configure Frame


The programs included in this part of QuickSense Studio are the QuickSense Configuration Wizard and the Hardware Configuration Wizard. These programs are discussed in more detail in 3. "Detailed QuickSense Studio Program Descriptions" on page 9. From the Configure page, open the QuickSense Configuration Wizard. This program further defines the parameters of the project. For example, specific device pins can be selected for capacitive sensing. Once all parameters have been set, the program outputs a working QuickSense Firmware API project workspace file (*.wsp) that can be opened using the Silicon Labs IDE or built using the QuickSense Quick Builder. The QuickSense Configuration Wizard automatically creates the default initialization functions needed to build the project. The Hardware Configuration Wizard can optionally be used to add additional MCU peripherals to the project. Once a project has been created using the QuickSense Configuration Wizard, open the Hardware Configuration Wizard using the QuickSense Studio program. The Hardware Configuration Wizard will automatically load all the default peripheral settings from the QuickSense Configuration Wizard. To update the Firmware API hardware initialization file (QS_DeviceInit.c) with the additional settings, save the file generated by the Hardware Configuration Wizard as "QS_DeviceInit.c". Note that any changes made to this file may need to be debugged using the Silicon Labs IDE. See 3.2. "Silicon Labs Hardware Configuration Wizard (Configuration Wizard 2) (Optional)" on page 20 for detailed instructions on this process.

Rev. 0.2

QuickSenseStudio-UG

Figure 7. Using the QuickSense Configuration Wizard with the Hardware Configuration Wizard
The firmware generated by the QuickSense Configuration Wizard includes the necessary QuickSense Firmware API code as well as code in the main function to enable the API processes for all defined data classes. For example, if a project is created with channels, groups, and thresholds enabled, then the main function will automatically enable the corresponding processes.

2.3. Step 3: Building the Application-Specific QuickSense Firmware API Files


After the application-specific QuickSense Firmware API files have been generated using the programs in the Configure frame, the project needs to be compiled, built, downloaded, and optionally debugged on the target hardware. The programs included in the Build/Debug frame are the Silicon Labs IDE, Silicon Labs Quick Builder, and Silicon Labs Flash Utility.

Figure 8. QuickSense Studio Build/Debug Frame

Rev. 0.2

QuickSenseStudio-UG
The project can be edited, built, and debugged using the Silicon Labs IDE. If the project is intended only to measure and report channel values and no further modification is necessary, the Silicon Labs Quick Builder can be used to build the project and download it to the target MCU. If the project is already built, the Flash Utility can be used to download the firmware to the target MCU. For more information on using these programs, see 3. "Detailed QuickSense Studio Program Descriptions" on page 9.
Note: Some compilers may have code size limitations. The QuickSense Firmware API version 2.xx supports multiple compilers and all development and evaluation kits include a pre-built Intel HEX file. See AN366: QuickSense Firmware API for more information.

2.4. Step 4: Calibrating the Hardware


Once the code is loaded onto the application hardware, the programs in the Calibrate frame can be used to test and change the sensitivity of the system.

Figure 9. QuickSense Studio Calibrate Frame


The QuickSense Performance Analysis Tool interacts with the QuickSense Firmware API to graphically display raw data values, thresholds, and other information in real time. This utility can also be used to determine appropriate thresholds for different overlay thicknesses and other environmental conditions. The QuickSense Calibration Utility can be used to insert known threshold values to a newly programmed board without the visual representation of data. The QuickSense XY Display Utility can be used to test the calibration and range of motion with applications that support multi-dimensional pads (nD Pads), like the IR Slider demo (IrSliderEK).

2.5. Additional Resources


The Resources section of the QuickSense Studio provides links to additional resources that may be useful when developing an application using the QuickSense family of products. These additional resources include documentation and QuickSense demo kits that provide examples of using the QuickSense Firmware API.

Rev. 0.2

QuickSenseStudio-UG 3. Detailed QuickSense Studio Program Descriptions


When the QuickSense Studio launcher is first opened, it will automatically display the Set Up section of the program. Once a project has been created or loaded, the QuickSense Studio programs can be opened from the launcher by double-clicking on the program or using the Launch button. If the QuickSense Studio launcher is unable to find a program in the default installation location, it will prompt the user to either find the program location if its already installed or download the program from the Silicon Labs website.

Figure 10. QuickSense Studio Program Not Found Frame Options

3.1. QuickSense Configuration Wizard


The QuickSense Configuration Wizard generates a customized QuickSense Firmware API project based on options selected in the GUI. This program makes designing with QuickSense products simple and quick.
Note: The QuickSense Firmware API is described in detail in AN366: QuickSense Firmware API.

Figure 11. QuickSense Configuration Wizard


The firmware generated by the QuickSense Configuration Wizard includes the necessary QuickSense Firmware API code, default initialization functions, and code in the main function to enable the API processes for all defined data classes. For example, if a project is created with channels, groups, and thresholds enabled, then the main function will automatically enable the corresponding processes. Since the processes are enabled by default, the project created by the QuickSense Configuration Wizard and optionally augmented by the Hardware Configuration Wizard will function properly in the Performance Analysis Tool without any further modification. The project creation and device selection is automatic when the QuickSense Configuration Wizard is opened using QuickSense Studio. The FileNew Project menu option can be used to change selected devices or create a new project.

Rev. 0.2

QuickSenseStudio-UG
3.1.1. Global Settings The Global Settings tab of the QuickSense Configuration Wizard shown in Figure 11 provides options for the basic, overall functionality of the firmware. 3.1.1.1. Save Values The Save Group Values and Save Threshold Values options determine whether the raw measured data for groups and thresholds are saved. For group values, saving the data may not be necessary if only the state of the group (for example, position) is important and not the intermediate measured values. Thresholds may not be important if the measured object does not have on/off states like a button and instead has interpreted data like a position coordinate. These options are enabled by default. The CS0 Sample Rate and IR Sample Rate are the approximate rate at which the hardware takes a measurement in milliseconds. Depending on the available microcontroller bandwidth, there may be a small delay between the sampling timeout and the actual measurement. 3.1.1.2. Events For both switches and groups, events can be defined for a specific action. When an event occurs, a function within the Firmware API is called. The Switch Events options are as follows:

DisabledNo function calls on switch events. RisingFunction call on rising switch edges only. FallingFunction call on falling switch edges only. Rising and FallingFunction call on both switch edges. The Group Events options are as follows:

DisabledNo function calls on group events. RisingFunction call on rising group edges and group active events. FallingFunction call on falling group edges and group active events. Rising and FallingFunction call on both group edges and group active events. Active OnlyEvents will only trigger when the group is active.

3.1.1.3. Serial Interface The QuickSense Firmware API Serial Interface allows the hardware to communicate with the QuickSense Studio calibration programs like the Performance Analysis Tool. The Serial Interface is enabled by default. The Board ID can be used to identify the board as a particular type of hardware. The QuickSense Firmware API demos like the Music Keyboard have a pre-defined Board ID. These pre-defined Board IDs can be found in the PerformanceAnalysisTool.ini file installed in the same directory as the Performance Analysis Tool (C:\SiLabs\MCU\QuickSense_Studio\Software\PerformanceAnalysisTool\ by default). The default Board ID is 0xFF or 255. The Default Update Frequency parameter determines how often the Serial Interface sends data if a Periodic transfer mode is selected. 3.1.1.4. Transfer Info If Send Enumeration Information is enabled, the Serial Interface will transmit basic information describing the system (how many switches and groups, for example) when requested by the host. This is useful for systems where the hardware the host is talking to may change. However, in fixed systems where the host is always talking to the same device, disabling this option reduces the projects code size. The method the Serial Interface uses to determine when to transfer data can be selected using the Transfer Mode options. The Serial Interface will transfer data periodically at a rate defined by Default Update Frequency in the Serial Interface section using the Periodic option. The Update option will only send data if a switch or group sta-

10

Rev. 0.2

QuickSenseStudio-UG
tus has changed. The Demand option will send data when requested by the host. In both the Update and Demand options, the Default Update Frequency has no effect. The Transfer Type options determine what data is set when the Serial Interface makes a data transfer. With the Selected option, data will only be transferred for selected channels. For Selected and Updated option, data will be transferred if channels are selected and the data or state has changed since the last transmission.
Note: The "Selected" transfer type is not a subset of the "Selected And Updated" transfer type. If the application requires both "Selected" and "Selected and Updated" transfer types, the "Selected" type must be explicitly chosen in addition to Selected and Updated.

3.1.2. Measurements The Measurements tab of the QuickSense Configuration Wizard provides options for global QuickSense Firmware API measurements settings.

Figure 12. Silicon Labs QuickSense Configuration Wizard Measurements Tab


3.1.2.1. Baseline Information For detailed information for these parameters and on baselining in the QuickSense Firmware API, see AN418: Baselining in the QuickSense Firmware API. The default settings for the baselining values should be sufficient for most systems. 3.1.2.2. Flash Memory This section defines the address of the Non-Volatile Calibration and Configuration Area in the device and whether Flash write/erase routines are included with the custom Firmware API code. The calibration and configuration area should be located on a Flash page not shared with any application code. If the final application code does not utilize the Flash write/erase routines (i.e. Flash is read only), then these should be omitted from the project. The QuickSense Calibration Utility or Performance Analysis Tool can be used to set thresholds and other parameters for the application while the Flash is writable and erasable. Once these have been determined, an Intel HEX file can be created that can be downloaded to other boards, eliminating the need for Flash write/erase routines. A description on how to create this .HEX file using the IDE can be found in 3.3.2.4. "Creating a Calibrated Final Firmware Image Intel HEX File using the IDE" on page 23. 3.1.2.3. Exponential Averaging Filter The QuickSense Firmware API uses an exponential averaging filter to provide a smooth and clean signal for each channel. The equation for this averaging filter is as follows:

xn y n 1 y n = ------------------------------------ + y n 1 2m

Rev. 0.2

11

QuickSenseStudio-UG
In this equation, x(n) represents the current sample, y(n) represents the current result, and y(n-1) represents the previous result. This setting in the QuickSense Configuration Wizard changes the m exponent in the equation. The higher the exponent, the less weight is given to new samples fed into the averager. For more details, see AN366: QuickSense Firmware API. 3.1.2.4. Si1120 Settings The STX Max High Time is the longest the STX pin on the Si1120 is asserted during IR measurements. Deasserting this pin causes the Si1120 to stop IR measurement for that specific irLED. This value should be set for the application such that the STX pin can be asserted for the shortest amount of time to save power. This value is specified in microseconds and the valid range is 500 to 2200 rounded to the nearest 100 s. 3.1.3. Peripherals Once the Global Settings and Measurements options have been set for a particular application, the Peripherals tab provides a graphical interface for allocating control pins for external peripheral devices, like the Si1102. The UART pins are gray to indicate that these pins are unavailable for external device control or communication lines. These UART pins are available for use if the Serial Interface is disabled in the Global Settings tab.

Figure 13. Silicon Labs QuickSense Configuration Wizard Peripherals Tab


To add an external peripheral device, click the Add... button. This will bring up a dialog box with the available external peripheral device options. The Include ALS Channel option is not available for the Si1102.

Figure 14. Adding an External Peripheral Device

12

Rev. 0.2

QuickSenseStudio-UG
Once a channel has been added, click on the Port I/O diagram to allocate the control channels to GPIO pins.

Figure 15. Allocating GPIO Pins for an External Peripheral Device


To change a control pin once its been allocated, select the pin to move in the Pins list and click on the new desired location in the Port I/O diagram.

Figure 16. Moving an Allocated GPIO Pin for an External Peripheral Device
The MD pin is not necessarily required for all applications, so assigning this pin is optional. The "Single Prox Channel" checkbox indicates that the application only requires a single Infrared Proximity channel, so the IR signal pins do not need to be multiplexed. In this case, a pin does not need to be assigned to IR in the Channels/Thresholds tab.

Rev. 0.2

13

QuickSenseStudio-UG

Figure 17. Selecting a Single IR Channel


To remove an external peripheral device, select the device in the Peripheral drop-down box and click the Remove button.

Figure 18. Removing an External Peripheral Device


The MCU diagram to the right of the External Peripheral Settings section will update with the GPIO pin allocations. An external peripheral device must already exist in order to add Infrared Proximity sensing channels in the Channels/Thresholds tab. 3.1.4. Channels/Thresholds The Channels/Thresholds tab provides a graphical interface for allocating Capacitive or Infrared Proximity sensing pins. To add a Capacitive Sensing button with Threshold Calibration Enabled to P2.1, select Capacitive under Sensing Method and Button: Threshold Calibration Enabled under Threshold Detection and select P2.1 in the Port I/O diagram.

14

Rev. 0.2

QuickSenseStudio-UG

Figure 19. Adding a Capacitive Sensing Channel


The Infrared Proximity options are unavailable unless an external peripheral device was added using the Peripherals tab. To add a low power Infrared Proximity channel with thresholds disabled to P1.3, select Infrared Proximity under Sensing Method, Disabled/Group under Threshold Detection, and Prox Low Pwr under IR Mode and select P1.3 in the Port I/O diagram. If only one IR channel is allocated, the QuickSense Configuration Wizard will open a dialog box when any other tab is selected indicating that the "Single Prox Channel" option is available in the Peripherals tab.

Figure 20. Adding an Infrared Proximity Channel


To clear any channels, select the Clear option under Sensing Methods and select any undesired allocations in the Port I/O diagram. Channels can also be cleared at any time by right-clicking on an assigned channel in the Port I/O diagram.

Rev. 0.2

15

QuickSenseStudio-UG

Figure 21. Clearing an Allocated Channel


An entire port can be selected by clicking the Port n cells to the left of the rows. The same location on all ports (Pn.1, for example) can be selected using the head column cells. All available cells can be selected using the upper left-hand corner of the Port diagram.

Figure 22. Selecting Multiple Channels


The MCU diagram to the right of the Channel Settings section will reflect the allocated pins from both the Peripherals and Channels/Thresholds tabs.

16

Rev. 0.2

QuickSenseStudio-UG
3.1.5. Groups In order to add groups in the Groups tab, there must be Capacitive Sensing or Infrared Proximity channels allocated using the Channels/Thresholds tab. These channels must be of the Disabled/Group Threshold Detection type.

Figure 23. Creating a Group


Once these channels have been created, select the Group tab and add a group using the Add button. The Group dialog box will open. The group can be named using the text box at the top and the group properties can be selected using the options in this dialog. The Capacitive groups use capacitive CS0 channels and the Infrared groups use Infrared Proximity channels. Once the group has been created, the available CS0 channels can be allocated to that group.

Figure 24. Allocating Channels to a Group


To allocate a channel, select the channel in the Channels list and select a CS0 channel in the Port I/O diagram. The diagram to the right should update with the allocated channels. Groups do have a specific order in which the channels must be defined. This order can be adjusted using the up and down arrows at the bottom of the Groups tab. To adjust the order, select a channel and press either the up or down arrow. The group diagram will update with the order of the channels.

Rev. 0.2

17

QuickSenseStudio-UG

Figure 25. Adjusting Group Channel Order


Infrared Proximity groups can be added using the same procedure as Capacitive Sensing groups. Infrared Proximity channels must first be created using the Channels/Thresholds tab. Once the channels exist, a new group can be added that use those channels. The order of these channels can also be adjusted accordingly. If multiple groups are present in the system, the settings for a group can be adjusted by selecting the group in the drop-down box.

Figure 26. Infrared Proximity Groups


Group selections can be deleted or cleared by using the Delete and Clear buttons at the bottom of the Groups tab.

18

Rev. 0.2

QuickSenseStudio-UG
3.1.6. Code The Code tab of the QuickSense Configuration Wizard provides a window into the QuickSense Firmware API files modified by the program.

Figure 27. Silicon Labs QuickSense Configuration Wizard Code Tab


The Additional Project Settings button can be used to set up the projects compiler, the compilers location, the Debug Adapter used by the project, and whether or not the project should automatically be downloaded on a successful build (disabled by default). When all settings have been made for the application using the QuickSense Configuration Wizard, the Export to Project option creates the QuickSense Firmware API project with the customized application settings.

Rev. 0.2

19

QuickSenseStudio-UG
3.2. Silicon Labs Hardware Configuration Wizard (Configuration Wizard 2) (Optional)
The Hardware Configuration Wizard (Configuration Wizard 2) program is a general-purpose utility that helps accelerate development by automatically generating initialization source code to configure and enable the on-chip resources needed by most design projects. In just a few steps, the wizard creates complete startup code for a specific Silicon Labs MCU. If opened using QuickSense Studio, Configuration Wizard 2 will have knowledge of any peripheral-specific settings generated using the QuickSense Configuration Wizard. The default initializations created by the QuickSense Configuration Wizard can be augmented with additional hardware configuration using Configuration Wizard 2. To modify the Firmware API project files generated by the QuickSense Configuration Wizard:
1. Generate a project using the QuickSense Configuration Wizard. 2. Open Hardware Configuration Wizard (Configuration Wizard 2) using the QuickSense Studio launcher program. 3. Add any extra peripheral settings required by the application. It's not recommended to modify the oscillator speed, UART baud rate, and Timer 0/1 settings to maintain QuickSense Serial Interface compatibility. Note: Any modifications or extra peripheral configurations made with Configuration Wizard 2 may require debugging using the Silicon Labs IDE. 4a. Keep the initial hardware configurations intact in "QS_DeviceInit.c", save the additional hardware settings in a new file, and add this new file to the QuickSense Firmware API project. Detailed instructions on how to do this can be found in Section 3.3.2.1. "Opening the QuickSense Firmware API Project" on page 21. -or4b. Save the initial and additional hardware settings to a file named "QS_DeviceInit.c" (Note: This will replace the initial hardware configurations generated by the QuickSense Configuration Wizard).

The hardware initialization file (QS_DeviceInit.c) should be updated whenever any changes to peripheral settings are made using the Configuration Wizard 2.

20

Rev. 0.2

QuickSenseStudio-UG
3.3. Silicon Labs IDE
The Silicon Labs IDE integrates a source-code editor, a source-level debugger, and an in-system Flash programmer.

Figure 28. Silicon Labs IDE


3.3.1. IDE System Requirements The Silicon Labs IDE requirements:

Pentium-class host PC running Microsoft Windows 2000 or newer One available USB port 3.3.2. Using the Silicon Labs IDE with the QuickSense Firmware API The following sections discuss how to open the QuickSense Firmware API with the IDE, build the source code, and download it to the target device. 3.3.2.1. Opening the QuickSense Firmware API Project 1. If the Silicon Labs IDE is opened using QuickSense Studio, the project specified in the Set Up section will be automatically opened. Otherwise, select ProjectOpen Project and navigate to the QuickSense Firmware API project. 2. (Optional) To create any new files to add to the project, select FileNew File to open an editor window. Create your source file(s) and save the file(s) with a recognized extension, such as .c, .h, or .asm, to enable color syntax highlighting. 3. (Optional) To add these new files, right-click on QuickSense_API in the Project Window. Select Add files to project. Select files in the file browser and click Open. Continue adding files until all project files have been added. 4. (Optional) For each of the new files in the Project Window that you want assembled, compiled and linked into the QuickSense Firmware API project, right-click on the file name and select Add file to build. Each file will be assembled or compiled as appropriate (based on file extension) and linked into the build of the absolute object file. Note: If a project contains a large number of files, the Group feature of the IDE can be used to organize. Right-click on QuickSense_API in the Project Window. Select Add Groups to project. Add pre-defined

Rev. 0.2

21

QuickSenseStudio-UG
groups or add customized groups. Right-click on the group name and choose Add file to group. Select files to be added. Continue adding files until all project files have been added. 3.3.2.2. Building and Downloading the QuickSense Firmware API Project for Debugging 1. Once all additional source files have been added to the target build, build the project by clicking on the Build/Make Project button in the toolbar or selecting ProjectBuild/Make Project from the menu. Note: After the project has been built the first time, the Build/Make Project command will only build the files that have been changed since the previous build. To rebuild all files and project dependencies, click on the Rebuild All button in the toolbar or select ProjectRebuild All from the menu. 2. Before connecting to the target device, several connection options may need to be set. Open the Connection Options window by selecting OptionsConnection Options... in the IDE menu. First, select the USB Debug Adapter option. Next, the correct Debug Interface must be selected. See the appropriate kit or data sheet documentation to determine the proper Debug Interface selection for the microcontroller in the application. Once all the selections are made, click the OK button to close the window. 3. Click the Connect button in the toolbar or select DebugConnect from the menu to connect to the device. 4. Download the project to the target by clicking the Download Code button in the toolbar. Note: To enable automatic downloading if the program build is successful select Enable automatic connect/download after build in the ProjectTarget Build Configuration dialog. If errors occur during the build process, the IDE will not attempt the download. 5. Save the project when finished with the debug session to preserve the current target build configuration, editor settings and the location of all open debug views. To save the project, select ProjectSave Project from the menu. 3.3.2.3. Downloading an Intel HEX Firmware Image The QuickSense Evaluation Kit installer packages install the firmware source code as well as a pre-built Intel HEX image that can be downloaded directly into the board. The firmware source code and an example IDE project is located in the relevant kits installation directory (C:\SiLabs\MCU\QuickSense_Studio\Kits\<kit_name>\Firmware\). The pre-built HEX image is located in the C:\SiLabs\MCU\QuickSense_Studio\Kits\<kit_name>\Firmware\Release\ directory. An Intel HEX file can also be created from a calibrated boards firmware image as described in Section 3.3.2.4.. To update or refresh the HEX image in a board: 1. 2. 3. 4. 5. 6. 7. 8. Connect the USB Debug Adapter or Debug port on the target hardware to the PC using a USB cable. Launch the Silicon Labs IDE, and click on OptionsConnection Options. Select USB Debug Adapter and then select the Debug Adapter from the list. Select the appropriate debug interface (C2 in most cases) and press OK. Connect to the board by pressing the Connect icon, or using the keyboard shortcut Alt+C. Click on the Download icon, or use the keyboard shortcut Alt+D. In the download dialog window, click Browse. Change to Files of Type Intel Hex (*.hex) and then browse to the appropriate folder to select the HEX file to be downloaded. 9. Click Open then Download. 10. To run the new image, either press Go in the IDE or disconnect from the board (keyboard shortcut Alt+C). It is necessary to disconnect from the board in the IDE if the Performance Analysis Tool will be used to view data later.

22

Rev. 0.2

QuickSenseStudio-UG
3.3.2.4. Creating a Calibrated Final Firmware Image Intel HEX File using the IDE After a board has been calibrated and completely configured, an Intel HEX firmware image file can be created using the Silicon Labs IDE. This image can then be downloaded to other boards in a production setting. To create this firmware image, perform the following steps: 1. Open the Silicon Labs IDE. A project does not have to be open. 2. Before connecting to the target device, several connection options may need to be set. Open the Connection Options window by selecting OptionsConnection Options... in the IDE menu. First, select the USB Debug Adapter option. Next, the correct Debug Interface must be selected. See the appropriate kit or data sheet documentation to determine the proper Debug Interface selection for the microcontroller in the application. Once all the selections are made, click the OK button to close the window. 3. Click the Connect button in the toolbar or select DebugConnect from the menu to connect to the device. 4. Go to ToolsUpload Memory to File.

Figure 29. IDE Tools Menu


5. Under Memory Type, select CODE from the drop-down menu. 6. Once CODE has been selected, the default address range will be the entire Flash memory. A smaller portion of the Flash can be optionally uploaded by changing the Starting Address or Ending Address values. The default Hex option should be kept. 7. The file name can be specified using the text box under Output File. The default Hex option should be selected. 8. Press the GO button. This will create an ASCII text image of the Flash area specified.

Figure 30. IDE Upload Memory to File Dialog

Rev. 0.2

23

QuickSenseStudio-UG
9. Go to the following KnowledgeBase article and download the ASC2HEX_V1.1.zip attachment: http://portal.knowledgebase.net/article.asp?article=174726&p=4120. This attachment will include an ASCII to binary converter (ASC2HEX.exe) and a binary to .HEX converter (BIN2HEX.exe). 10. Navigate to the directory where the attachment was saved. Unzip the file and run the ASCII to HEX utility (ASC2HEX.exe). In the program, use Browse to navigate to the file created in Step 8 using the IDE. Press OK. This will create a binary program of the same filename. 11. Run the binary file through the binary to .HEX converter (BIN2HEX.exe). This can be done by dragging and dropping the binary file on the BIN2HEX.exe executable or calling the executable from the command line (Usage: BIN2HEX C:\firmware_image.bin). 12. The binary to .HEX converter output file name is limited to eight characters, so the .HEX file should be renamed as desired. The file is now a calibrated .HEX file that can be downloaded to other boards.

3.4. QuickSense Quick Builder


The QuickSense Quick Builder utility allows code to be compiled and optionally downloaded without opening the project through the Silicon Labs IDE. When opened from QuickSense Studio, QuickSense Quick Builder will automatically build the project specified in the Set Up section. To access the QuickBuilder build and download options using QuickSense Studio, go to ConfigureOpen the QuickSense Configuration WizardClick on the Code tabPress the Additional Project Settings button. The compiler can be selected using the Compiler drop-down menu, and this compilers location can be specified using the Compiler Directory text box. The Debug Adapter can be selected using the Device Adapter drop-down menu. Additionally, the QuickBuilder can automatically download on a successful build if this option is enabled (disabled by default).

3.5. Silicon Labs Flash Utility


The Silicon Labs Flash Utility is a GUI interface that can download code to a device and perform other memory operations without needing to use the Silicon Labs IDE. For more information on the functions called in this GUI, see AN117: Using C8051Fxxx On-Chip Interface Utilities DLL.

Figure 31. Silicon Labs Flash Utility

24

Rev. 0.2

QuickSenseStudio-UG
3.6. QuickSense Performance Analysis Tool
The QuickSense Performance Analysis Tool can be used to view values, save threshold values, calibrate, and log data in real-time from a device running the QuickSense Firmware API.

Figure 32. QuickSense Performance Analysis Tool


3.6.1. Connecting to a Device To connect to a device running the QuickSense Firmware API, use the Devices menu to select the desired device. The program can connect to either a COM port (or Virtual COM port) or a ToolStick TSxxxx. Once the device is selected, the Performance Analysis Tool will automatically connect to that device. The connection can be manually controlled using the Connection menu.

Figure 33. Connecting to a Device in the Performance Analysis Tool


3.6.2. Selecting a Button to Graph Once the Performance Analysis Tool connects to a board, a Board Representation window will open representing the available buttons or switches on the board. The generic Board Representation window is a graphical description of the target hardware where each channel is represented as a button. Each button has three different states: not selected and not displayed, displayed and not selected, and displayed and selected. A button that is displayed has data for its corresponding channel shown on the programs graph. A button that is selected can have the threshold values viewed and modified. The default state for all buttons is not displayed and not selected.

Rev. 0.2

25

QuickSenseStudio-UG
Each button has a color box surrounding the checkbox. This is the color used to display the data of the corresponding channel on the graph. The color associated with a particular channel can be modified at any time by right-clicking on the button in the Board Representation window. The text shown on the button in the Board Representation window is the channel number followed by the most recent value acquired for the channel the button represents. The color of the text is red if the button is inactive and green if the button is active. To display a channel using the generic Board Representation window, check the checkbox next to the button. To select the button so the threshold values are displayed, press the portion of the button with the raw data value.

Figure 34. Generic Board Representation


The QuickSense demo kits have custom Board Representation windows that represent the hardware. To display a channel using the custom Board Representation window, check the checkbox associated with the button. To select the button so the threshold values are displayed, click inside the white line surrounding the button.

Figure 35. ITO Film EK Custom Board Representation

26

Rev. 0.2

QuickSenseStudio-UG
Once a button has been selected, press the green play button under Acquisition to start graphing. This play button will become a pause button that can be used to stop graphing.

Figure 36. Performance Analysis Tool Start Acquisition Button


3.6.3. Adjusting a Channels Thresholds If a button is displayed and selected, the thresholds for that channel are modifiable in the graph window (in Time and Bar graphing modes only) if the Flash is not read-only (Flash write and erase routines were included in the QuickSense Firmware API). The inactive-to-active threshold is represented by a green dotted line and the activeto-inactive threshold is represented by a red dotted line. To adjust a threshold, left-click and hold either threshold and move it up or down anywhere in the graph window. For applications where the Flash should be read-only, a .HEX file that includes calibration values can be created using the IDE. See 3.3.2.4. "Creating a Calibrated Final Firmware Image Intel HEX File using the IDE" on page 23 for more information on this process. 3.6.3.1. Manual Adjust The values in the Manual Adjust area under Threshold Settings will automatically update as the threshold is moved up and down with the mouse. Alternatively, the threshold can be updated manually by typing a percentage value in the Inactive to Active and Active to Inactive text boxes.

Figure 37. Adjusting the Active-to-Inactive Threshold


Checking the Apply to Displayed checkbox will apply the values in the Inactive to Active and Active to Inactive text boxes to the thresholds for all the channels displayed on the graph.

Rev. 0.2

27

QuickSenseStudio-UG
3.6.3.2. Auto Adjust The Threshold Auto Adjust feature is available if a channel is selected and the program is actively graphing the channels real-time values. To use the Auto Adjust feature, press the Selected button and follow the instructions. For a new board, the Auto Adjust feature may provide a good starting point for the threshold values. The thresholds can then be manually adjusted as necessary. This feature is only available with the Periodic transfer mode. 3.6.3.3. Save The Threshold Save feature can be used to save the adjusted thresholds back to the hardware. In the Save options under Threshold Settings, pressing Selected will save the values for the currently selected channel. Pressing All will save the thresholds for all channels. Any changes made in the Performance Analysis Tool to the thresholds of a channel without saving will be lost the next time the program connects to the hardware. 3.6.3.4. Revert The Revert options reset the displayed thresholds with the ones saved in the hardware. Pressing Selected will reload the threshold settings for the selected channel and pressing Displayed will reload the threshold settings for all displayed channels. Any changes made to the threshold without saving will be lost when the Revert options are used. 3.6.3.5. Erase The Threshold Erase feature will reset the thresholds in the hardware back to their default states (100% for Inactive to Active and 0% for Active to Inactive). Pressing Selected erases the hardwares threshold settings for the selected channel and pressing All erases the hardwares threshold settings for all channels. 3.6.4. Interacting with Groups A group is the set of channels creating a single element, such as a scroll wheel or a slider. Each group type has a window with a visual representation of the latest states of the groups defined for the hardware. Upon connecting to the hardware, these windows are opened if the Performance Analysis Tool detects one or more valid groups of that type.

Figure 38. Generic Groups Representation Examples


The numeric indicator presents a range of 0 to 511 position units for the slider and a range of 0 to 360 degrees for the wheel.

28

Rev. 0.2

QuickSenseStudio-UG
3.6.5. Performance Analysis Tool Settings Menu Options The Settings Menu has additional graphing options available.

Figure 39. Performance Analysis Tool Settings Menu


3.6.5.1. Graph The Graph submenu contains the graphing options in the Performance Analysis Tool. The available options are described below. Type The SettingsGraphType menu has three options: Time, Bar, and Threshold State. The Time graph is the default setting and graphs the real-time value and thresholds of the displayed channels over time. The Bar graph option displays the instantaneous real-time value and thresholds for displayed channels. The Threshold State option displays the Active and Inactive state for each channel but does not display the real-time raw data values or threshold information. With both the Bar and Threshold State graphing options, the bar representing a selected channel is solid and all other bars are transparent. If no channel is selected, all bars are solid.

Rev. 0.2

29

QuickSenseStudio-UG

Figure 40. Performance Analysis Tool Graphing Types


Channel Selection The GraphChannel Selection options allows a quick way to select sets of channels. The All option will display all channels and None will set the state of all buttons to not displayed, not selected. Set Manual Scale This window can be used to manually specify the Time and Counts ranges for the Time graph. The Time range has no effect on the Bar and Threshold State graphs. Setting either the Time and Counts ranges manually will automatically disable the Auto Scale feature. Auto Scale This option toggles automatic scaling of the Counts range in the different graphing types. This option is forced off if a manual scale is entered. Reset Selecting this option clears all acquired data and resets the Time graph, setting the elapsed time back to zero.

30

Rev. 0.2

QuickSenseStudio-UG
Show Baseline This option toggles the Active and Inactive Baselines on the graph. For detailed information on baselining in the QuickSense Firmware API, see AN418: Baselining in the QuickSense Firmware API. This option is on by default. 3.6.5.2. Data Logging Selecting this option opens the Data Logging Settings dialog. The dialog controls settings for the log file size, log file name, and filters the channels whose data will be logged.

Figure 41. Data Logging Options


Note that when the "Log displayed channels" option is selected, the checkboxes of the desired channels must be checked in the Board Representation window. To start logging data:
1. Select a File. By default the file name is created from the date and time. 2. Select the "Maximum file size." 3. Select the desired Raw Data, Threshold State, Baseline Data, Threshold Level, and Groups Filter options. 4. In the Board Representation window, check the checkboxes of the channels to log (needed only if the option "Log displayed channels" is selected in any of the Filters). 5. Click OK in the Data Logging Settings dialog. 6. During acquisition, check the "Log to file" checkbox control when logging start and stop. If a file for data logging has not been set up, clicking the "Log to file" checkbox will bring up the Data Logging Settings dialog.

The contents of the data logging file are readable at any time and modifiable when the user selects a different file or disconnects from the hardware. The data streamed to the log file is saved as text with a Tab Separated Values format. Up to six sets of information are saved, in the following order, depending on the filter options chosen:
1. Time stamp 2. Raw data (optional) 3. Threshold state (optional) 4. Active and Inactive Baselines (optional) 5. Threshold level (optional) 6. Group state data (including gestures, where applicable) (optional)

The Threshold State information has two values:

Table 1. Threshold State Values


State Value 0 1 Definition Active-to-Inactive threshold crossed, negative slope (button is off) Inactive-to-Active threshold crossed, positive slope (button is on)

Rev. 0.2

31

QuickSenseStudio-UG
3.6.5.3. Sampling Frequency This option sets the frequency in Hz at which the hardware sends data to the Performance Analysis Tool using the QuickSense Firmware API serial interface. This value is only relevant if the Periodic Data Transfer mode is used. The range of sampling frequencies supported is determined by the hardware. 3.6.5.4. Buffer Size This option modifies the size of the data acquisition buffer used by the Performance Analysis Tool. The acquisition buffer is shared by all the channels present on a system. The size is specified in MB and the default value is 1 MB. This option is only available when the Performance Analysis Tool is not connected to hardware. 3.6.5.5. Data Transfer

Figure 42. Data Transfer Options


Data Transfers can be Periodic, On Demand, or On Update. Periodic is the default Data Transfer mode and the sampling rate is determined by the Sampling Frequency option. If On Demand is selected, the available Transfer Types are Selected and Selected and Updated. In this mode, a Sample button will be available next to the Start Acquisition Button. To take a sample, press the Start Acquisition button and press the Sample button when a sample is desired.

Figure 43. On Demand Data Transfer Mode


If On Update is selected, only new events detected by the hardware will be displayed by the software. The available Transfer Types in this mode are Selected and Selected and Updated. In this mode, data will be displayed only if a change in state or an update is detected on a channel or group. For a detailed description of the transfer modes and types, see AN366: QuickSense Firmware API.

32

Rev. 0.2

QuickSenseStudio-UG
3.6.5.6. Baseline Update Period This option modifies the period in seconds at which the hardware recomputes the Active and Inactive Baselines. This parameter is global to the hardware (the same update period is used for all channels) and it is stored in the hardware. This parameter can only be set when an acquisition is not acquiring data.

3.7. QuickSense Calibration Utility


The QuickSense Calibration Utility can be used to update thresholds and calibrate a device without the graphical interface of the Performance Analysis Tool. Additionally, a board configuration can be saved to download to multiple boards. To connect to a device, go to Device and select either the ToolStick TSxxxx or the COM (or Virtual COM) port of the hardware. Once a device is selected, the program will automatically attempt to connect to the hardware. The connection status can also be manually controlled using the Connection menu options. 3.7.1. Threshold Settings The program will automatically detect the group and switch elements on a board. To modify the parameters for a particular group or channel, select that element in the Channels and Groups list. Then the channels thresholds can be modified by moving the Active-to-Inactive or Inactive-to-Active sliders up and down under Threshold Settings. The default values for these thresholds is 30 and 70, respectively.

Figure 44. Setting Thresholds in the QuickSense Calibration Utility

Rev. 0.2

33

QuickSenseStudio-UG
The channel numbers correspond to the button and group elements on the hardware based on the listed order in the arrays QS_Config.c file. The first element in these arrays is element 0 (Channel or Group 0).

Figure 45. Corresponding Channels and Hardware


Once the desired value is represented by the sliders, the Set Thresholds button sets the thresholds for the selected channel. However, these thresholds are not saved until a channel has been calibrated. The Set All button sets the thresholds to the slider values for all the channels. The Reset All button resets the thresholds to their default values. 3.7.2. Minimum SNR Requirements The Minimum SNR Requirements section sets the desired SNR for each channel. When the channel or channels go through the calibration process, the program will verify that the desired SNR has been met using the Threshold Settings. The application will cancel a calibration process without writing any calibration values to the device if minimum configured SNR requirements cannot be met for a channel. The Set Selected SNR button sets the desired SNR for the selected channel. The Set All SNR buttons sets the desired SNR for all channels to the value represented by the Desired SNR text box. The Reset All SNR button resets the desired all SNR channels to the default value of 5. 3.7.3. Calibration To calibrate one channel or group, select the channel or group and use the Calibrate Selected button. The program will then proceed with a series of steps to calibrate that channel or group. The calibration process can only be completed if the Flash is writable and erasable.

34

Rev. 0.2

QuickSenseStudio-UG

Figure 46. Calibrating a Group in the QuickSense Calibration Utility


The calibration instructions are shown in dialog boxes and are described in the Test Instructions section. Once the channel has been calibrated, the threshold settings will be written to the hardware. The result of the calibration operation will be displayed in the Test Instructions text box when calibration has completed. For non-group channels, the calibration operation will display the calculated SNR of the button while the program is writing the thresholds to the hardware.

Figure 47. Calculated Channel SNR


The program will issue a notification if the calculated SNR for the channel was not high enough to meet the desired SNR set for the channel. Once all of the channels have been calibrated and configured, the calibration profile can be saved by going to the File menu and selecting Save. A previous calibration profile can be loaded by using the FileLoad option. For applications where the Flash should be read only, a .HEX file that includes calibration values can be created using the IDE. See Section 3.3.2.4. for more information on this process.

Rev. 0.2

35

QuickSenseStudio-UG
3.8. QuickSense XY Display Utility
The QuickSense XY Display Utility provides a drawing pad for multi-dimensional pad (nD Pad) groups in the QuickSense Firmware API. For more information on this group type, see AN366: QuickSense Firmware API. For these group types, the coordinate transmitted by the QuickSense Firmware API Serial Interface is displayed on the drawing pad. The displayed coordinates location is displayed in the lower left-hand corner.

Figure 48. QuickSense XY Display Utility with the One-Dimensional IR Slider Evaluation Kit
To connect to a device, use the DeviceSettings menu option to select the device and the program will automatically connect. The connection status can also be manually controlled using the DeviceConnect menu. The connected device will be displayed in the lower left-hand corner. Once a device is connected, the device should begin transmitting location information to the XY Display Utility. In the case of the Infrared Slider, the relative one-dimensional position should be displayed. 3.8.1. View Menu The View menu provides several options for the XY Display Utility drawing pad:

Figure 49. QuickSense XY Display Utility View Menu


3.8.1.1. Status Bar When checked, this option will enable the status bar at the bottom of the program. The status bar reports the device connection information and coordinate locations. 3.8.1.2. Change Pad Scale This option allows the drawing area to be scaled larger or smaller. 3.8.1.3. Change Pen Width This option scales the size of the pen point used in the drawing area. The default value is 5. A size of 1 will display a 1 pixel pen point that represents 1 X and 1 Y unit size. 3.8.1.4. Change Pad Drawing Options This option allows the cursor to be gray or colored in both point or rectangle modes. The default option is Color Highlight for both modes.

36

Rev. 0.2

QuickSenseStudio-UG

NOTES:

Rev. 0.2

37

QuickSenseStudio-UG

CONTACT INFORMATION
Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 Tel: 1+(512) 416-8500 Fax: 1+(512) 416-9669 Toll Free: 1+(877) 444-3032 Please visit the Silicon Labs Technical Support web page: https://www.silabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request.

The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. Silicon Laboratories assumes no responsibility for errors and omissions, and disclaims responsibility for any consequences resulting from the use of information included herein. Additionally, Silicon Laboratories assumes no responsibility for the functioning of undescribed features or parameters. Silicon Laboratories reserves the right to make changes without further notice. Silicon Laboratories makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Silicon Laboratories 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. Silicon Laboratories products are not designed, intended, or authorized for use in applications intended to support or sustain life, or for any other application in which the failure of the Silicon Laboratories product could create a situation where personal injury or death may occur. Should Buyer purchase or use Silicon Laboratories products for any such unintended or unauthorized application, Buyer shall indemnify and hold Silicon Laboratories harmless against all claims and damages. Silicon Laboratories, Silicon Labs, and QuickSense are trademarks of Silicon Laboratories Inc. Other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders.

38

Rev. 0.2

Você também pode gostar