- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
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.
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,
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @MiNe_85951 ,
The steps are very similar to AN2397:
You need to find the list of devices in the BCP. Your Kit with address(typically) 0x08 with prompt with ACK.
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.
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.
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @MiNe_85951 ,
There is a KBA for CapSense Sensor Data monitoring using Bridge Control Panel using UART Protocol.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 */
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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @MiNe_85951 ,
The steps are very similar to AN2397:
You need to find the list of devices in the BCP. Your Kit with address(typically) 0x08 with prompt with ACK.
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.
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.
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.
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