PSoC™ 4 Forum Discussions
Dear all,
I'm working on CY8C4245AXI-483 MCU. I want to write a code to toggle LED through capsense touch button. it means, initially LED is OFF. now when i touch button it should be ON. and remains ON untill i touched it 2nd time. after touching 2nd time it should be in OFF condition and remains in OFF untill i touched it 3rd time and so on.
i found code for same, somewhere on internet. is this correct or i need to change something? Please give me your valuable suggestions.
Thanks & Regards,
Prem KB
/*code starts from here*/
uint fingerpresent_0 = 0;
uint8 wdgt_active = 0;
I've been learning how to use PSoC by the tutorial vids. In lesson 4 I encountered a problem, when it came to the hardware connection between the switch and the LED.
The error is: "Pin guidance unavailable. Pin cannot be placed at X. Pin cannot be used for routed connections." for both the input and the output pin as soon as i connect them by wire in my TopDesign.
The goal would be to directly turn on the LED by pressing the switch as described in the tutorial.
Is this a configuration problem or is my board not able to do hardware connections (which I doubt).
I'm using PSoC Creator 4.4 and the CY8CKIT-149 PSoC 4100S Plus Prototyping Kit, CY8C4147AZI-S47564.
I attached the project.
I'd be very grateful for an explanation of this error and even more for a solution.
Show LessIn my application Psoc4 has to serve a device that could be configured in SPI or parallel mode during runtime. In SPI mode pin named D0 has to be configured as MTSR, D1 has to be configured as SS, D2 has to be configured as SCLK and D3 has to be configured as MRST. In parallel mode D0...D3 are part of the parallel IO (D0...D7) offering bidirectional IO. How to implement this switch on the fly?
Show LessHi All
I found the NAK Signal During the write frame.
I have attached the logic analyzer observation result for the same.
Master Device:- PIC Controller
Slave Device :- Cy8C4025AZI-S413
My Slave Address is 0x08
Ideally After Address byte their should be ACK From Slave but I observed NAK Signal.
I am not getting where is the exact mistake?
Any help will be highly appreciated.
Regards,
AsDh
Show Less
Hello there,
I implemented code in psoc 4 with uC / OS, where there are tasks and interruptions, but I had a problem with the interruption. The interrupt I created is a button. The interrupt works, but when the interruption comes to an end, the tasks return to where they left off and I would like them to return from the beginning, is there any function of uC / OS III that does this?
To access the project, open Psoc Create and then click on "file-> Open-> Project / workspace" and open the folder "Micrium\Examples\Cypress\CY8CKIT-044\OS3\PSoC\OS3.cywrk"
Show LessHello,
I am using the CYBLE-214015-01 chip to transmit x & y positional data of a trackpad to an application. In this application, I determined the time stamp when the notifications were collected. From this time stamp, I determined the frequency between consecutive notifications. In plotting the frequency spectrum, I noticed that there is a large range (between 50-1000Hz) of frequency values. I am curious if there is a logical explanation as to why the frequency between consecutive notifications is so variable.
Thank you,
Show LessHi All,
I tried to implement I2C communication between Cy8C4025AZI-S412( Slave ) and Pic Microcontroller(Master). The speed is 100kbps and used polling method. When button not pressed then it will sent 0xFF. The polling time is 100msec by PIC controller.
The issue is,
1) Sometimes acknowledge not given by Slave.(need to sent data 3 to 4 times or delay of 30ms then it gives ack ).
I used one example code to develop I2C.
My code is below,
#include <project.h>
/* Macro Declaration */
#define BUFFER_SIZE (1u)
#define PACKET_SIZE (BUFFER_SIZE)
/* The I2C Slave read and write buffers */
uint8 i2cReadBuffer [BUFFER_SIZE] = {0};
uint8 i2cWriteBuffer[BUFFER_SIZE]= {0};
uint8_t flag1=0;
uint8_t flag3=0;
void Received_Data_From_Master1();
int main()
{
/* Eneble Global Interrupt */
CyGlobalIntEnable;
CapSense_Start();
CapSense_ScanAllWidgets();
/* Start the I2C Slave And I2C Address Setting*/
I2CS_I2CSlaveInitReadBuf(i2cReadBuffer, BUFFER_SIZE);
I2CS_I2CSlaveInitWriteBuf(i2cWriteBuffer, BUFFER_SIZE);
I2CS_I2CSlaveSetAddress(0x08);
I2CS_Start();
for (;;)
{
CyDelay(2);
/* With Respect to Master i.e Checked Whether the Master Write Complted Or Not */
if (0u != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_WR_CMPLT))
{
/* Calling Function to Collect The Data From Master */
Received_Data_From_Master1();
/* Enable this above function when we used the data On Switch Function */
/* Clear the slave write buffer and status */
I2CS_I2CSlaveClearWriteBuf();
(void) I2CS_I2CSlaveClearWriteStatus();
}
if(CapSense_NOT_BUSY == CapSense_IsBusy())
{
/* API For Capsense Update Scanning And Process */
CapSense_ProcessAllWidgets(); /* Process all widgets */
CapSense_RunTuner(); /* To sync with Tuner application */
/* Checked whether Left Button Active or Not*/
if((flag3==0)&&(CapSense_IsWidgetActive(CapSense_BUTTON2_WDGT_ID)) )
{
flag3=1; /* Reseting Left Button Flag */
i2cReadBuffer[0] = 0x01;
while (I2CS_I2C_SSTAT_RD_CMPLT!=(I2CS_I2CSlaveStatus()));
/* Clear the slave read buffer and status */
I2CS_I2CSlaveClearReadBuf();
(void) I2CS_I2CSlaveClearReadStatus();
i2cReadBuffer[0] = 0xFF;
}
else if((flag3==1) && (!(CapSense_IsWidgetActive(CapSense_BUTTON2_WDGT_ID))))
{
flag3=0; /* Setting Left Button Flag */
i2cReadBuffer[0] = 0xFF;
}
/* Checking Right Button active or not */
if((flag1==0)&&(CapSense_IsWidgetActive(CapSense_BUTTON0_WDGT_ID)))
{
flag1=1; /* Reseting the flag*/
i2cReadBuffer[0] = 0x06;
while (I2CS_I2C_SSTAT_RD_CMPLT!=(I2CS_I2CSlaveStatus()));
/* Clear the slave read buffer and status */
I2CS_I2CSlaveClearReadBuf();
( void) I2CS_I2CSlaveClearReadStatus();
i2cReadBuffer[0] = 0xFF;
}
else if((flag1==1)&& (!(CapSense_IsWidgetActive(CapSense_BUTTON0_WDGT_ID))))
{
flag1=0;
}
}
}
}
void Received_Data_From_Master1()
{
switch(i2cWriteBuffer[0])
{
/* After Receiving 00 touch will be Ready to Work */
case 0x00:
i2cReadBuffer[0] = 0x19; /*According to New Document Wants to transmit new data acknowledgement */
POWER_LED_Write(0);
break;
}
}
Any Help will be highly appreciated .
Thanks & Regards,
AsDh
Show Less
Hello.
Attached project uses 2 PWM components.
PWM makes square wave, and this square wave is stopped or started by PWM_Timer interrupt.
Attached pptx file is waveform of this square wave.
Sometimes it takes some time for voltage level to reach GND when square wave is stopped.
Please confirm red circle of attached pptx file.
Q1)
Could you please let us know reason why this behavior occurs?
Does this behavior occur if PWM is stopped when voltage level is high?
Why doesn't voltage level go to GND immediately?
Q2)
Could you please let us know solution to this behavior?
I want to immediately set voltage level to GND regardless of timing that PWM_stop is called.
Best Regards.
Yutaka Matsubara
Show LessHello.
When resetting PSoC4, UART TX becomes low level until PSoC4 initialization is complete.
This may cause the receiver to mistake it for a start bit.
I want to add external pull-up resistors to UART TX/RX to avoid this.
I think that external pull-up resistors is necessary to guarantee high level of UART TX/RX.
Does Cypress have recommended values and ranges for UART external pull-up?
Best Regards.
Yutaka Matsubara
Show LessI have a CYBT-213043-EVAL board and the CYBT-213043-Mesh board. I downloaded the Eclipse IDE for modus toolbox 2.2 and opened the Mesh application and the RFComm application. I was successful building, programming and running both applications using the USB connection for each board. I now want to modify and debug each application. I purchased and received the CY8CKIT-005 miniprog4 kit to accomplish the debug. I downloaded the software for the CY8CKIT-005 miniprog4 kit and I believe I was successful. 1st question, is this the correct kit to perform debug? 2nd question, is there documentation to show how to physically connect the 5 pin or 10 pin connector of the CY8CKIT-005 miniprog4 kit to the eval boards? 3rd question, is there specific manual for debugging?
Show Less