PSoC™ Creator & Designer Forum Discussions
I am trying to have the LED stay on for 5 seconds after I push the button on the cy8ckit-049-42xx prototyping kit.Currently, it works the first time I push the button but the next time the LED stays on forever. I am using Win 7 and PSoC Creator 4.1.
Here is the relevant code.
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
My_Timer_Enable();
int Flag = 0;
//LED_Write(1);
for(;;)
{
LED_Write(0);
if(!SW2_Read() && !Flag)
{
My_Timer_Start();
Flag = 1;
}
while((My_Timer_ReadCounter()>0)&&Flag)
{
LED_Write(1);
CyDelay(100);
}
if(My_Timer_ReadCounter()<1)
{
Flag=0;
// My_Timer_Init(); // Makes no difference
}
}
}
I have attached the code bundle.
Thank you for your kind help.
Show LessI can't seem to get 4.1 to work creating one of the sample projects... E.g.:
1. File/New/Project
2. Target Kit: (Last used: CY8KIT-059 (PSoC 5LP) [Next]
3. Choose "Code Example" [Next]
4. Choose "USBFS_AUDIO_PSoC3_5LP" [Next]
Observed: Message saying "No code example has been selected", title: PSocCreator Error prj.M0292. Details say: The current step in the new project creation wizard contains errors. You cannot continue to the next page until they are fixed. See the error message for details.
This seems to work in PSoC Creator 3.3 SP 2
Show LessI created a design for a CYBLE-222014-01 which includes a TCPWM moduse set up as a timer; it has a 32 kHz clock input and 1x presaclar. The period is 256 and the compare is 128 with interrupt on terminal count. I connected an ISR which I called Timer_ISR to the interrupt output.
My ISR code includes a simple LED toggle...
LED_1_Write( ~ LED_1_Read() );
Which works in main.c if I just add a 500 mS delay to the loop but when I copy that code in the ISR routine for LED2, which should be being called at 250 Hz, it seems to be called at around 300 kHz (I see a 150 kHz clock going to LED_2) and LED_1 doesn't flash any more. Here's my code for the ISR in Timer_ISR.c
CY_ISR(Timer_ISR_Interrupt)
{
#ifdef Timer_ISR_INTERRUPT_INTERRUPT_CALLBACK
Timer_ISR_Interrupt_InterruptCallback();
#endif /* Timer_ISR_INTERRUPT_INTERRUPT_CALLBACK */
/* Place your Interrupt code here. */
/* `#START Timer_ISR_Interrupt` */
LED_2_Write( ~ LED_2_Read() );
Timer_ISR_ClearPending(); // Read to clear status register
/* `#END` */
}
I think the issue is that I'm not clearing the Timer_ISR interrupt flag so, once it triggers, it keeps getting re-called. I've tried Timer_ISR_GetState(); in place of the Timer_ISR_ClearPending(); line but so far no joy. There seems to be an address defined of Timer_ISR_INTC_CLR_EN but I'm not sure if that's the one to use or how to use it.
Any help appreciated.
Show LessThis memo documents and distributes a 2nd order Cascaded Intergrator Comb (CIC) decimation filter implemented in a 16 bit datapath (also called a Sinc^2 decimator). The decimator supports decimation rates as low as 2 and as high as 128, producing effective resolutions of up to 10.5 bits when used with a first order Delta Sigma modulator and raw results as large as +/- 16,384, the equivalent of a signed 15 bit number at a decimation rate of 128. The decimator requires a maximum of 8 clock cycles to complete a calculation, requiring a clock 8 times faster than the modulator clock. When combined with the SC/CT modulator at the maximum modulator clock rate of 4 Mhz, the decimator requires a 32 Mhz clock, resulting in an output sample rate from 363 Ksps with 5 bits of effective resolution, down to 31 Ksps with 10 bits of effective resolution. The decimator component includes a DMA capability file for simplifying the use of DMA with the decimator. Start() is the only API required to use the decimator.
This component is not "complete" since it lacks an official datasheet, but I am not sure when I get around to writing that so I decided to publish this "As is" since something is better than nothing. The zip file include lots of info on how I made the component, as well as something that will pass as a rudimentary datasheet. The zip file also includes the component in a .cycomp archive, an example project bundle, a scan of the UDB datapath instructions and the python simulation.
Enjoy!
Show LessI am trying to log some variables to Micrium uCProbe, for this the program requires the compiled ELF file created by Psoc Creator after the last update I get this message on ucProbe
Unable to parse ELF files with formats other than DWARF2/3 if you are using IAR, add the following compiler option: --no_dwarf4
how should I do this on creator?
thanks
Show LessIf Creator 4.1 saves a project, 4.0 is unable to open it. The project is not recognized as such, at least on my machine.
Is there any way to back up, without having to recreate the project by hand?
Show LessCreating a new project based on the Power Adapter example code project in 4.1, updating all components, and running a fresh clean and build gives me the error "No Interrupt Vector"
Has the CCG3 projects been tested with 4.1 yet?
I tried to post the full error but the forum would not let me post it, saying I triggered the spam filter. I tried reporting that it was a false positive and waited a few hours but nothing happened, so I can't post the full error.
Show LessI've searched and read other threads in this forum but I can't get this to be recognized. I want to take an ADC result and convert it to a string so I can send t out over UART.
itoa seems not to be recognized.
I'm in PSoC creator 4.1 and the compiler is GCC 4.1.0.2686
Thanks in advance.
Show Less