- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We would like to use BCP(Bridge Control Panel) with PSoC5LP.
For PSoC4, RegistorMap.h file is generated automatically but PSoC5LP is not.
Therefore, these parameters of the sensor to transmit is unknown.
If it is PSoC4, Component name is CapSense, Sensor name is BUTTON0(Initial name when added),
Raw count : CapSense_BUTTON0_SNS0_RAW0_VALUE
Baseline : CapSense_BUTTON0_SNS0_BSLN0_VALUE
Diff : CapSense_BUTTON0_SNS0_DIFF_VALUE
Signal : CapSense_SNS_STATUS0_VALUE
Where should I refer to PSoC5LP?
I searched for but I did not know the corresponding register.
Regards,
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear MaMi_1205306,
Please use the following parameters for PSoC 5
MyI2C_Regs.bSnsMask = CapSense_CSD_sensorOnMask[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wRawCount = CapSense_CSD_sensorRaw[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wBaseline = CapSense_CSD_sensorBaseline[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wDiffCount = CapSense_CSD_sensorSignal[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wCentroid = CapSense_CSD_GetCentroidPos(1);
Note: CapSense_CSD is the name alias of the CapSense component I used.
Please find the attached project file. Let us know in case you need further assistance.
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MaMi_1205306,
PSoC 5 device CSD component doesn't include a register map like PSoC 4's latest CapSense components.
To view data in BCP you need to create your own data structure containing the CapSense data that you need to view and then use BCP to read that data.
You can refer to the app note https://www.cypress.com/documentation/application-notes/an2397-psocr-1-and-capsenser-controllers-cap... section "I2C with BCP for Programmable Controllers" that is similar to PSoC 5 implementation.
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bragadeesh-san,
Thank you for your reply.
I read the application note you sent me.
However, I did not understand which parameter to use in PSoC5LP.
Do you have sample code of single button with PSoC5LP?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear MaMi_1205306,
Please use the following parameters for PSoC 5
MyI2C_Regs.bSnsMask = CapSense_CSD_sensorOnMask[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wRawCount = CapSense_CSD_sensorRaw[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wBaseline = CapSense_CSD_sensorBaseline[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wDiffCount = CapSense_CSD_sensorSignal[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wCentroid = CapSense_CSD_GetCentroidPos(1);
Note: CapSense_CSD is the name alias of the CapSense component I used.
Please find the attached project file. Let us know in case you need further assistance.
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MaMi_1205306,
CapSense_sensorOnMask[] is a discontinued variable. So you need to use CapSense_CheckIsWidgetActive to check if the button is active or not.
Difference counts gets calculated only if CapSense_UpdateEnabledBaselines(); is called. So call that API after scan is complete before reading diff counts.
I tried your code from my end baseline value is getting read by BCP. Please confirm.
Also CapSense_GetCentroidPos() can be used with PSoC 5. It gives the position of the finger in the linear slider. It works at my end. Please confirm.
Please use the following snippet:
CapSense_Start();
CapSense_InitializeAllBaselines();
for(;;)
{
CapSense_ScanEnabledWidgets();
while((CapSense_IsBusy() ==1))
{};
CapSense_UpdateEnabledBaselines();
MyI2C_Regs.bSnsMask = CapSense_CheckIsWidgetActive(MyI2C_Regs.bSnsIndex);
MyI2C_Regs.wRawCount = CapSense_sensorRaw[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wBaseline = CapSense_sensorBaseline[MyI2C_Regs.bSnsIndex];
MyI2C_Regs.wDiffCount = CapSense_sensorSignal[MyI2C_Regs.bSnsIndex];
}
BCP output:
00 -> Offset
01 -> Touch
3F FF -> Raw count
36 83 -> Baseline
FF -> Difference counts (It is saturating to FF because widget resolution is set to 8 bits by default by smartsense. Either reduce resolution or use manual tuning and set widget resolution to 16 bits to avoid diff counts saturation)
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bragadeesh-san,
Thank you for your suport.
Operation was able to be confirmed also here.
Please tell us only two additional points.
(1)
Are there any commands in PSoC5LP that apply to PSoC4 "CapSense_SNS_STATUS0_VALUE".
(2)
If you use multiple sensors, please let us know how to display other sensors.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MaMi_1205306,
There are two ways to achieve this:
1. Increase the no. of parameters in the structure, for example:
#WIDGET COUNT 5u // 5 buttons are present in your design
struct I2C_Regs
{
uint8 bSnsStatus[WIDGET COUNT]; // read only value
uint32 wRawCount[WIDGET COUNT]; // read only value
uint32 wBaseline[WIDGET COUNT]; // read only value
uint32 wDiffCount[WIDGET COUNT]; // read only value
; // read only value
} __attribute__ ((packed)) MyI2C_Regs;
or else you can use the present technique of MyI2C_Regs.bSnsIndex to read the data of the widget you like.
2. Are there any commands in PSoC5LP that apply to PSoC4 "CapSense_SNS_STATUS0_VALUE".
--> Can you please elaborate your question?
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bragadeesh-san,
1.
It seems that "#WIDGET" cannot be used with PSoC Creator.
I ’m also trying to switch the index,
Cannot write index register.
Sending a "w 08 00 01" command will result in no ack(w 08+ 00+ 01-).
2.
"CapSense_SNS_STATUS0_VALUE" of PSoC4 corresponds to a digital status of 0(sensor off) and 1(sensor on).
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After switching APIs of "EZI2C_SetBuffer1()" and "EZI2C_Start()", the sensor could be switched normally.
The following is described in AN2397
EZI2C_SetBuffer1(sizeof(MyI2C_Regs),1,(uint8*)&MyI2C_Regs);
EZI2C_Start();
However, PSoC5 does not work unless it is described below.
EZI2C_Start();
EZI2C_SetBuffer1(sizeof(MyI2C_Regs),1,(uint8*)&MyI2C_Regs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No.2 was solved by myself.
//-----------------------------------------------------------------------------------------------------------------
struct I2C_Regs
{
// ...Omission
uint8 wCentroid; // read only value [ON/OFF Status]
} MyI2C_Regs;
// ...Omission
MyI2C_Regs.wStat = CapSense_CheckIsSensorActive(MyI2C_Regs.bSnsIndex);
//-----------------------------------------------------------------------------------------------------------------
Thank you for your cooperation!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MaMi_1205306
The right sequence of EZI2C in PSoC 5 is EZI2C_Start() and then EZI2C_SetBuffer1().
Regards,
Bragadeesh
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bragadeesh-san,
Because BCP is faster than Tuner Helper, it is very good to use!
Thank you for telling us how to use.
Regards,