PSoC™ 4 Forum Discussions
dear all,
i am using CY8C4245AXI-483. i want to measure frequency from 48Hz to 15000Hz.
at present i am using TCPWM_P4 AS TIMER WITH RELOAD AND CAPTURE ON RISING EDGE WITH CAPTURE AND TC INT.
THIS WORKS FINE BUT I WANT FREQUENCY MEASUREMENT FROM 4000 TO 15000 Hz WITH RESOLUTION OF ATLEAST +/-5Hz.
I WAS TRYING 32 BIT UDB COMPONENT FOR CAPTURING. BUT CONFUSED REGARDING CAPT. VAL AND ISR ROUT.
PL. HELP.
Show LessI am new to interrupts and was playing recent days to improve on a previous design of timer-box.
I successfully got some psoc4 demo with gpio pins as source and it worked. Now I am on UDB elements and irqs, however unlike the more general PWM based counter the most basic Counter lacks generated functions to reset interrupts. How do you achieve it?
So far I have:
uint8 c_r = Counter_1_ReadControlRegister();
//c_r &= ~ 1u;
c_r |= 1u;
Counter_1_WriteControlRegister(c_r);
Are those the right API functions and the value considering I am interrupting on compare of the counter! I got a bit lost with all the macros in the gen files maybe someone can give tips, 1u I derived from : Counter_1_STATUS_CMP_INT_EN_MASK;
Maybe it is a very noob question, btw so far the docs for psoc4 interrupts were really helpful.
CHeers
Show LessHi,
I'm using CYBLE-014008-00 and I have an issue with the BLE deep sleep.
Basically, I'm waking up every 40 ms to start a PWM that lasts 1 ms, get a timer sample and add it to my buffer, then I go to deepsleep until the next WDT interrupt. When I have enough samples, I send a notification with the data. The system works perfectly, but every ~45 seconds, the following line doesn't let me go to deepsleep for 125-240 ms, only to sleep.
sleepMode = CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);
I've attached a screen capture of my logic analyzer. Here are the signals :
dpslp_sleep: When CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP) returned SLEEP instead of deepsleep
dpslp_dpslp: When entering deepsleep after CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP)
sleep: when entering sleep after CyBle_EnterLPM(CYBLE_BLESS_SLEEP)
dpslp_sleep_event: when entering sleep instead of deepsleep because of a pending event in the application that requires HFCLK
PWM start: self explanatory
PWM stop: self explanatory
ADC timer: self explanatory
CyBle_Process: Before and after entering CyBle_ProcessEvents();
As you see, every ~45 seconds, the first signal (dpslp_sleep) will go to high and toggle there for a duration of 125-240 ms a couple of times, meaning that I don't go to deepsleep. I could go to sleep, but it results in peaks of current. I'd much rather go to deepsleep. Here is a zoom of the same figure:
Isn't this a really long time to not be able to go to deep sleep? Is this normal?
Thank you,
Fred
Show LessI'm using CY8CKIT 049-42xx and I'm trying to measure muscle impulses with surface electrodes. I have managed to get some kind of signal, but it is working inconsistently and dc level of the adc is different from run to run. Sometimes I can see a clear signal, sometimes nothing at all.
When it works, the dc of the signal is around 0 and signal jumps around 10-20mV, when it works badly it jumps between 50mv and 0 and it's hard to get anything cohesive out, sometimes spiking to 1024 (possibly due to bad usb connection).
I am wondering if there are flaws in my design or the way I'm using the device or is this due to bad connection and noise? I have attached the project folder. The registers show in top design aren't currently used for anything, they're just placeholder for future.
Br
Joona R
Show LessHello
I want to make a tracking system so I can trace a object's location. I think I have to interface GPS with PSOC 4 kit. but problem is that I want to see location of object on my computer. I don't understand How will computer communicate with the tracking system. I think we can do this with the help of the internet. My computer connected with internet. I think the system must be connected to the Internet. Please tell me what I required to make complete object tracking system
Hi,
I'm using the CYBLE-014008-00 and I have some problems with the TCPWM module in timer capture mode.
Basically, the timer counts the frequency of an input signal. HFCLK is at 24 MHz, and the timer is synced by a 12 MHz clock derived from HFCLK. The timer is started by the rising edge of the output of a PWM module, and the capture is on the falling edge of the same signal. The PWM has a pulse of 25 cycles of LFCLK (32768 Hz). I'm waking the device every 40 ms with the WDT to get a timer sample. During that time, I go to sleep. I wake up with the Capture interrupt of the timer, get the sample, and go to deepsleep. Once I have enough samples, I send a BLE notification with the data. I also wake up once per second to get an ADC measurement.
Everything is going well, my timer returns a pretty stable value within ±1 count between each sample. But every ~45 seconds, I get a drop of ~30 counts for one sample. With a logic analyzer, I've figured that it probably occurs when a timer is active during a BLE interval.
My question: can the BLE affect the timer? I've looked with a logic analyzer and the period of my PWM is not affected, so I don't see how the timer would be.
Thank you,
Fred
Show LessHello everyone,
A simple question: How can I power up PSoC 4 using external battery? Instead of using the USB as a power supply, I would like to connect it to batteries.
What type of batteries should be used? What is the suggested voltage and current for the PSoC 4? How are the batteries going to be connected? to which pins? What should I be aware of before I make any connections?/
Please be generous and help me with this.
Thanks,
Solomon,
Hi,
I have issus when resetting my psoc 4200L BY8c4247bzI-L479
I can attach to the running target, see where I'm in stack traces etc (and obviously program etc) , but when I hit reset I get this:
PSoC Creatro Error dbg.M0007
The run request failed. Encountered error (Timeout of SROM polling. Lost communication with chip.)
All I get when searching for this is an issue that seems to be connected to 3.1 not 4.1 as I'm running.
Previously we used a L489 and it always worked.
Any ideas?
I'm pretty new to this debug environment, so I don't really know where to start looking. The project I have is massive, with freertos, usb type c etc, so it's a bit much to push over, however I could do that on the side if you really need that. or just point me to what you would need to shed any light on this.
Kind regards
Hjalmar
Show LessHello,
it looks simple but didnt work. I want to add printf for debuging.
I used a sample code from a "BLE_Battery_Level" example project.
I have a debug.c file with the following code.
#include <project.h>
#include <stdio.h>
#include "main.h"
/* For GCC compiler revise _write() function for printf functionality */
int _write(int file, char *ptr, int len)
{
int i;
file = file;
for (i = 0; i < len; i++)
{
UART_DEB_PutChar(*ptr++);
}
return len;
}
And in my main.h the following
#include <project.h>
#include <stdio.h>
#if (DEBUG_UART_ENABLED == ENABLED)
#define DBG_PRINTF(...) (printf(__VA_ARGS__))
#else
#define DBG_PRINTF(...)
#endif /* (DEBUG_UART_ENABLED == ENABLED) */
I cant find any different setting in the project build settings. But it will not work.
Any idea?
Thanks a lot
Max
Show Less