PSoC™ 4 Forum Discussions
I have developed an Android app to interface to my Cypress BLE device.
I would like to detect a lost connection and have the app return to the "device scanning" page. Is there a proper way to detect a lost connection?
Thanks
Rich
Show LessI tried to add a question about weird behavior I'm seeing from my C code, but the "spam filter" blocked the post.
I guess it didn't like the code snippet in the body of the post. How can I ask my question?
Edit: Maybe I can edit the post enough to ask my question without including code...?
This is for a project that interfaces with an 8-bit CPU by emulating RAM/ROM.
It works, under some circumstances. There is an if statement for the ROM emulation area (based on what range is being addressed), and the other branch is for the read/write buffer area. Handling the ROM area first is to make it fast enough to execute machine language from, directly. That works, too, sort-of.
The catches are:
1. There is a Status Read() that already assures that the range addessed will be either ROM or buffer; the ROM part is if the page number is below 12. The second branch should work with just an else, and SHOULD be faster that way, but it actually causes the ROM part to fail if I don't use an else if in the buffer part.
2. I have a function that has a switch statement to do other processing based on a command passed to the last address of the buffer. Right now there is one command in there. If I add a second case to the switch statement, with some calls in that block, that will cause the "ROM" reads to become unreliable - some bytes are read correctly, and some are not.
Why should the main loop care how many sections are in the function when I'm not passing any commands or even addressing the section that might cause the function to be called? Why is an else if, with an already known area in the if, faster than a plain else?
Please help. This is really making me crazy!
Edit again: added the main loop and function in the attached text file. Hopefully you can see it. This is the current code that works... until I uncomment the other lines in req = 2.
Thanks,
Paul
Hi All,
in my on going project i will be using CYBLE-012012-10 which shall communicate to Python application running on PC.
i am planning to buy (USB 2.0 BLE v4.0) dongle to convert PC into BLE enabled device.
how will python application will communicate to BLE module?
which operating system will be suitable for my task?
any help?
thanks and regards,
sagar
Show LessHello,
I seem to be having some trouble setting up I2C, and/or formatting the data to view it over the UART. I'm hoping someone can please identify my error(s) and help me to correct them.
I am using the PSoC4 Pioneer kit.
I have connected to the SCL/SDA the corresponding pins of an MCP9808 breakout board (and +5V/GND).
MCP9808 I2C Address: 0x18
MCP9808 Temperature Register: 0x05 (2 Byte data output)
I have confirmed with a different MCU/FW setup that the MCP9808 is working correctly over I2C.
The output I2C data out (Address and Register seem to be sending correctly) I see on the scope is not data I would expect - which leads me to believe that my I2C protocol is incorrect.
The scope data is also not what I'm seeing reported in TeraTerm - so I may have data formatting issues too.
I am seeing my UART test reported in TeraTerm, so that seems to be fine.
Any guidance would be greatly appreciated! Thank you.
#include <MCP9808.h>
#include <stdio.h>
#define MCP_I2C_ADDRESS 0x18
#define MCP_REGISTER 0x05
uint32 MCP_temp[2];
void Get_Temp(void);
int main()
{
/* Initialization of Variables */
char OutputString[2];
/* Initialization / Startup */
I2C_Start();
UART_Start();
/* Enabling the Global Interrupt */
CyGlobalIntEnable;
/* Application code */
UART_UartPutString("\r\nGet Temp: CONNECTED \r\n"); //Check UART/Terminal connection
for(;;)
{
/* Call the function to get the current temp via I2C */
Get_Temp();
/* Store formatted data as string */
sprintf(OutputString, "%lu", MCP_temp);
/* Print the received temp to Hyperterminal */
UART_UartPutString(OutputString);
UART_UartPutString("\r\n");
CyDelay(1000);
}
} /* END MAIN() */
/*******************************************************************************
* Function Name : Get_Temp
********************************************************************************
* Summary:
* It receives the current temp from the MCP9808 in the Current_temp array.
*
* Parameters:
* None
*
* Return Value:
* None
*******************************************************************************/
void Get_Temp(void)
{
//Initialize Transaction for Writing
I2C_I2CMasterSendStart(MCP_I2C_ADDRESS, I2C_I2C_WRITE_XFER_MODE);
//Indicate Register to Write to
I2C_I2CMasterWriteByte(MCP_REGISTER);
I2C_I2CMasterSendRestart(MCP_I2C_ADDRESS, I2C_I2C_READ_XFER_MODE);
//Read from Register (2 Bytes, last byte NAKed)
MCP_temp[0] = I2C_I2CMasterReadByte(I2C_I2C_ACK_DATA);
MCP_temp[1] = I2C_I2CMasterReadByte(I2C_I2C_NAK_DATA);
//End Transaction
I2C_I2CMasterSendStop();
} /* END GET_TEMP */
/* END FILE */
Hi friends,
I want to use trigger option in the PWM module. My understanding from the datasheet is that the PWM output can be configured either continuous or one shot when an input is given to the trigger as input interrupt to pwm module.
Kindly support with some sample codings to achieve it.
with Thanks & Regards
K Jagatheeswaran
Show LessHi ,
I am using CY8CKIT-042 BLE (CY8C4247LQI-BL483) and i am unable to check the device address of HTS221 I2C sensor.
can I know where i am missing out.
Thanks
Srujani
Show LessHi everyone,
Recently I am having a problem with a PSoC 4 BLE that I have, my computer cannot find it. When I connect to my computer, it reads it like its a USB (681 Kb memory) and Creator does not program it.
Also LED2 STATUS is rising and falling intensity.
Did I spoil it? 😞
Show LessHello everybody,
I searched a little for the chip CY8C4248LQI_BL583 chip but I cannot find it anywhere. Do anyone of you know where can I buy this chip?
We already send to manufacture some custom PCB boards with this chip but we and also the manufacturer where unable to find the chip on the market therefore in order to continue the development we used CY8C4248LQI_BL483 which is ok because has 256kB of flash and we can use OTA update but we want to switch ti BL583.
Maybe some Cypress employees can tell me why this chip is not available and more concrete when it will be available.
Thank you!
Show LessI have a PRoC system up and running. I've created the table for BLE interface.
I can link my boards BLE to the CySmart (via the dongle) They are talking to each other.
I have some custom profiles set up to read data from my application.
My question is this (sorry if it's stupid, but I couldn't find answer) where in the code do I write my application data so it's transmitted via BLE with a read command?
I'm sure I'm missing something simple, but I'm stumped.
I found the array that appears to hold the data in BLE_1_gatt.C that is labeled "static uint8 cyBle_attValues[0x81u] = {"
do I just write data to this array for the BLE to retrieve it for read? Or is there an API method to do this?
Thanks
Show LessI have a custom BLE profile with a characteristic that has the WriteWithoutReponse box checked in the BLE component: https://snag.gy/jCQSWT.jpg
In my callback I was able to write code to handle a Write (with response) request.
I was surprised that this worked because I thought that the profile I had set up in the BLE component would have prevented this from happening. I was able to verify that I was able to Write (with response) to the device using a generic BLE app.
Is this supposed to happen? Does this mean that I can overwrite the configuration in the component in the schematic through the code? Is something else going on here?
Thank you!
Show Less