Sie sind auf Seite 1von 19

AN2397 CapSense Data Viewing Tools

Author: Kurian Polachan Associated Project: No Associated Part Family: CY8CMBR2xxx, CY8C201xx, CY8C20x34, CY8C20xx6A/AS/H, CY8C20xx7/S, CY8C21x34/B, CY8C24x94 Software Version: N/A Related Application Notes: AN49943 PSoC 1 USB to UART Bridge

AN2397 teaches you how to monitor data from any Cypress CapSense controller using either the I C or UART interface. With the tools described in this application note you can view and log real-time sensor data for CapSense tuning and debugging.

Contents
Introduction .......................................................................1 Overview ...........................................................................1 2 Method 1: I C to USB Bridge with Bridge Control Panel .....................................................................................1 Method 2: UART to USB Bridge with MultiChart ..........2 Selecting the Right Method ...............................................2 CapSense Express Devices .........................................2 CapSense and CapSense Plus Controllers ..................2 Step by Step Instructions for Using the Two Methods .......2 2 Method 1: I C to USB Bridge with Bridge Control Panel .....................................................................................2 Method 2: UART to USB Bridge with MultiChart for CapSense and CapSense Plus Devices ......................4 Method 2: UART to USB Bridge with MultiChart for CY8CMBR2xxx CapSense Express Devices ...............7 Enabling UART to USB Bridge using CY3240-I2USB Bridge Hardware ............................................................. 15 Converting CY3240-I2USB to UART-USB Bridge ...... 15 UART to USB Driver Installation ................................. 16

Introduction
During the CapSense design process, you will need to monitor CapSense sensor data, such as raw counts, baseline, and difference counts, for tuning and debugging. This document helps you to select the proper tool for CapSense sensor data viewing and logging. The two 2 supported communication interfaces are I C and UART. You should be familiar with CapSense sensing technology before you read this document. If you would like more information about general CapSense theory and operation, see Getting Started with CapSense. If you are designing with the CY8CMBR2xxx CapSense Express family, see Method 2: UART to USB Bridge with MultiChart for CY8CMBR2xxx CapSense Express Devices. This presents step-by-step instructions for logging data for the Design Toolbox. If you are designing with PSoC 3 or PSoC 5, refer to the section Tuner GUI in PSoC 3 and PSoC 5 CapSense Design Guide.

Overview
There are two methods to collect and chart the sensor data. Which one you use depends on the communication 2 interface available: I C or UART.

Method 1: I2C to USB Bridge with Bridge Control Panel


Tools required: CY3240-I2USB (I C to USB Bridge) Bridge Control Panel (Charting tool)
2

In this method, data is read from the CapSense controller 2 through the I C interface and is transmitted to the PC 2 through USB using the CY3240-I2USB (I C to USB converter). On the PC side, you use the Bridge Control Panel to view and log the data. Bridge Control Panel is a charting tool installed together with PSoC Programmer.

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

Figure 1. Reading Data from the CapSense Controller Method 1


Bridge Control Panel

Table 1. Comparing the Two Methods


Comparison Matrices Method 1 (I2C - USB) CY8C20x34, CY8C20xx6A/AS/H, CY8C20xx7/S, CY8C21x34/B, CY8C24x94 2 Yes Yes Method 2 (UART - USB) CY8C20x34, CY8C20xx6A/AS/H, CY8C20xx7/S, CY8C21x34/B, CY8C24x94 1 No No

CapSense Controller

I2C

I2C to USB Bridge

USB

Devices Supported [1]

Method 2: UART to USB Bridge with MultiChart


Tools required: CY3240-I2USB (converted to UART to USB Bridge) or RS232-Level Translator MultiChart (Charting tool)

Dedicated Pins Required [ 2] Data Loss [ 3,4] Bidirectional Communication Support [5]

In this method, data is read from the CapSense controller through an RS232 interface and is transmitted to the PC using USB. This is done using the UART to USB Bridge. On the PC side, you use MultiChart (charting tool) to view and log the data. Figure 2. Reading Data from the CapSense Controller Method 2
RS232

Step by Step Instructions for Using the Two Methods


Method 1: I2C to USB Bridge with Bridge Control Panel
Code example 2 given in CapSense Controller Code Examples Design Guide demonstrates how to send 2 CapSense data through I C and plot it on the Bridge Control Panel. S ys t e m R e q u i r e m e n t s For system requirements see the Installation section in the PSoC Programmer Release Notes. Follow these steps to view CapSense data using Method 1. Step A: Install Bridge Control Panel 1. The Bridge Control Panel installs with PSoC Programmer. You can get the installation file and associated release note at http://www.cypress.com/programmer. After installation, open the application by going to Start > All Programs > Cypress > Bridge Control Panel [version] > Bridge Control Panel [version]

CapSense Controller

UART to USB Bridge Note (a)

MultiChart
USB

RS232 Serial Port

RS232 Level Translator Note (b)

Note RS232 data transmitted by the CapSense Controller can be sent by the PC using one of the following methods, a) b) Using a UART to USB Bridge Using an RS232 level translator (PC with an RS232 serial port required)

Selecting the Right Method


CapSense Express Devices
For the CY8CMBR2xxx device family, use method 2 to read back the CapSense sensor data. A step-by-step procedure is given later in this application note. For the CY8C201xx device family, the CapSense data viewing tool is integrated directly into PSoC Designer (version 5.0 SP6).

2.

1 Both methods can be used to read data from CapSense and CapSense Plus controllers CY8C20x34, CY8C20xx6A/AS/H, CY8C20xx7/S, CY8C21x34/B, and CY8C24x94. 2

Method 1 requires two free port pins (I2C) from the CapSense controller. Method 2 needs only one pin, the transmitter pin of the TX8 user module. In method 1, the PC reads data from the CapSense controller asynchronously (asynchronous to CapSense scanning). In this case, samples will be lost if the CapSense scanning rate is higher than the rate at which the PC reads data from the CapSense controller.

CapSense and CapSense Plus Controllers


For CapSense and CapSense Plus controllers, use Table 1 to decide which method to use to read back CapSense sensor data for your application.

In method 2, data from the CapSense controller is synchronously transmitted to the PC (data is transmitted after every CapSense scan). No samples are lost in this mode of communication. Method 1 allows data to be sent to the CapSense controller from the PC through the Bridge Control Panel. Method 2 does not support this.

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

Step B: Implement the I C Slave Interface in the CapSense Controller To use the I C slave interface in a PSoC project, follow these steps: 1. 2. Place the EzI2Cs User Module in the PSoC project. Set the following User Module parameters:
2

The first byte received by the I C slave is the offset into the buffer from which data is read or to which data is written. Default offset is 0. To know more about working with EzI2Cs user module, refer to user module datasheet. Note To guarantee the data integrity of variables that are two or more bytes long, check the EzI2Cs_bBusy_Flag variable before changing these variables in code. For example:
EzI2Cs_DisableInt(); if(!(EzI2Cs_bBusy_Flag == EzI2Cs_I2C_BUSY_RAM_READ)) { MyI2C_Regs.wData++; //safely increment a 2 byte variable } EzI2Cs_ResumeInt();


3.

Slave_Addr to 0 (this address can be anything from 0 to 127) Address_Type to Static ROM_Registers, in most cases, to Disable I2C Clock to 400 kHz Fast I2C Pins to P1[0]-P1[1] or P1[5]-P1[7]

Define the RAM buffer that will contain the data 2 needed for I C transmission. Define the array or structure whose address will be specified when the SetRamBuffer function is called. For example:
struct I2C_Regs { BYTE bSnsIndex; BYTE bSnsMask; WORD wRawCount; WORD wBaseline; WORD wDiffCount; WORD wCentroid; } MyI2C_Regs;

Step C: Hardware Setup Figure 1 shows how to interconnect the components together for Method 1. See the I2C-USB Bridge Guide for information about how 2 to connect the CY3240-I2USB Bridge to the I C pins of the CapSense controller. Step D: Read CapSense Sensor Data using the Bridge Control Panel Figure 3, Figure 4, and Figure 5 show screen shots of the application. Help topics are available in the Bridge Control Panel menu bar for additional information about the application user interface, supported commands, variable definition, different modes of data acquisition (Repeat Mode, To File Mode), and so on. Figure 3. Bridge Control Panel: Commands Editor View

// // // // // //

read/write value read only value read only value read only value read only value read only value

4.

Insert the following two lines into the initialization part of the program:
EzI2Cs_SetRamBuffer(sizeof(MyI2C_Regs),1, (BYTE*)&MyI2C_Regs); EzI2Cs_Start();

5.

Set the arguments of the EzI2Cs_SetRamBuffer function as required. The first argument sets the length of the data that can be read. The second sets the length of the data that can be written to. The third argument sets the address 2 of the I C buffer.

6.

Update the RAM buffer after every scan. Example:


MyI2C_Regs.bSnsMask = CSD_baSnsOnMask[0]; MyI2C_Regs.wRawCount = CSD_waSnsResult[MyI2C_Regs.bSnsIndex]; MyI2C_Regs.wBaseline = CSD_waSnsBaseline[MyI2C_Regs.bSnsIndex]; MyI2C_Regs.wDiffCount = CSD_waSnsDiff[MyI2C_Regs.bSnsIndex]; MyI2C_Regs.wCentroid = CSD_wGetCentroidPos(1);

After these steps are complete, you do not need any 2 additional code to support I C communication. The EzI2Cs 2 User Module works in the background with I C interrupt handlers. www.cypress.com
Document No. 001-41446 Rev. *D 3

CapSense Data Viewing Tools

Figure 4. Bridge Control Panel: Chart View (Plotting of RawCount and Baseline)

AN49943 describes how to implement UART to USB bridge solutions in PSoC 1. Follow these steps to view CapSense data using Method 2. Step A: Install MultiChart Copy the file MultiChart.exe into a folder. You may want to create a shortcut to this file on your desktop or in the start menu. Step B: Send Data from CapSense Controller For programmable devices, follow these steps in a PSoC Designer Project: 1. 2. Place the TX8SW user module in the PSoC Designer Project Set the following User Module Parameters:

Figure 5. Bridge Control Panel: Table View of Sensor Data

Port Pin - Select the RS232 serial transmitter pin. Baud Rate - Select baud rate from the list. Possible choices are 115200, 57600, 38400, 19200, 9600, 4800, 2400 and 1200 bits per second. Parity Set to NONE. Stop Bits Set to ONE. Data Bits Set to 8.


3.

Insert the following string into the initialization part of the program:
TX8SW_Start();

4.

The MultiChart application receives data that is divided into packets: Packet0 Packet1 PacketN

Method 2: UART to USB Bridge with MultiChart for CapSense and CapSense Plus Devices
Code example 3 given in CapSense Controller Code Examples Design Guide demonstrates how to send CapSense data through UART and plot it on Multichart. S ys t e m R e q u i r e m e n t s This method requires the following system configuration:

Each packet consists of a header, a data element, and a tail. Table 2. Data Packet Structure
Packet Element Header 0x0D 0x0A Raw Count 0 Raw Count 1 Data Baseline 0 Baseline 1 Signal 0 Signal 1 0x00 Tail 0xFF 0xFF 4 Content

A free serial communication (COM/RS232) port . Microsoft Windows 9x, 2000, XP, or 2003.

[6]

This requirement is optional if a UART to USB Bridge is used for reading serial (RS232) data. Application note

This requirement is optional if the UART to USB Bridge is used for reading serial (RS232) data.

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

The header allows the PC to divide input data flow into packets. The header consists of two bytes: a carriage return (0x0D) and a line feed (0x0A). To send the header, call the standard TX8 User Module function:
TX8SW_PutCRLF(); // Send Header

Figure 6. Main Window

The header is followed by data. The data section consists of 3 N 16-bit words, N is sensor count, N = 1...48. Each piece of data (word) represents one unsigned integer value. Data words should be ordered according to Table 2. The following code sequence sends the data section, with all sensor results in the proper order, to the PC:
TX8SW_Write((char *) (CSD_waSnsResult), CSD_TotalSensorCount*2); TX8SW_Write((char *) (CSD_waSnsBaseline), CSD_TotalSensorCount*2); TX8SW_Write((char *) (CSD_waSnsDiff), CSD_TotalSensorCount*2);

2.

Configure MultiChart Settings The major parameters that need to be configured are the COM port number and UART bit rate. To modify the settings, select Settings from the Tools menu. The settings dialog box appears as shown in Figure 7. Figure 7. Settings Dialog

For 16-bit values like RawCount, Most Significant Byte (MSB) is sent out first followed by LSB. The packet is bounded by the tail. The tail allows the application to determine the packet length. The tail consists of three bytes: 0x00 0xFF 0xFF. To send the tail, add the following code to your project:
TX8SW_PutChar(0x00); // Send Tail TX8SW_PutChar((CHAR)0xFF); TX8SW_PutChar((CHAR)0xFF);

Step C: Hardware Setup Figure 2 shows how to interconnect the components together for method 2. Follow these rules if the CY3240-I2USB Bridge is used as a UART to USB Bridge.

Connect he serial transmitter pin of the CapSense controller to I2C_SDA pin of CY3240-I2C USB Bridge. Wire the ground of CapSense controller to the GND 2 pin of CY3240-I C USB Bridge.

The Select port drop-down list allows you to select the COM port number. The application checks this setting at startup only. Connect external UART-USB adapters (if needed) before launching the application. The Port speed drop-down list selects the UART bit rate. Use the same rate you used in the PSoC Designer Project. The Visible points field specifies the number of data packets to display in the chart. When the number of packets received is greater than this value, old data is removed from the chart.

See the I2C-USB Bridge Guide for details about the CY3240-I2USB pinouts. Step D: Read CapSense Sensor Data from MultiChart To read the CapSense sensor data from MultiChart, follow these steps: 1. Open MultiChart a. Double click on the MultiChart.exe file to open the application. Figure 6 shows a screenshot of the application.

The Log file name field specifies the name and location of the log file. (You can browse and select by clicking the open file icon.) These settings are automatically saved when you close the application and are reloaded when you restart the application
5

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

3.

Monitor CapSense Data After the settings are configured, MultiChart starts plotting the received data. Figure 8 and Figure 9 show how MultiChart displays CapSense data. It uses two different views, Sensor View and Custom View. Sensor View: Monitors the results of a single sensor Custom View: Monitors the results combination of the available sensors. from any

The chart panel allows you to zoom in on and scroll around the image using the mouse. To zoom in on a chart, use the left mouse button to click and drag down and to the right to select an area of the screen. When you release the mouse button, the MultiChart tool zooms in on the area selected. To undo the zoom, click the left mouse button and drag up and to the left. When you release the mouse button, the chart will zoom back to the original area. To scroll a chart, click the right mouse button and drag in the direction you wish to scroll. Figure 10. Tool Panel Buttons

The chart panel is the main part of each tab (sensor or custom view). The vertical axis shows the received data value. The horizontal axis shows the packet number. The MultiChart application counts incoming packets and displays estimated packet rate in the status bar. The status bar also shows the active COM port number, and run and logging status. Figure 8. Main Window Sensor View

4.

Log the CapSense Data MultiChart allows read back data to be saved in different formats for future reference or post processing if needed.

5.

The tool panel buttons in the upper corner of this application help you to do this. (Figure 10)

The Stop/Continue button pause chart updates so that you can take a screen shot or observe the details of the chart. Click this button once more to resume chart updating. The Clear Chart button clears all data in both chart tabs. The Save Image button allows you to save the active chart image to a file in vector (.emf) or bitmap (.bmp) formats. The Enhanced Metafile format (.emf) is a vector format that results in a smaller image file size. The Print Image button prints the active chart image. The Copy Image to Clipboard button places an image of the active chart on the clipboard where you can paste it into another application. The Start/Stop Logging button starts and stops saving received data into a log file. When you start logging, all data received is stored in a comma separated values (.csv) file. You can open this file in a spreadsheet application for detailed analyses. The log file name is MultiChartLog.csv by default. The file name can be changed in the Settings dialog box. The log file size grows very quickly. The Advanced Chart Editor button opens a window that allows you to change almost all of the


Figure 9. Main Window Custom View

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

chart settings including series colors, and axes limits. To change data series colors: 1. 2. 3. 4. Click the Advanced Chart Editor button on the toolbar. Select the Series tab. Select the corresponding series from the drop-down menu. Click the Color button (see Figure 11) and select the desired color.

Table 3. Baud Rates Supported by CY8CMBR2xxx


CY8CMBR2xxx CY8CMBR2044 CY8CMBR2010/CY8CMBR2016 Baud Rate 117.6 Kbps 115.2 Kbps

Enabling UART to USB Bridge using CY3240-I2USB Bridge Hardware provides information about how to put together a UART to USB Bridge to read RS232 data (clocked out at 117.6 Kbps and 115.2 Kbps). Follow these steps to view CapSense data using Method 2. Step A: Install MultiChart Copy the file MultiChart.exe into a folder. You may want to create a shortcut to this file on your desktop or in the start menu. Step B: Read CapSense Sensor Data from MultiChart To read the CapSense sensor data from MultiChart, follow these steps: 1. Open MultiChart a. b. Double click on the MultiChart.exe file to open the application. Figure 12 shows a screenshot of the application.

These settings are active for current instance of the application. They are not saved. Figure 11. Advanced Chart Editor

Figure 12. Main Window

Method 2: UART to USB Bridge with MultiChart for CY8CMBR2xxx CapSense Express Devices
S ys t e m R e q u i r e m e n t s This method requires the following system configuration:

A free serial communication (COM/RS232) port . Microsoft Windows 9x, 2000, XP, or 2003.

[7]

Supported Baud Rates Unlike CapSense and CapSense Plus controllers, which can be programmed to send RS232 data at user-defined baud rates, the baud rate of CY8CMBR2xxx devices are fixed. Table 3 maps CY8CMBR2xxx devices with the supported baud rate

2.

Configure MultiChart Settings You need to configure two major parameters: the COM port number and the UART bit rate. To modify the settings, select Settings from the Tools menu. The settings dialog box appears as shown in Figure 13.

This requirement is optional if UART to USB Bridge is used for reading serial (RS232) data.

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

Figure 13. Settings Dialog

The Visible points field specifies the number of data packets to display in the chart. When the number of packets received is greater than this value, old data is removed from the chart.

The Log file name field specifies the name and location of the log file. (You can browse and select by clicking the open file icon.) These settings are automatically saved when you close the application and are reloaded when you restart the application Along with rawcount, baseline, and signal (difference count), CY8CMBR2xxx devices also transmit the following information.

The Select port drop-down list allows you to select the COM port number. The application checks this setting at startup only. Connect external UART-USB adapters (if needed) before launching the application. The Port speed drop-down list selects the UART bit rate. Use the same rate you used in the PSoC Designer Project.

Firmware revision CapSense button touch status GPO output status Parasitic capacitance of each CapSense sensor

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

Table 4, Table 5, and Table 6 show how MultiChart maps the data it receives from CY8CMBR2xxx to the rawcount, baseline, and signal variable arrays that it uses to display received data. Table 4. Data Mapping from CY8CMBR2044 to MultiChart Variable Arrays
Raw count array Sl No MSB 0 1 2 3 4 5 0x00 0x00 LSB FW_Revision CS0_Cp CS0_RawCount CS1_RawCount CS2_RawCount CS3_RawCount MSB CS_Status 0x00 LSB GPO_Status CS1_Cp CS0_Baseline CS1_Baseline CS2_Baseline CS3_Baseline MSB 0x00 0x00 LSB CS2_Cp CS3_Cp CS0_DiffCount CS1_DiffCount CS2_DiffCount CS3_DiffCount Baseline Array Signal Array

Table 5. Data Mapping from CY8CMBR2010 to MultiChart Variable Arrays


Raw count array Sl No MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0x00 LSB FW_Revision CS0_RawCount CS1_RawCount CS2_RawCount CS3_RawCount CS4_RawCount CS5_RawCount CS6_RawCount CS7_RawCount CS8_RawCount CS9_RawCount CS0_Cp CS1_Cp CS2_Cp CS3_Cp MSB 0x00 CS0_Baseline CS1_Baseline CS2_Baseline CS3_Baseline CS4_Baseline CS5_Baseline CS6_Baseline CS7_Baseline CS8_Baseline CS9_Baseline CS_Status CS4_Cp CS5_Cp CS6_Cp LSB 0x01 MSB 0x00 CS0_DiffCount CS1_DiffCount CS2_DiffCount CS3_DiffCount CS4_DiffCount CS5_DiffCount CS6_DiffCount CS7_DiffCount CS8_DiffCount CS9_DiffCount GPO_Status CS7_Cp CS8_Cp CS9_Cp LSB 0x02 Baseline Array Signal Array

www.cypress.com

Document No. 001-41446 Rev. *D

CapSense Data Viewing Tools

Table 6. Data Mapping from CY8CMBR2016 to MultiChart Variable Arrays


Raw count array Sl No MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 0x00 0x00 0x00 0x00 0x00 0x00 LSB CS0_RawCount CS1_RawCount CS2_RawCount CS3_RawCount CS4_RawCount CS5_RawCount CS6_RawCount CS7_RawCount CS8_RawCount CS9_RawCount CS10_RawCount CS11_RawCount CS12_RawCount CS13_RawCount CS14_RawCount CS15_RawCount FW_Revision CS0_Cp CS1_Cp CS2_Cp CS3_Cp CS4_Cp 0x00 0x00 0x00 0x00 0x00 MSB LSB CS0_Baseline CS1_Baseline CS2_Baseline CS3_Baseline CS4_Baseline CS5_Baseline CS6_Baseline CS7_Baseline CS8_Baseline CS9_Baseline CS10_Baseline CS11_Baseline CS12_Baseline CS13_Baseline CS14_Baseline CS15_Baseline CS_Status CS5_Cp CS6_Cp CS7_Cp CS8_Cp CS9_Cp 0x00 0x00 0x00 0x00 0x00 0x00 MSB LSB CS0_DiffCount CS1_DiffCount CS2_DiffCount CS3_DiffCount CS4_DiffCount CS5_DiffCount CS6_DiffCount CS7_DiffCount CS8_DiffCount CS9_DiffCount CS10_DiffCount CS11_DiffCount CS12_DiffCount CS13_DiffCount CS14_DiffCount CS15_DiffCount CS10_Cp CS11_Cp CS12_Cp CS13_Cp CS14_Cp CS15_Cp Baseline Array Signal Array

www.cypress.com

Document No. 001-41446 Rev. *D

10

CapSense Data Viewing Tools

Reading Data from CY8CMBR2044 CY8CMBR2044 transmits CapSense data in RS232 format (at baud rate of 117.6 Kbps) from the sensor pin, which is pulled low to GND with a 5.6-k resistor. Figure 14 shows CY8CMBR2044 configuration for use with MultiChart. Figure 14. Hardware Setup
Sensor Sensor

MultiChart

CY8CMBR2044
Sensor Sensor

RS232

UART to USB Bridge

USB

5.6KOhm

Notes 1. 2. To read data from a CY8CMBR2044 device, use a UART to USB Bridge programmed to read RS232 data at a baud rate of 117.6 Kbps. For details, see Enabling UART to USB Bridge using CY3240-I2USB Bridge Hardware. Connect the CY8CMBR2044 sensor pin that is pulled low to GND to the I2C_SDA pin of the CY3240-I2C USB Bridge. Wire ground of CY8CMBR2044 to the GND pin of the CY3240-I2C USB Bridge. See the I2C-USB Bridge Guide for details about the CY3240-I2USB pin outs. For more details, including the tolerance values for the pull-down resistor, see the CY8CMBR2044 device datasheet. Example 2: Read the parasitic capacitance of CapSense sensor CS0 Select the display variable Raw Count1 in the Custom View tab (see Figure 16). LSb of the displayed result is equal to the parasitic capacitance of CS0 (see Table 4). Figure 16. CS0_CP Value Read as 8 pF

3.

Example 1: Read the CY8CMBR2044 firmware revision Select the display variable Raw Count0 in the Custom View tab (see Figure 15). The LSb (least significant bit) of the displayed result is equal to the CY8CMBR2044 firmware revision number (see Table 4). Figure 15. FW_REVISION Value Read as 03

www.cypress.com

Document No. 001-41446 Rev. *D

11

CapSense Data Viewing Tools

Example 3: Read the CapSense and GPO status Select the display variable Baseline 0 in the Custom View tab (see Figure 17). CapSense status is the MSb (most significant bit) of the displayed result. GPO status is the LSb of displayed result (see Table 4). Figure 17. CapSense Status1 = 08 (MSb of 205610), GPO Status2 = 08 (LSb of 205610)

Notes 1. 2. CapSense status of 08 indicates that a finger is detected on CapSense sensor number 3. GPO status of 08 indicates that GPO number 3 is driven high (active low).

Example 4: Read the Signal (Difference Count) of CapSense sensor CS3 Select the display variable Signal 5 in the Custom View tab (see Figure 18). The displayed value is the sensor difference count (see Table 4). Figure 18. Displaying CS3 Difference Counts (Signal Counts)

www.cypress.com

Document No. 001-41446 Rev. *D

12

CapSense Data Viewing Tools

Reading Data from CY8CMBR2010 CY8CMBR2010 transmits CapSense data in RS232 format (at a baud rate of 115.2 Kbps) from the Delay pin, which is pulled low to GND with a 12-k resistor. Figure 19 shows how to configure CY8CMBR2010 for use with MultiChart. Figure 19. Hardware Setup

CY8CMBR2010
Delay Pin

RS232

UART to USB Bridge Note 3(a)


CY3240-I2CUSB

MultiChart
USB RS232 Serial Port

12 k

RS232 Level Translator Note 3(b)

Notes 1. 2. To read data from a CY8CMBR2010 device, use a UART to USB Bridge programmed to read RS232 data at a baud rate of 115.2 Kbps. For details, see Enabling UART to USB Bridge using CY3240-I2USB Bridge Hardware. Connect the Delay pin of the CY8CMBR2010 to the I2C_SDA pin of the CY3240-I2C USB Bridge. Wire the ground of CY8CMBR2010 to the GND pin of the CY3240-I2C USB Bridge. See the I2C-USB Bridge Guide for details about the CY3240-I2USB pinouts. RS232 data transmitted by the CY8CMBR2010 can be sent to a PC using one of the following methods, a) b) 4. Using a UART to USB Bridge Using an RS232 level translator (PC with a RS232 serial port required).

3.

For more details, including the tolerance values for the pull-down resistor, see the CY8CMBR2010 device datasheet. Figure 20. FW_REVISION Value Read as 01

Example 1: Read the CY8CBR2010 firmware revision Select the display variable Raw Count0 in the Custom View tab (see Figure 20). The LSb of the displayed result is equal to the CY8CMBR2010 firmware revision number (see Table 5).

www.cypress.com

Document No. 001-41446 Rev. *D

13

CapSense Data Viewing Tools

Example 2: Read the parasitic capacitance of CapSense sensor CS0 Select the display variable Raw Count11 in the Custom View tab (see Figure 21). The LSb of the displayed result is equal to the parasitic capacitance of CS0 (see Table 5).

Figure 21. CS0_CP Value Read as 14 pF

Reading Data from CY8CMBR2016 CY8CMBR2016 transmits CapSense data in RS232 format (at a baud rate of 115.2 Kbps) from the Debug pin, which is pulled low to GND with a 5.6-k resistor. Figure 22 shows how to configure CY8CMBR2016 for use with MultiChart. Figure 22. Hardware Setup

CY8CMBR2016
Delay Pin

RS232

UART to USB Bridge Note 3(a)


CY3240-I2CUSB

MultiChart
USB RS232 Serial Port

5.6 k

RS232 Level Translator Note 3(b)

Notes 1. 2. To read data from a CY8CMBR2016 device, use a UART to USB Bridge programmed to read RS232 data at a baud rate of 115.2 Kbps. For details, see Enabling UART to USB Bridge using CY3240-I2USB Bridge Hardware. Connect the Debug pin of the CY8CMBR2016 to the I2C_SDA pin of CY3240-I2USB Bridge. Wire the ground of CY8CMBR2016 to the GND pin of the CY3240-I2USB Bridge. See the I2C-USB Bridge Guide for details about the CY3240-I2USB pinouts. RS232 data transmitted by the CY8CMBR2016 can be sent to a PC using one of the following methods, a) b) 4. Using a UART to USB Bridge Using a RS232 level translator (PC with a RS232 serial port required).

3.

For more details including the tolerance values for the pull down resistor, see the CY8CMBR2016 device datasheet

www.cypress.com

Document No. 001-41446 Rev. *D

14

CapSense Data Viewing Tools

Example 1: Read the CY8CBR2016 firmware revision Select the display variable Raw Count16 in the Custom View tab (see Figure 23). The LSb of the displayed result is equal to the CY8CMBR2016 firmware revision number (see Table 5). Figure 23. FW_REVISION Value Read as 01

Example 3: Read the signal (difference count) of CapSense sensor CS1 Select the display variable Signal 1 in the Custom View tab (see Figure 25). Displayed value is the sensor difference count (see Table 5). Figure 25. Displaying CS1 Difference Counts (Signal Counts)

Example 2: Read the parasitic capacitance of CapSense sensor CS2 Select the display variable Raw Count19 in the Custom View tab (see Figure 24). The LSb of the displayed result is equal to the parasitic capacitance of CS2 (see Table 5). Figure 24. CS2_Cp Value Read as 9 pF

Enabling UART to USB Bridge using CY3240-I2USB Bridge Hardware


This section covers two topics,

How to convert CY3240-I2USB Bridge hardware to work as an UART to USB bridge to read RS232 data clocked out at 117.6 Kbps and 115.2 Kbps Step by step instruction for installing the UART to USB driver

Converting CY3240-I2USB to UART-USB Bridge


Program the CY3240-I2USB UART_TO_USB.hex file. bridge hardware with

Get this file from BaudRate117.6_UART_TO_USB.zip file for reading RS232 data clocked at 117.6Kb/s. Get this file from BaudRate115.2_UART_TO_USB.zip file for reading RS232 data clocked at 115.2Kb/s. For details on how to program the bridge see I2C-USB Bridge Guide, section 3.2.1.

www.cypress.com

Document No. 001-41446 Rev. *D

15

CapSense Data Viewing Tools

UART to USB Driver Installation


1. After you have finished programming, connect the CY3240-I2USB bridge hardware to the PC USB port. When the device is first connected to the PC, the new hardware wizard starts. Figure 26. New Hardware Wizard Step A

Figure 28. New Hardware Wizard Step C

4.

Select Search for the best driver in these locations, and Include this location in the search and set the path to point to the folder containing the UART_TO_USB.hex file. Click Next. Figure 29. New Hardware Wizard Step D

2.

Select No, not this time and click Next. Figure 27. New Hardware Wizard Step B

5. 3. Select Install from a list or specific location (Advanced) and click Next.

Click Continue Anyway.

www.cypress.com

Document No. 001-41446 Rev. *D

16

CapSense Data Viewing Tools

Figure 30. New Hardware Wizard Step E

About the Author


Name: Title: Contact: Kurian Polachan Sr. Applications Engineer kpol@cypress.com

6.

Click Finish to complete the driver installation.

www.cypress.com

Document No. 001-41446 Rev. *D

17

CapSense Data Viewing Tools

Document History
Document Title: CapSense Data Viewing Tools AN2397 Document Number: 001-41446
Revision ** *A ECN 1541809 3124643 Orig. of Change KPOL ARVM Submission Date 10/09/2007 01/03/2011 New application note Included CY8C20xx6A in the "Associated Part Family". Fixed the broken links. Deleted references to CSR UM Complete rewrite Updated template to current Cypress standards. Fixed typos. *D 3804024 VAIR 11/06/2012 Added CY8C20xx7/S. Updated links to code examples. Added link to PSoC 3 and PSoC 5 Tuner GUI. Description of Change

*B *C

3404186 3461633

KPOL KPOL

10/14/2011 12/21/2011

www.cypress.com

Document No. 001-41446 Rev. *D

18

CapSense Data Viewing Tools

Worldwide Sales and Design Support


Cypress maintains a worldwide network of offices, solution centers, manufacturers representatives, and distributors. To find the office closest to you, visit us at Cypress Locations.

Products
Automotive Clocks & Buffers Interface Lighting & Power Control Memory PSoC Touch Sensing USB Controllers Wireless/RF cypress.com/go/automotive cypress.com/go/clocks cypress.com/go/interface cypress.com/go/powerpsoc cypress.com/go/plc cypress.com/go/memory cypress.com/go/psoc cypress.com/go/touch cypress.com/go/usb cypress.com/go/wireless

PSoC Solutions
psoc.cypress.com/solutions PSoC 1 | PSoC 3 | PSoC 5

Cypress Developer Community


Community | Forums | Blogs | Video | Training

Technical Support
cypress.com/go/support

PSoC and CapSense are the registered trademarks of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone Fax Website : 408-943-2600 : 408-943-4730 : www.cypress.com

Cypress Semiconductor Corporation, 2007-2012. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement.

www.cypress.com

Document No. 001-41446 Rev. *D

19

Das könnte Ihnen auch gefallen