PSoC™ 4 Forum Discussions
From looking at the 100 projects in 100 days examples I see a lot of "printf " statements in the code. for example Day002_Heart_Rate_Sensor
I'm using the pioneer kit and was wondering if the output from these printf appear anywhere? Can I see it in a debugger, can I get it on a console somewhere? It would be extremely useful to have this feature as interrupt driven embedded development can be difficult without logic analysers etc. This is especially important for new embedded developers which I'm guessing is a traget market segment of particular interest to Cypress.
Regards
Paul
Show LessHi cypress community,
I'm trying to re-negotiate connection parameters from peripheral just after connection. To do this i'm using CyBle_L2capLeConnectionParamUpdateRequest() function in CYBLE_EVT_GATT_CONNECT_IND event.
Function return an error ( CYBLE_ERROR_NO_CONNECTION).
To avoid this error i tried to put this function later in my process loop checking cyBle_state to be sure it's connected
...same error
I don't understand why it return a non connection error....
Regards
Show LessI have a product which uses PSoC 1 which uses firmware to dynamically select 2 of many different GPIO ports to be inputs to a quadrature decoder.
This does not appear to be possible on PSoC 4. I tried looking at how the generated CYfitter.C file changes for various different ports routed to the inputs and there is no rhyme or reason behind it at all. There is a list of registers which change in what appears to be a random fashion, many of which are undocumented. The counter block which houses the decoder does have input control registers which are documented but just states bits which control "one of 16 possible inputs" which is not very helpful. The documentation mentions UDB, HSIOM and other terms but fails to documents them fully.
Does all of this mean that dynamically changing routing of GPIOs to digital blocks is not possible in Creator?
Show LessI cant find a link to download PRoC SDK,the link always goes to home page. I am having the PRoC Remote Control kit,but am unbale to work on it without that SDK. Please some one give me a link to get that.
Show LessHello,
I'm currently working with the PSoC4 Pioneer Kit and trying to interface a GLCD with two KS0108 Controllern on it.
I connected the data-port (8 bit) to Port2, a control-port (including chip-select 1 and 2, RS and RW signals) to port P1.1-P1.4, the Enable-signal to P1.0 and the Reset-Signal to +5V (the board is currently running on 5V).
V0 is tied to VLCD with an 1K potentiometer for contrast adjustment. K and A are directly connected to GND and +5V.
I always measured 4,7V but it should still be inside the range of the display.
This is my code:
#define CHIP1 0x02
#define CHIP2 0x01
#define CHIP12 0x00
#define DESELCT 0x03
#define LOW 0x00
#define HIGH 0x01
void Toggle_EnableSignal()
{
ControlPortE_Write(LOW);
CyDelayUs(5);
ControlPort_Write(HIGH);
CyDelayUs(5);
}
void P6800_SendCommandPacket(uint8 chip, uint8 cmd)
{
ControlPort_Write((chip << 2));
DataPort_Write(cmd);
Toggle_EnableSignal();
}
void P6800_SendDataPacket(uint8 chip, uint8 data)
{
ControlPort_Write((chip << 2) | 0x02);
DataPort_Write(data);
Toggle_EnableSignal();
}
int main()
{
CyDelay(3000);
P6800_SendCommandPacket(CHIP1, 0x3E); // dsp off
CyDelay(100);
P6800_SendCommandPacket(CHIP1, 0xC0); // start line
CyDelay(100);
P6800_SendCommandPacket(CHIP1, 0x3F); // dsp on
CyDelay(100);
P6800_SendCommandPacket(CHIP1, 0x40); // col select
CyDelay(100);
P6800_SendCommandPacket(CHIP1, 0xB8); // page select
CyDelay(50);
P6800_SendDataPacket(CHIP1, 0xFE); // print the letter P
P6800_SendDataPacket(CHIP1, 0x22);
P6800_SendDataPacket(CHIP1, 0x22);
P6800_SendDataPacket(CHIP1, 0x22);
P6800_SendDataPacket(CHIP1, 0x1C);
P6800_SendDataPacket(CHIP1, 0x3E);
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
for(;;)
{
/* Place your application code here. */
}
}
I measured the signals directly on the display-pins and everything seemed finde. But I only get a blue screen (backlight is on).
The delays originally have been shorter than this but I wanted to be on the save side.
I hope you can help me with my problem.
Best regards
Show LessHi guys,
I am looking into how to synchronize multiple clocks running on PSoC 4 BLE devices and one smartphone, where all device are connected to one smartphone which acts as the BLE master. The goal is to minimize phase differences, and from a user experience standpoint, the start time can be delayed by some not noticeable amount if necessary.
I am reaching out to the community because I am not sure what the best approach is to implement such a synchronization with BLE devices. Here are the alternatives I found:
1. CheepSync
To be found here (free PDF download): http://arxiv.org/abs/1501.06479
CheepSync is a closed source algorithm used to synchronize BLE devices, developed at the Indian Institute of Science by Sridhar et al. Has anyone of you heard of this one or has any experience of how well this would work?
In the paper, it is stated that a one-to-many setting can be synched, and it all looks like they solved the entire problem.
2. Berkeley Algorithm
The Berkeley Algorithm is probably a much simpler approach to the problem: The timestamps of the device clock are sent to the master (smartphone) device in a steady interval. With the assumption that the latency is equal to 1/2 of the roundtrip time, the timestamps are corrected to reflect the actual points in time when they occured.
The corrected timestamp values (including that of the phone) are averaged, and the positive or negative clock skew correction (timestamp – average) is calculated and sent to the devices. The device then applies the correction by gradually slowing or accelerating the clock.
The problem here is that I tried to implement it but got stuck at the part where the clock skew correction is applied by slowing or accelerating the clock in a gradual manner. So I can't actually say if this works. Can you?
3. A totally different approach
Can you think of one?
I'd be very grateful of any insights on how to synchronize BLE devices.
Thanks a lot in advance, I know, this forum is awesome
Julian
Show LessHello Everyone
Can anyone please help me to configure I2C interrupt? In the configuration block of I2C, there is no setting given to configure interrupt. As per my requirement, I need to interface Raspberry Pi as master with PSoC4 as slave I2C. I successfully wrote data from master to slave and read data from slave to master without using interrupt. Please find attached herewith my project of PSoC4 that does this. Now I want to develop the same functionality using interrupt programming. Any help would be highly appreciated.
Thanks and Regards
Shaunak
Show LessI am working on I2C communication between Raspberry Pi as master and PSoC4 as slave. To set PSoC4 as I2C slave, I am programming it with EZI2C Slave (SCB v3.0) component using Creator 3.2. I went through the following piece of while studying the datasheet of the component:
#define BUFFER_SIZE (0x0Au)
#define BUFFER_RW_BOUNDARY (0x04u)
uint8 ezi2cBuffer[BUFFER_SIZE];
SCB_EzI2CSetBuffer1(BUFFER_SIZE, BUFFER_RW_BOUNDARY, ezi2cBuffer);
What I could understand from the datasheet and this piece of code is that this SCB_ExI2CSetBuffer1() API sets the "ezi2cBuffer" as the buffer to which Master I2C device writes data and from which Master I2C device reads data. If I understood in this way, then I am afraid that I will get so much confused about how to set the same buffer for simultaneous read and write operations from master.
For example, I write a value "0x0000" from master Pi to slave PSoC. The slave PSoC gets this value as a command to send a string "OK" back to the master. On the reading from slave, the master gets the string "OK". If I want to execute this, I have to define separately a read buffer and a write buffer, but it is not possible as this SCB_ExI2CSetBuffer1() API only declares a single buffer for both.
Any help in understanding this and developing the comminucation would be highly appreciated.
Regards
Shaunak
Show LessI cant find a link to download PRoC SDK,the link always goes to home page. I am having the PRoC Remote Control kit,but am unbale to work on it without that SDK. Please some one give me a link to get that.
Show LessHi, as an intern student I am new at Psoc 4 and I am stuck with a problem. I have been given a project on home energy monitoring, therefore I have to make some calculations like phase difference, active and reactive power. I want use a shunt resistor with small value to measure the current passing through the system. However, because the harmonics are crucial for power calculations and we want to observe detailed features like "harmonic signatures" of the devices, we want to make like 1000 measurements per second. And the magnitude of the current is expected to be in the range of 10mA-10A. According to my employer, although the bandwidth of the current is broad, the shunt resistor approach is fine. Until here, everything is okay, but the problem is I am having trouble on these calculations. I know, I should use a SAR ADC to pass the measurements into the digital and maybe a PGA if the current is too low for ADC, but after passing to the digital I do not know how to calculate phase and power. For example, does the fact that I have to measure the current and voltage 1000 times in a minute mean that I should calculate phase and power(both active and reactive) in each time? Or is the phase difference constant as in simple circuits? As an approach, could I find the phase difference by finding when the current and voltage achieve their peak values in a period then by subtracting these values and dividing the result by the line voltage period( 1/50Hz )?
I know, I asked lots of questions and my writing is a little bit messy. I will be grateful for any help&idea,
Thanks.
Show Less