Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Using Bridge Control Panel to view CAPSENSE™ data

Using Bridge Control Panel to view CAPSENSE™ data

Sharwari
Employee
Employee
First question asked Welcome!

This KBA describes the steps to establish communication between the Bridge Control Panel (BCP) software and a CAPSENSE™ tuner-based PSoC™ 4000T firmware using the EZI2C Communication protocol. BCP enables the user to configure, optimize, debug, and tune devices as well as acquire and chart data from them. BCP is automatically installed with PSoC™ Programmer 3.29.0. This KBA explains this process using the CY8CKIT040T kit and CE235178 - PSoC™ 4: MSCLP self-capacitance button tuning code example.

As shown in Figure 1, PSoC™ devices (CY8CKIT-040T) communicate with BCP through KitProg3. Note that the CY8CKIT-040T kit has an onboard KitProg, so no additional connections are required other than connecting the kit to your PC, as shown in Figure 1.

Infineon_Team_1-1702633236351.png

Figure 1            Communication between BCP and CY8CKIT-040T

By default, the CY8CKIT-040T kit is programmed with CE234752 PSoC™ 4: MSCLP robust low-power liquidtolerant CAPSENSE™. If you change the application on the kit, load the CE235178 - PSoC™ 4: MSCLP selfcapacitance button tuning on the kit before proceeding. 

See the “Create an application” section in “002-35659: ModusToolbox™ PSoC™ 4000T beta support quick start guide”. This section explains the process to load any CE on this kit. Make sure to run the Select_I2C batch file after loading the CE into the kit to enable I2C communication between the onboard KitProg and BCP. For more details on how to switch to I2C mode, see the “Steps to use the required interface on the analog multiplexer” section in “002-34870: CY8CKIT-040T PSoC™ 4000T CAPSENSE™ evaluation kit guide”.

To view the CAPSENSE™ data for active widgets using BCP, do the following. See the BCP Help for more information.

Note:                 To view the CAPSENSE™ data for low-power widgets, use CAPSENSE™ Tuner. 

  1. Start BCP, connect the device to BCP by selecting the “KitProg3” from the available ports, and ensure that I2C protocol is selected.
  2. Click List as shown in Figure 2, which provides the 7-bit address of the device (08 in this case).
Infineon_Team_2-1702633287376.jpeg

Figure 2            Connecting to BCP

3. Enter read or write commands (as shown in Figure 3) in the Editor tab of BCP. The following command accesses the BUTTON_SNS0 raw count register offset and reads the button sensors’ raw count value.

Infineon_Team_5-1702633476630.png

Figure 3            Command for reading button sensor raw count

As shown in Figure 3, the 2-byte offset address of the BUTTON_SNS0_RAW0_OFFSET register is a hexadecimal conversion of 92, which can be seen in Figure 5. The symbol “@” is used for variable byte reservation and is also used for viewing the variable in chart view. 

Note:                 The read operation always starts from the base address set by the most recent write operation.

4. As shown in Figure 4, define the btn_rc variable in Variable Settings. After entering the command and defining the variable, select the editor command in the Editor tab and click Repeat (see Figure 4).

Infineon_Team_3-1702633349892.jpeg

Figure 4            Defining variables and running command

5. To view the raw count data plot, switch to the Chart tab.

6. Before making any change in commands, variables, or project settings, click Stop and Reset.

This KBA includes .iic and .ini files that can be used directly for CE235178 and CE234752. To open these files in  BCP, go to:

  • File > Open File and select the .iic file
  • Chart > Variable Settings > Load and select the .ini file

After loading the files, select the commands and click Repeat. The data can then be viewed in the Chart tab.

Note:                CAPSENSE™ parameters and sensor data can be accessed from the cy_capsense_tuner data structure; therefore, make sure to initialize CAPSENSE™ tuner (initialize_capsense_tuner()) in your project.

To update the commands for different sensors or read different sensor values, use the following data to write custom commands as shown in Figure 3:

  • Slave address: This is set in the EZI2C Peripheral settings in the Device Configurator and can be set to different address as well. The slave address can be viewed in BCP (see Figure 2).
  • Offset address: This is set this in the cycfg_capsense.h file in the Generated Source folder (in {Application root directory}/bsps/TARGET_APP_<BSP-NAME>/config) inside the ModusToolbox™ project. This file consists of RAM data structure register definitions and is specific to the sensor configuration set in current project.

Therefore, the offset address of each widget can vary across projects. Make sure to verify the offset address everytime. The offset address provides the macro value, size, and offset address location of each widget or sensor parameter (see Figure 5).

Note:                 The macros to read the register values are in the

CY_CAPSENSE_<widget_name>_<value>_OFFSET format.

Infineon_Team_4-1702633411656.png

Figure 5            cycfg_capsense.h file showing the offset address location

0 Likes
132 Views
Contributors