PSoC™ 4 Forum Discussions
Hi everyone, is it fine to call the callback function to increment the timestampgesture only once?
I read that I should call it before ProcessWidget and also before DecodeWidgetGesture, should I call it again or could just once at the beginning be enough? Maybe right before Process_Widget? Is it better 1ms or 2ms
PS, the code implements also BLE communication
This is the code, thank you
if(enbaleTrackpad != 0u)
{
/* Sets up a callback function using sysTick timer isr, the callback function
is part of the CySysTickSetCallback API */
//CALL INCREMENT TIMESTAMP CALLBACK ONLY HERE
CapSense_dsRam.timestampInterval = 1u;
///// // CapSense_dsRam.timestampInterval = 2u;
CySysTickStart();
CySysTickSetCallback(0u, CapSense_IncrementGestureTimestamp);
////// // CapSense_SetGestureTimestamp(2u);
/* Start scanning all enabled sensors */
CapSense_SetupWidget(CapSense_TOUCHPAD0_WDGT_ID);
CapSense_Scan();
/* Wait for scanning to complete */
while(CapSense_IsBusy() != 0u)
{
}
////IS IT BETTER TO INCREMENT THE TIMESTAMP GESTURE HERE????
/////// // CapSense_IncrementGestureTimestamp ();
CapSense_ProcessWidget(CapSense_TOUCHPAD0_WDGT_ID);
/* Process the trackpad X,Y and the gestures */
if(CyBle_GattGetBusStatus() == CYBLE_STACK_STATE_FREE)
{
/////////IS IT BETTER TO INCREMENT THE TIMESTAMP GESTURE HERE????
////// // CapSense_SetGestureTimestamp(2u);
///// //CapSense_IncrementGestureTimestamp ();
/* Get the gesture */
gestureID = CapSense_DecodeWidgetGestures(CapSense_TOUCHPAD0_WDGT_ID);
/* Get delta X and delta Y */
touchPos[0]=CapSense_TOUCHPAD0_POS_X_DELTA_VALUE;
touchPos[1]=CapSense_TOUCHPAD0_POS_Y_DELTA_VALUE;
touch=CapSense_IsWidgetActive(CapSense_TOUCHPAD0_WDGT_ID);
/* simulate a mouse */
if ((touch != 0u)||(gestureID != 0u))
{
SimulateMouse(gestureID);
}
else
{
touchPos[0] = 0u;
touchPos[1] = 0u;
SimulateMouse(gestureID);
}
Show LessHi, relating to the trackpad and pads dimensions, how should I change the Maximum x-axis and y-axis positions?
In the CapSense_CSD_P4_Trackpad_Gesture code example values of 395 and 395 are used, what is the choice based on?
I'm building a trackpad which is much smaller then traditional pc trackpads, its is 5 col, 6 rows, but I could also do 5x5.
In the first case should I have different values of x and y?
If the dimensions of the trackpad are lower and the relative dimension of the finger is higher should I increase the 2 parameters?
For example if my trackpad is 1/2 - 1/3 of a traditional trackpad dimension, should I increase the values from 395 to 800-1200 or decrease them by a 2 factor to 200 ??
I'm currently scanning at 16 bits resolution, 12000 Hz with a CyBle 214015-01
Thank you for the advices
Show LessHi,
I'm using CapSense Tuner to see 16 sensors on the graph view. However, I can't see the exact value of the sensor signal in the graph. It shows a value around 50,000 (16 sensors all connected with cables cause a lot of interference). Is there a way to scale the graph?
Thanks.
Show Less
On CY8CMBR3116-LQXIT is the pull-up on HI/BUZ/GPO7 mandatory ?
When HI/BUZ/GPO7 is used as inetrrupt (Active LOW) is a Floating output when HIGH ?
Or the pull-up is to avoid false triggering when powering up the device ?
Show LessGood Evening:
I am trying to use the SysTick timer which is part of the cortex M0 family. I spent some time learning how to use the registers that are part of the SysTick timer structure.
I am attaching the simple code that I am using to try and generate a 10ms ON/OFF cycle on the GPIO pin that I can capture using the Saleae Logic analyzer. According to ARM documents I should be able to take the SysClk frequency and compute a "period" for the pulse.
My SysClk is current set at 48Mhz, so a 10ms waveform can be determined by:
Reload = (10ms / Clock Period) - 1;
Reload = .01 * 48 X 10^6 - 1 ==> 479999 ticks
If I program in this value into the SysTick->LOAD register, use the fast GPIO toggle and capture the output, I am getting a pulse that is well under the expect value.
for(;;)
{
SysTick->LOAD = 479999;
SysTick->VAL = 0;
SysTick->CTRL = SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_CLKSOURCE_Msk;
while(!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk));
SysTick->CTRL = 0;
Pin_1_DR |= Pin_1_MASK; // direct register write this takes 500 nanoseconds
// there is a second block with the same parameters
Pin_1_DR &= ~Pin_1_MASK; // direct register write
}
The digital waveform capture is below.
Help would be appreciated in solving this problem.
I would like to know if I can accurately use the SysTick for microsecond times.
Thank you.
Show LessHi,
I currently have CY8CKIT-046 and trying example codes that I found on the Internet. In TopDesign section, I added a second button which has exactly same Widget Details as the first. Also ports are configured and main.c file has been edited just like the first button that is in the example code. I built the code and programmed. In CapSense Tuner, device is connected and everything looks OK. But when I try to press the buttons, one of them isn't working at all. Example code works by itself.
What should I do?
Thanks.
P.S: The attached file below is the example code.
Show LessHello,
We would like to know about SW_Tx_UART baud rate tolerance.
In case of UART(SCB mode) default oversamping(12) for IMO 24MHz, the tolerance from 115200bps is from 0.08% to 4.17%.
We hope it between about +/-2%.
So, we should set oversampling value to 16.
In case of SW_TX_UART for IMO 24MHz, what about this case?
Best regards,
Yocchi
Show LessHello.
Our customer is evaluating CY8C4247LTI-L475.
They have questions about software reset.
Please confirm and answer below questions.
Q1)
They used Reset() of Cm0Start.c in order to execute software reset.
But PSoC is frozen after it.
Is API for software reset “Reset()”?
Or should they use other API?
Should they use “CySoftwareReset” if they want to execute software reset?
(“Reset()” is not used at software reset.)
Is “Reset()” a reset command for interrupt? And should “Reset()” be used at bootloader?
(“Reset()” is used at bootloader.)
Q2)
Are there any restrictions and procedure when executing software reset?
Q3)
Is it OK to execute software reset during I2C communication?
Or are there any problems?
For example, PSoC or other I2C devices on same I2C line will hang up at restart if there is a reset before stop condition(so SDA may be locked at low level due to it), software reset is not execute correctly, etc.
Should software reset is executed after I2C communication is complete if there are any problems?
Best Regards.
Yutaka Matsubara
Show LessI'm trying to use the code example CapSense_Csd_P4_Trackpad_Gestures on a CYBLE_214015_01 (psoc 4 ble), but I keep getting a driver error when connecting it to a Windows 10 pc, after a first connection is accomplished.
I read that the code would work better with Windows 8, is there a way to have it rwork on windows 10 or do I need to modify or write any drivers?
Thank you
Show Less