PSoC™ 4 Forum Discussions
Hello,
I basically want to achieve the following behavior using WDT0 timer but in this moment I face 2 problems.
Use case: Start the WDT0 for about 10 ms (327 for match value); When expire, set a pin on 1 and start the WDT for about 0.28 ms ( 9 in match value). When this expire start ADC conversion, wait for result, start WTD0 for about 0.04ms (1 in match value). When this last time expires set the pin on 0. So basically at each 10 ms I want to create a signal on 1 for about 0.32 ms, like a clock but I want it to run also in deep sleep mode.
First problem is when set a match value < than 5 the CPU resets itself. I do not know why but with 5 in match value it is working but obvious the time is more than the 0.04ms wanted.
Second problem is caused by the interrupt priority as I expect because when run whitout any other component the 0.28 ms time is ~0.24ms and the adc conversion takes 10 uS as expected. On the other hand, when I run my application which includes other components like I2C, BLE, ADC, WDT1, etc; the time is about 0.89 ms (instead of 0.32 ms). I expect that the interrupts from I2C, BLE and others comes in and therefore delays the interrupt for WDT0. I do not need exact times, but close. So it is ok to have lets say 20-30 us delays but not 3 times the expected time.
Therefore my questions are: how to set the WDT0 interrupt to the highest priority to make my pulse? And, of course, why I cannot set a value les than 5 on math register?
Other details: Before start first the WDT0 I set this:
/* Setup WDT Counter 0 to generate interrupt on match */
CySysWdtWriteMode(CY_SYS_WDT_COUNTER0,CY_SYS_WDT_MODE_INT);
/* associate a callback to wdt interrupt */
CySysWdtSetInterruptCallback(CY_SYS_WDT_COUNTER0, WDTCompareMatchCallback);
Then When I start the WDT I do :
/* Write match count */
CySysWdtWriteMatch(CY_SYS_WDT_COUNTER0, XXX); // XXX 327, 9, 1
/* Enable clear of counter on match */
CySysWdtWriteClearOnMatch(CY_SYS_WDT_COUNTER0, 1u);
/* Enable WDT counter 0 */
CySysWdtEnable(CY_SYS_WDT_COUNTER0_MASK);
Every time I reload a match value I do
/* Stop timer */
CySysWdtDisable(CY_SYS_WDT_COUNTER0_MASK);
Thank you!
Show LessHi,
I want to create four HID joysticks and one receiver. Pressed buttons should be transferred at a maximum rate of 60 Hz (only if buttons are pressed). The minimum connection interval at BLE is 7.5 s and only one peripheral could be connected at the same time. It is possible to connect to more than one peripheral with time shifting.
What is the fastest switch rate? Is it possible to switch 4 times within 15 ms?
If not, would daisy chaining be a solution? The receiver would be the central, the first joystick a peripheral and the central for the next joystick. So every device only would have a maximum of two connections, but the lag could be too big (data of joystick 4 would have 4 connection switches).
Another question: How can I check if my HID joystick data is correct? All BLE parameters should be implemented correct if an external receiver would be used.
Thanks for your help.
Show LessI'm currently looking to use CapSense in a proximity sensing application. The hoped for range is 30 cm with a 100 Hz sample rate.
Looking at old Research, if you use a Capaciflector it may be possible to extend the range of the sensor. Basically behind the sensor you place another sensor (with a further ground plane behind that one) and at the same time send the same excitation signal to both sensors.
(It seems that it may be possible using the PSOC Mutual Capacitance mode (CSX) to send the same signals to both sensors synchronously) <- Not true.
Driving the second sensor using the Shield Signal seems like one way to emulate this technology (Synchronous with sensor signal).
On another level, we may build our own sensor, just to confirm how effective this is. Does a proximity sensor shield exist which uses the above multi-layer sensor idea, exist?
Show LessI want to plot potentiometer output values in Matlab. The plotted values are correct, but I don't like how it's plotted. I would like to get a simple ''line'', like on the picture nr.1, but my plot looks like the picture nr 2. So I don't know if that is wrong, since the values are correct but I can't get the ''line''...??? I get the ''line'' when I do the same thing with arduino.There are pictures, Matlab and PSoC code in attachments
Show LessHi, I already have a CY8CKIT-002 PSoC® MiniProg3 Program and Debug Kit http://www.cypress.com/documentation/development-kitsboards/cy8ckit-002-psoc-miniprog3-program-and-debug-kit. Choosed a http://www.cypress.com/documentation/datasheets/cyble-014008-00-ez-bletm-psocr-module for my needs...
Now i look for development kit and cannot find any differences between CY8CKIT-042-BLE Bluetooth® Low Energy (BLE) Pioneer Kit and
CY8CKIT-042-BLE-A Bluetooth® Low Energy 4.2 Compliant Pioneer Kit...
Show LessI am using CYBLE-012011-00 Chip . I want to change the operating Conditions (Operating Conditions) like VDD and VDDR to 2.0 volt current setting is 3.3 volt .( I have included screenshot )
I want to know whether changing operating conditions can damage my chip ??.
Show LessHi,
I was wondering why my "ARM GCC 4.9-2015-q1-update" does not push all ISR's working registers onto the stack.
This obviously causes any kind of random behavior and painstaking debug. I have not seen this behavior before on any other compiler. Below a code snipped of one of my ISRs (r2 and r3 are not pushed onto the stack, but used in the ISR; they are of course also used in the main program).
0x00000CA0 <PWM_Drive_ISR>:
287: * Return:
288: * void
289: *
290: *******************************************************************************/
291: CY_ISR(PWM_Drive_ISR)
292: {
0x00000CA0 push {r4, r7, lr}
0x00000CA2 sub sp, #c
0x00000CA4 add r7, sp, #0
293: uint16 curTimeStamep = 0;
0x00000CA6 adds r3, r7, #6
0x00000CA8 movs r2, #0
0x00000CAA strh r2, [r3, #0]
294: uint16 curPeriod = 0;
0x00000CAC adds r3, r7, #4
0x00000CAE movs r2, #0
0x00000CB0 strh r2, [r3, #0]
What am I missing here? I cannot believe this is a bug, but have no other explanation. Is there any other version of GCC that is available for update in PSOC Creator 4.0 (4.0.0.432).
Best,
Severin
Show LessI am new to software programming, so please frame your help response with that in mind. My problems is:
I have taken example projects code which has Functions defined in separate Named.c files containing the Function code. I have made modification to them and all works fine.
I have made up new Function Calls and Function Code within the main.c file and call them within the main for loop and all works fine.
When I take the same Function Calls and create separate .c and .h files and call them, I get the error : Build error: The command 'arm-none-eabi-gcc.exe' failed with exit code '1'. I have look at the .c and .h files for the external Function Calls that work and have, as far as I can tell, duplicated all the required #includes and void Name (void); entries .
Is there some typical step a newbie like me might not be doing beyond creating the files and trying to build?
Show Less