PSoC™ 4 Forum Discussions
text.format{('custom.tabs.no.results')}
Hello,
I am a newbie with programming and I am having trouble getting my interrupts to work the way I want them to for my application. I want to send serial data over the UART to the PSoC, store the values every second, and then echo back the stored values. I am using a RX interrupt (RX FIFO not empty, priority 2) and a timer interrupt with the TC (priority 3). Attached is the TopDesign configuration. Currently, I am trying to get this code to work (just a sample code to see if I can get the interrupts to work correctly). I send the PSoC a string containing a character 'o', I should be reading only 'o' and '-', but the code always gets stuck in one of the interrupts with the other one never working. Could anyone tell me what I am doing incorrectly? Much appreciated!
Attached is the Top Design. The board is CY8CKIT-042
#include <project.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
uint16 ms_count = 0;
uint8 ch;
CY_ISR_PROTO(Timer_ISR);
CY_ISR_PROTO(RX_ISR);
CY_ISR(Timer_ISR){//Every millisecond, the code goes here
ms_count++;
if (ms_count == 1000){//Every second
ms_count = 0;
LED_Write(!LED_Read());
while(ch != 'o')UART_UartPutChar('-');
}
}
CY_ISR(RX_ISR){
uint8 status = UART_rx_ClearInterrupt();//Clear interrupt flag
uint8 sub;
sub = UART_UartGetChar();
if (sub != 0u){//Make sure grabbed character is not an empty
ch = sub;
if (ch == 'o'){
UART_UartPutChar(ch);
}
}
}
int main()
{
/* Start SCB UART TX+RX operation */
Timer_1_Start();
Time_ISR_StartEx(Timer_ISR);
RX_ISR_StartEx(RX_ISR);
CyGlobalIntEnable;
/* Start SCB UART TX+RX operation */
UART_Start();
UART_UartPutString("fdssf\n");
for(;;)
{
}
}
Hi,
I am curious to know if it's possible to get access to the I/O for an SCB component. Unlike the UDB components, they are wired up to some default pins, and the I/O is not available in the schematic.
However, looking at the schematic for the SCB UART, I can see that there are nets in there that I might connect to.
My question is: If I cloned the SCB UART component, and changed the schematic, would I be able to edit it in such a way as to gain access to these nets?
Hugo
Show LessI've read several posts to understand a way of changing a device name within the application, for example, getting a string "MyName", calling CyBle_GapSetLocalName("MyName") to set it up, and calling a function to have the new name in the advertisement/scan response packages. I was wondering if calling CyBle_StoreStackData after CyBle_GapSetLocalName would lock in the changes of both LocalName and the advertisement packets after a power cycle? If not, what types of changes are saved with CyBle_StoreStackData?
Show LessI need to implement both RTC and a watchdog timer on PRoC CYBLE-022001-00
I found this example for RTC
and Day 45 project for a watchdog timer
But both of them are PSoC specific
Are there similar samples that would work on PRoC?
Or how can the existing samples be modified to work on PRoC?
Thanks
Andy
Show LessHi
I want to read data from an I2C slave device (bme280) to my psoc 4 ble and then transmit these 3 measurements out over ble (cysmart initially). I get the ble configuration to some extent and definitely get the I2C configuration but I just dont get the moving of data from my I2C device out over ble. If i configure a temperature service in BLE, how does it know to take this data from my I2C device? The 100projects 100days sample day 31 digital sensor to me seems to have an error as I can get every other sample project to work in my custom device except for this one. Any and all help greatly appreciated
Regards
Show LessHey guys,
I'm trying to implement a project that connects the BLE through a secured pairing method instead of an open connection. The Cypress examples in the 100 projects in 100 days seem to not use Key pass Authentication when it comes to the Android Implementations. Has anyone managed to do something with key pass authentication with the BLE and an Android Application?
Thanks!
Show LessHi,
I am using a CY8CKIT-049-42xx, powered by a MINIPROG-3 at 3.3V.
I have an UART with TX and RX that is connected to a Raspberry Pi (3.3V). TX is on P1.5, RX is on P1.4.
As soon as I connect the RX and TX lines (and 0V) to the Raspberry, the PSoC gets powered over these lines, even if the MINIPROG is not connected. I have not yet checked if the firmware is really up and running, at least both LEDs on the CY8CKIT are on.
When I connect the MINIPROG-3 and start debugging, the program runs fine until a character is received from the PSOC. In this case the debugger steps into UART_1_GetRxBufferSize() and never returns. It is not possible to halt the software, only stop debugging works.
The UART is configured with 16 bytes receive buffer and 16 bytes send buffer, interrupts are enabled.
Two questions:
How can I avoid the PSoC to be powered over the UART connection?
Why does the firmware get stuck in UART_1_GetRxBufferSize()?
Any ideas are welcome.
Show LessI have a custom board with a CYBLE-022001-00 and a MiniProg3
The PSoC creator sees the MiniProg3 and the CYBLE-022001-00 and I can connect to it
When I select "Attach to running target", the debug screen comes up but it appears stuck and I never reach a breakpoint in my main.c (see attached)
Also when I select "program" I get the following message
"There was an error running the Programmer to configure the device. Try lowering the clock speed used for communication in the Options dialog, under Tools > Options > Program/Debug > Port Configuration. If the problem persists, make sure that the Programmer for this debug target is properly installed and ready to use."
My clock speed is set to 1.5 MHz. I tried to lower it to 0.8 and 0.2 to no avail
Could you please help
Thank you
Andy
Hi guys, this is my first post in the forum, so please correct me if I do something wrong.
I'm using a CYBLE-014008-EVAL with the CY8CKIT-042-BLE.
I'm communicating with 4 ADS1115 via I2C in a rather complicate ambient (I2C communications are going to fail due to inducted errors from time to time). The problem is that in the source generated code for the I2C SCBs, there are several while loops where my program gets stuck.
I wanted to do something to restart the process when I2C fails, but I can't modify the source code without it getting restored every time I rebuild the project. Is there anything in the API I haven't found which could help me? If not, is there any way I can modify the source code (I already tried this: http://www.cypress.com/knowledge-base-article/avoiding-changes-source-file-get-overwritten-psoc-creator )?
I would also like to know which of the ADCs has failed and send some kind of error, but I'm stuck in the same problem as before.
Thanks in advance..and great job! This is a great community
PD: I can't attach the project due to the matter of it. I can paste some parts of the code if needed though.
Show LessHello everyone, and thanks again for your previous support, nowadays I will start working with RTOS, in this case I will use FreeRTOS, application using PSoC 4 BLE module, so for that reason I have come up with several questions such as the following:
- What will change when the FreeRTOS gets loaded inside the PSoC 4 BLE?
- Would be a difference in the way that the PSoC 4 BLE is programmed using PSoC creator?, in other words, would I still be able to program it using PSoC creator?
- How can I upload the FreeRTOS to the target device (PSoC 4 BLE)?
- Once the FreeRTOS is uploaded; how can I program the PSoC 4 BLE in other to include the "Priority scheduling (i.e., event driven)" and "Time sharing (i.e., round robin)"?
Thanks very much indeed for all your future help
Show Less