PSoC™ 4 Forum Discussions
Hello,
I am an engineering student, I have purchased the CY8CKIT-042-BLE kit. Well, I'm new with the kit and I am trying to write a basic code to writ and read data using an I2C Master.
To write my code, I used this driver : http://www.barth-dev.de/using-the-fram-of-the-psoc-4-ble-pioneer-kit/
What I did, is that I created new project, I put an I2C Master in the schematic and I created a header file then I copied the code from FRAM.h and past it in the new header file.
in the other hand I copied the FRAM.c code and past it into the main.c (I am not sure if this is the correct way to use the driver) when I compile I do not get any errors.
Well, my question is : this is the right way to use the driver ? If yes, If I want to write a code that write and send data from Master then read it from Slave, should I open a new void main after the driver ? and which functions should I use to read and write because I'm confused with all those functions that I find in the documentation : http://www.cypress.com/file/274551/download
Thank you very much for answering,
Saban
Hi,
I need a one shot 30 sec timer in my project with an interrupt on terminal count.
I think the timer component is configured correctly and it works as expected (counts for 30 sec and fires interrupt), when I attach the interrupt component to the "tc" output of the timer.
However, if I attach the interrupt component to the "interrupt" output, the interrupt never get fired (the ISR method is never being entered) although the counter counts down to zero and stops counting as expected being a one shot timer.
What do I miss?
Here is my design (part): https://www.dropbox.com/s/1ndrfp3wzxlobil/one-shot-timer.png?dl=0
Here is my timer config: https://www.dropbox.com/s/zx4625z1thdabub/one-shot-timer-conf.png?dl=0
Here is my code, attached you will find my test project as well:
Show Less#include <stdio.h>
#include "project.h"void readData();
void logMsg();
static char logMsgLine[255];
static uint8 isr_flag_timer_tc = 0;/**
* Timer ISR
*/
CY_ISR( Timer_Int_Handler )
{
if (Timer_ReadStatusRegister() & Timer_STATUS_TC_INT_MASK) {
isr_flag_timer_tc = 1;
}
sprintf(logMsgLine, "Interrupt %d looking for %d\n\r", Timer_ReadStatusRegister(), Timer_STATUS_TC_INT_MASK);
logMsg( logMsgLine );
}int main(void)
{CyGlobalIntEnable; /* Enable global interrupts. */
UART_Start();
Timer_Int_StartEx( Timer_Int_Handler );
for(;;)
{
readData();
}}
void readData(){
// Start the 30 sec timer
isr_flag_timer_tc = 0; // will be set to 1 on tc interrupt
Timer_Start();
Timer_Trigger_Write( 1 );// loop until 30 sec timer terminal count
while(!isr_flag_timer_tc){
// do something until 30 sec are over
sprintf(logMsgLine, " timer count %d\n\r", Timer_ReadCounter());
logMsg( logMsgLine );
CyDelay(1000);
}if (isr_flag_timer_tc) {
isr_flag_timer_tc = 0;
// stop timer
Timer_Stop();
}}
/**
* write a message to some terminal/chanel
*/
void logMsg(char* msg)
{
UART_UartPutString( msg );
}/* [] END OF FILE */
Hi
Can I get PSoC sample Central role program that can connect to Heart Rate Senser peripheral?
Beacuse I want to transfer between central and peripheral use by BLE PIONEER BASEBORAD.
Best Regards,yoshizu
Show LessHi.
I would like to get some SWO trace from CY8CKIT-046 PSoC® 4 L-Series Pioneer Kit. I'm Seggert jlink (ultra+) and J-link gdb server.
Is there any instructions how to configure the printf output to swo? I've checked this, but I don't have Keil or IAR workbench.:
http://www.cypress.com/knowledge-base-article/using-embedded-trace-macrocell-etm-kba90952
Show LessHi all,
I wrote firmware for CY8C4247-AZI controller for Capsense buttons. in that i used Capsense_CSD component design file.I want to use same code to CY8C4045AZI controller. But in component design capsense_CSD is not available. how to add Capsense_CSD component in PSOC 4000s controllers.Please let me know any solution to avoid this.
Show LessHi,
I have CY8CKIT-145-40XX PSoC 4000s prototyping kit.
Original idea was to read e.g. slider position directly from memory via EzI2C. To enable that, I updated the original CapSense V3.0 component to V3.1 to be able to export register map. I trialed the code functionality with Tuner and everything worked as usual.
To get better understanding what is transferred via I2C I was probing the communicating protocol directly with jump wires and logic analyzer. I was surprised that in every read, the whole registrymap is read through I2C, including somewhat irrelevant info such as device and config ID's..
Anyhow, I hooked Arduino as Master and tried to read directly from address SLD_POSITION 0x54, by setting pointer by writing to the same address, but alas, the reading starts always from registy position CONFIG_ID 0x00 position no matter what. I also used Bridge Control Panel without any better results. I start to get data from 0x00.
Have I understood something incorrectly? In EZI2C_Slave_V1-90_Datasheet.pdf document, at page 15, It is said in the first sentence of last paragraph "Read operations always begin at the offset data pointer provided by the most recent write operation".
As an attachment, I added a screenshot from Bridge Control Panel demonstrating the writing/reading I tried to do.
Show LessHello Community,
I want to write to my server 0x01 to activate the notifications, but when I send the command i got an error:
CYBLE_ERROR_INVALID_OPERATION
The strange part is when I try to write again, the code works, Im able to to print out the value from the server on my computer via master UART.
I attached the file
thanks David C
Show LessI have a strange problem that my MacBook could connect with the LightBlue software, while my PC is also OK with CySmart and the USB dongle. However, when using an iPhone or Samsung S7 to connect and read my BLE peripheral, it would either not able to connect, or disconnect after a few seconds.
Is there anything special about timeout etc that I should change and check?
Current I am testing with the cycling example. The last messages output from the UART is:
CYBLE_EVT_GATT_DISCONNECT_IND
CYBLE_EVT_GAP_DEVICE_DISCONNECTED
CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP, state: 3
Not quite sure how I could debug the problem. Please help me, thank you!
Show LessHi
So, I have run out of pins on the CYBLE-014008 module. I need another digital output pin.
Is it possible to change the function of an assigned pin (say a DAC output) at runtime? Or even use the SWDIO as a GPIO pin whilst retaining SWD?
Thanks.
Show Less