PSoC™ 4 Forum Discussions
Is there a possibility to use the BLE module as a simple UART connection (like those chinese hc-06 breakouts)?
I tried a few things but without any sucess.
Show LessHi.
i am working on PWM to generate the continous signal but after few seconds PWM stops working.
If i made a CyBle_ProcessEvents(); as commented than PWM working fine but i want to use the CyBle_ProcessEvents(); and PWM also.
please help me to resolve the issue thanks in advance.
i attached my project please find thw attachment.
Show LessThe default community standard for UART over BLE appears to be UUID = 6E400002-B5A3-F393-E0A9-E50E24DCCA9E
Does anyone have an implementation on Cypress BLE?
Thanks
Show LessHi,
I was using the component SCB_P4 3.20 as an I2C component. I updated the component to 4.0, added the timeout value to the functions, as described in the datasheet, but my code doesn't work anymore. I've compared the generated files before and after the change, but there is too much for me to pinpoint the issue. Here is my code :
#define I2C_TIMEOUT_MS (100)
int I2C_read(unsigned char *buf, int bufferSize) {
// Read must be passed the following format with expected start, restart,
// stop to be inserted
// buf[0]: ADDRESS + W
// buf[1]: REG ADDRESS
// buf[2]: ADDRESS + R
int cnt,
status = bufferSize;
uint32_t devAddr,
rdVal,
err;
// Extracting
devAddr = (uint32_t)((buf[0] >> 1) & 0x7F);
// Sending Start and address + w followed by the register address
if ( I2C_I2CMasterSendStart(devAddr, 0, I2C_TIMEOUT_MS) != I2C_I2C_MSTR_NO_ERROR ) { return -1; }
if ( I2C_I2CMasterWriteByte(buf[1], I2C_TIMEOUT_MS) != I2C_I2C_MSTR_NO_ERROR ) { return -1; }
// Sending Restart and reading data
I2C_I2CMasterReadBuf(devAddr, buf, bufferSize, I2C_I2C_MODE_COMPLETE_XFER | I2C_I2C_MODE_REPEAT_START);
while( !((err = I2C_I2CMasterStatus()) & (I2C_I2C_MSTAT_RD_CMPLT | I2C_I2C_MSTAT_ERR_XFER)) ) {
CySysPmSleep();
}
I2C_I2CMasterClearReadBuf();
return status;
}
int I2C_write(unsigned char *buf, int bufferSize) {
// Write must be passed the following format with expected start and
// stop to be inserted
// buf[0]: ADDRESS + W
// buf[1]: REG ADDRESS
// buf[2 to 2+bufferSize]: value
int cnt;
uint32_t devAddr, err;
// Extracting
devAddr = (uint32_t)((buf[0] >> 1) & 0x7F);
// Sending Start and address + w followed by the register address and then values
if ( I2C_I2CMasterSendStart(devAddr, 0, I2C_TIMEOUT_MS) != I2C_I2C_MSTR_NO_ERROR ) { return -1; }
for ( cnt = 1; cnt < bufferSize + 2; cnt++ ) {
if ( I2C_I2CMasterWriteByte(buf[cnt], I2C_TIMEOUT_MS) != I2C_I2C_MSTR_NO_ERROR ) { return -1; }
}
// Stop
if ( I2C_I2CMasterSendStop(I2C_TIMEOUT_MS) != I2C_I2C_MSTR_NO_ERROR ) { return -1; }
return bufferSize;
}
Show LessThis is a basic question... I have a custom service with multiple custom characteristics. The characteristics have various read/write permissions, some notify some do not. I am having trouble with one characteristic. It is read-only and it notifies. I am using a phone app (LightBlue) as a client.
The idea is to have the BLE peripheral provide a status to the client via this characteristic, the app can read the characteristic and receives updates via notification.
In the GeneralEventHandler I update this characteristic on the "stack on" event. When I connect the update is not there, I see the default value of the characteristic as entered in the GUI dialog.
I does not work when set to read only, but it does work when set to read/write. What am I missing?
Thanks
Rich
Show LessHi all,
I want to use SL3S4011 tag with i2c interrupt. It pull low to scl signal for a 200uS(Attached) when tag is readed from rf. I read the datasheet but I couldn't find a solution how I can detect isr signal.
I tried to show i2c pins and connect them an isr but i2c master mode don't support this mode.
Do you have any solution ?
Thank you
Show LessHi ,currently i am using PWM in my project to generate a square wave continuosly and it's working fine as per below
//ADC Initialization
ADC_Start();
ADC_StartConvert();
//PWM Initialization
PWM_Start();
UART_Start();
/* Start CYBLE component and register generic event handler */
CyBle_Start(AppCallBack);
/* Register service specific callback functions */
CyBle_BasRegisterAttrCallback(BasCallBack);
CyBle_HtsRegisterAttrCallback(HtsCallBack);
WDT_Start();
calculate_Data();
/***************************************************************************
* Main polling loop
***************************************************************************/
char temp_buf[30];
while(1)
{
#if 1
memset(temp_buf,0,sizeof(temp_buf));
calculate_Data();
sprintf(temp_buf,"hot_temp :%.2fV\r\n",value);
UART_UartPutString(temp_buf);
memset(temp_buf,0,sizeof(temp_buf));
sprintf(temp_buf,"voltage :%.2fV \r\n",value);
UART_UartPutString(temp_buf);
memset(temp_buf,0,sizeof(temp_buf));
sprintf(temp_buf,"current :%.2fV \r\n",value);
UART_UartPutString(temp_buf);
memset(temp_buf,0,sizeof(temp_buf));
sprintf(temp_buf,"pcb_Temperature_value :%.2fV \r\n",value);
UART_UartPutString(temp_buf);
CyDelay(5000);
#endif
}
but if i am using CyBle_ProcessEvents(); then PWM stop's and i am not getting any waveform as per the code shown
*********************PWM NOT working code
ADC_Start();
ADC_StartConvert();
//PWM Initialization
PWM_Start();
UART_Start();
while(1)
{
/* CyBle_ProcessEvents() allows BLE stack to process pending events */
CyBle_ProcessEvents();
// PWM_Start();
/* To achieve low power in the device */
LowPowerImplementation();
/***********************************************************************
* Wait for connection established with Central device
***********************************************************************/
if(CyBle_GetState() == CYBLE_STATE_CONNECTED)
{
/*******************************************************************
* Periodically measure a battery level and temperature and send
* results to the Client
*******************************************************************/
if(mainTimer != 0u)
{
mainTimer = 0u;
MeasureBattery();
CyBle_ProcessEvents();
if(temperatureMeasure == ENABLED)
{
MeasureTemperature();
CyBle_ProcessEvents();
}
}
}
}
}
Show LessHi, I'm quite new to this but i have this project going on and hopefully you are able to point me i the right direction. The project itself is to replace a USB module delivered from cypress, and replace it with a bluetooth connection. Transmitter and receiver. One of the measurement cards that is located inside our computer should be moved out to a wireless connection box. This connection box should be communicating wireless to our computer and I need some help to get the suitable hardware.. I'm not quite sure if I've explained it properly enough, but I really hope you guys are able to help me out.
Thanks.
Show Less