Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

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

cross mob
lock attach
Attachments are accessible only for community members.
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Dear Sirs and Madams,

 

We are currently looking into using the Bridge Control Panel for proximity sensor tuning.

I'm attaching the project "cce-mtb-psoc4-capsense-proximity.zip", which I developed CY8CKIT-145-40XX with ModusToolbox.

That project has the following:

MaMi_1205306_0-1673589156076.png

Therefore, I connected the demo kit CY8CKIT-145-40XX to my computer and checked it, but the array of data read from the Bridge Control Panel was different from the expected value.

MaMi_1205306_1-1673589427139.png

Each number is "+" and "p" and ACK is returned normally, but it seems that it is not data corresponding to raw count or baseline.

 

What steps do I need to take to see raw counts, baselines, etc. in the Bridge Control Panel?

 

We would like to read raw counts and baselines, diffs and status in the Bridge Control Panel.

If you prepare the original EZI2C register and try to set the following data in the cycfg_capsense.h” file, an error will occur.

 

#define CY_CAPSENSE_PROXIMITY0_SNS0_RAW0_VALUE (cy_capsense_tuner.sensorContext[0].raw)

#define CY_CAPSENSE_PROXIMITY0_SNS0_BSLN0_VALUE (cy_capsense_tuner.sensorContext[0].bsln)

#define CY_CAPSENSE_PROXIMITY0_SNS0_DIFF0_VALUE (cy_capsense_tuner.sensorContext[0].diff)

#define CY_CAPSENSE_PROXIMITY0_SNS0_STATUS0_VALUE

 

Regards,

 

 

0 Likes
1 Solution
PandaS
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 5 likes given

Hi @MiNe_85951 ,

The steps are very similar to AN2397:

https://www.infineon.com/dgdl/Infineon-AN2397_PSoC_1_and_CapSense_Controllers_CapSense_Data_Monitori...

You need to find the list of devices in the BCP. Your Kit with address(typically) 0x08 with prompt with ACK.

PandaS_0-1693117655544.png

Start the BCP, connect the device to BCP by selecting the “KitProg3” from available ports and ensure that I2C protocol gets selected. Click on List, this gives the 7 bit address of device (08 in this case).

Enter read/write commands in the Editor tab of the BCP. Following command accesses BUTTON_SNS0 raw count register offset and reads button sensors raw count value.

PandaS_1-1693117746759.png

The 2 byte offset address of BUTTON_SNS0_RAW0_OFFSET register is hexadecimal conversion of 92 which can be seen in cycfg_capsense.h file. Symbol @ is used for variable byte reservation and is also used for viewing the variable in chart view.

PandaS_3-1693118064704.png

Similarly, you can look for Proximity Widget macros and find the offset for it. 

Define the variable btn_rc in Variable Settings. After entering the command and defining variable, select the editor command in Editor tab and click Repeat.

PandaS_2-1693117935414.png

Switch to the Chart tab to view the raw count data plot. Click Stop and Reset before making any change in commands, variables or project settings.

Thanks and regards,

Sobhit

View solution in original post

0 Likes
3 Replies
PandaS
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 5 likes given

Hi @MiNe_85951 ,

There is a KBA for CapSense Sensor Data monitoring using Bridge Control Panel using UART Protocol.

https://community.infineon.com/t5/Knowledge-Base-Articles/CapSense-Sensor-Monitoring-and-Logging-thr...

Try to refer to this article, which is for PSoC Creator, replicate the same in ModusToolBox.

Is there any constraint of using Ez-I2C Protocol for this purpose?

Warm regards

Sobhit 

0 Likes
lock attach
Attachments are accessible only for community members.
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Sobhit-san,

 

Thank you for your response.

 

Does it mean that ModusToolbox can only use UART?

 

In the past, with PSoC5LP, projects created with reference to AN2397 could be output via I2C and read with the Bridge Control Panel.

Similarly, when I used ModusToolbox, I could not avoid the error.

 

/* AN2397 URL */

https://www.infineon.com/dgdl/Infineon-AN2397_PSoC_1_and_CapSense_Controllers_CapSense_Data_Monitori...

 

Also, since the "RegistorMap.h" file is automatically generated in PSoC4, it was possible to substitute the original I2C register and output it, but in the case of ModusToolbox, an error occurred when trying to substitute the corresponding register of "cycfg_capsense.h" file.

 

/* PSoC4 example */

// defined in the main function
uint8 I2CReg[8] = {0,0,0,0,0,0,0,0}; /* ここを16bitで指定するとHI8とLO8は使用せずダイレクトに扱える*/
uint16 Baseline, Rawcount, Signal, Status;
EZI2C_Start(); /* Initialize EZI2C block */
EZI2C_EzI2CSetBuffer1(sizeof(I2CReg), sizeof(I2CReg), (uint8*)&I2CReg);

// After the if(CapSense_NOT_BUSY == CapSense_IsBusy()){}; function
Rawcount = CapSense_BUTTON0_SNS0_RAW0_VALUE;
Baseline = CapSense_BUTTON0_SNS0_BSLN0_VALUE;
Signal = CapSense_BUTTON0_SNS0_DIFF_VALUE;
Status = CapSense_SNS_STATUS0_VALUE;
I2CReg[0] = LO8(Rawcount);/* I2CRegのが8bitだとHI8とLO8でそれぞれ入れる必要がある*/
I2CReg[1] = HI8(Rawcount);
I2CReg[2] = LO8(Baseline);
I2CReg[3] = HI8(Baseline);
I2CReg[4] = LO8(Signal);
I2CReg[5] = HI8(Signal);
I2CReg[6] = LO8(Status);

 

In the first attached project, ACK is returned normally from the Bridge Control Panel, so if you tell us the structure of the I2C register, I think that the raw count and baseline will be output as it is, but is it wrong?

 

Regards,

0 Likes
PandaS
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 5 likes given

Hi @MiNe_85951 ,

The steps are very similar to AN2397:

https://www.infineon.com/dgdl/Infineon-AN2397_PSoC_1_and_CapSense_Controllers_CapSense_Data_Monitori...

You need to find the list of devices in the BCP. Your Kit with address(typically) 0x08 with prompt with ACK.

PandaS_0-1693117655544.png

Start the BCP, connect the device to BCP by selecting the “KitProg3” from available ports and ensure that I2C protocol gets selected. Click on List, this gives the 7 bit address of device (08 in this case).

Enter read/write commands in the Editor tab of the BCP. Following command accesses BUTTON_SNS0 raw count register offset and reads button sensors raw count value.

PandaS_1-1693117746759.png

The 2 byte offset address of BUTTON_SNS0_RAW0_OFFSET register is hexadecimal conversion of 92 which can be seen in cycfg_capsense.h file. Symbol @ is used for variable byte reservation and is also used for viewing the variable in chart view.

PandaS_3-1693118064704.png

Similarly, you can look for Proximity Widget macros and find the offset for it. 

Define the variable btn_rc in Variable Settings. After entering the command and defining variable, select the editor command in Editor tab and click Repeat.

PandaS_2-1693117935414.png

Switch to the Chart tab to view the raw count data plot. Click Stop and Reset before making any change in commands, variables or project settings.

Thanks and regards,

Sobhit

0 Likes