PSoC™ 4 Forum Discussions
IC : CY8C4245AXI-483
for testing i take 2 capsense and 4 led,
toggle LED when I touch.
if i use CapSence CSD [v2.60] then all work fine.
#include "project.h"
unsigned char status=0,flag[10];
int main(void)
{
CyGlobalIntEnable;
OF_01_Write(1);OF_02_Write(1); //white led on
CapSense_Start();
CapSense_InitializeAllBaselines();
for(;;)
{
CapSense_UpdateEnabledBaselines();
CapSense_ScanEnabledWidgets();
while(CapSense_IsBusy());
status=CapSense_CheckIsWidgetActive(CapSense_SENSOR_BUTTON01__BTN);
if(status==1)
{
if(flag[1]==0) {flag[1]=1;ON_01_Write(1);OF_01_Write(0);CyDelay(2);}
else {flag[1]=0;ON_01_Write(0);OF_01_Write(1);CyDelay(2);}
while(status==1)
{
CapSense_UpdateEnabledBaselines();
CapSense_ScanEnabledWidgets();
while(CapSense_IsBusy());
status = CapSense_CheckIsWidgetActive(CapSense_SENSOR_BUTTON01__BTN);
}
}
status=CapSense_CheckIsWidgetActive(CapSense_SENSOR_BUTTON02__BTN);
if(status==1)
{
if(flag[2]==0) {flag[2]=1;ON_02_Write(1);OF_02_Write(0);CyDelay(2);}
else {flag[2]=0;ON_02_Write(0);OF_02_Write(1);CyDelay(2);}
while(status==1)
{
CapSense_UpdateEnabledBaselines();
CapSense_ScanEnabledWidgets();
while(CapSense_IsBusy());
status = CapSense_CheckIsWidgetActive(CapSense_SENSOR_BUTTON02__BTN);
}
}
}
}
all work fine in above code (both touch button work )
now i replace CapSense CSD[v2.60] to CapSense [v5.0]
and i change API as per migration guide.
#include "project.h"
unsigned char status=0,flag[10];
int main(void)
{
CyGlobalIntEnable;
OF_01_Write(1);OF_02_Write(1);
CapSense_Start();
CapSense_InitializeAllBaselines();
for(;;)
{
//CapSense_ClearSensors();
CapSense_ProcessAllWidgets();
CapSense_ScanAllWidgets();
while(CapSense_IsBusy());
status=CapSense_IsWidgetActive(CapSense_BUTTON01_WDGT_ID);
if(status==1)
{
if(flag[1]==0) {flag[1]=1;ON_01_Write(1);OF_01_Write(0);CyDelay(2);}
else {flag[1]=0;ON_01_Write(0);OF_01_Write(1);CyDelay(2);}
while(status==1)
{
CapSense_ProcessAllWidgets();
CapSense_ScanAllWidgets();
while(CapSense_IsBusy());
status = CapSense_IsWidgetActive(CapSense_BUTTON01_WDGT_ID);
}
}
status=CapSense_IsWidgetActive(CapSense_BUTTON02_WDGT_ID);
if(status==1)
{
if(flag[2]==0) {flag[2]=1;ON_01_Write(1);OF_01_Write(0);CyDelay(2);}
else {flag[2]=0;ON_01_Write(0);OF_01_Write(1);CyDelay(2);}
while(status==1)
{
CapSense_ProcessAllWidgets();
CapSense_ScanAllWidgets();
while(CapSense_IsBusy());
status = CapSense_IsWidgetActive(CapSense_BUTTON02_WDGT_ID);
}
}
}
}
In both code same pins are take for capsnese and leds.
but Only 1st button working,2nd not working.(in CapSense [v5.0])
what's i am doing wrong ?any one help me ?
both code is attached.
Show LessHello everyone,
I'm trying to combine 3 aspects from different example projects into one project. - RGB control - Battery level measurement - Temperature simulation
When I try to build the project and error message is displayed, stating that the main.h file can't be found. I don't know why this error is being shown.
I've attached my project to this post. If anyone could help me out with this problem I'd be really grateful, Thanks.
Kind regards,
Alisha Khan
Show LessBelow, the same sentences are written in English and Japanese.
・English
AN 88619 PSoC 4 Hardware Design Considerations states "large sink current".
What is the specific mA for "large sink current"?
・日本語(Japanese)
AN88619 PSoC 4 Hardware Design Considerations に「large sink current」と記載あります。
「large sink current」は具体的に何mAでしょうか?
Regard
Show LessIn case of VDDA >> VDDD is it possible to separate analog supply from digital one e.g connecting VDDA to 5V and then derive 1.8V VDDD with a dc/dc converter?
Thank you
Vittorio
Show LessBelow, the same sentences are written in English and Japanese.
・English
The proximity sensor is planned to be used in the pattern (a)"Bar Proximity Sensor" in the following figure.
(a) Is there an example of proximity sensing distance of pattern?
・日本語(japanese)
以下図の(a)棒型近接センサパターンで、近接センサ使用予定です。
(a)パターンの近接センシング距離の例ございますでしょうか?
・English
(b) For the "Loop Proximity Sensor" pattern, the graph below is shown.
Does (a) also apply to the graphs below?
・日本語(japanese)
(b)ループ型近接センサパターンの場合は、以下グラフあります。
(a)も以下グラフに当てはまりますか?
Show Less
I am implementing the Dynamic Broadcaster, and can see that the buffers for the CYBLE_GAPP_DISC_MODE_INFO_T advertData shows the correct data has been loaded in the data structure, and the scan response structure, via the watch window of the emulator,
Here is my call to update:
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)
{
advPayload[18] = accel_data[0];
advPayload[19] = accel_data[1];
advPayload[20] = accel_data[2];
advPayload[21] = accel_data[3];
advPayload[22] = accel_data[4];
advPayload[23] = accel_data[5];
CyBle_GapUpdateAdvData(advertData.advData, advertData.scanRspData);
CyBle_ProcessEvents();
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
// send out uart
#ifdef DEBUG_UART_ENABLED
DBG_PRINTF("\r\t\t\t\t\t\t X:%i %i Y: %i %i Z: %i %i \r\n",advPayload[18],advPayload[19],advPayload[20],advPayload[21],advPayload[22],advPayload[23]);
#endif
but the stack never updates. What am I doing wrong?
But the scan in the CYSMART tool never changes from the default FF FF FF FF FF FF FF set in the BLE config dialog.
Show Less
Using EZ-BLE 4100 and GPIO P1(0) configured as pulled-down normally-low input with interrupt set to rising edge and attached to an isr component which is set to DERIVED, the device will not wakeup after going into deepsleep mode. In the debugger it works fine!
PSoC 4.0 Code segment:
isr_SW_Enable();
SW_ClearInterrupt();
isr_SW_ClearPending();
isr_SW_StartEx(&PowerOn);
CyGlobalIntEnable;
CySysPmDeepSleep();
I've tried changing the input to pulled up with falling edge and moving it to a different GPIO, P3(5), with no difference. Why does the same code work without any problem in the debugger but not when programmed as stand-alone?
ps I've decided to use deepsleep instead of the preferred hibernate due to the same problem I had with detecting the pin. What goes here?
Rick
Show LessHi,
i'm chasing an example of unauthenticated pairing with encryption, but for a GAP central, not peripheral as all the examples seem to be.
kind regards,
Damian
Show Lesshi,
I have CY8CKIT-042 kit. I want to use crc component (MODBUS RTU). the CRC calculation does not match the software calculating. I didn't find mistake of crc settings.
I put attach the project copy.
Please help me! Thank you.