PSoC™ 4 Forum Discussions
text.format{('custom.tabs.no.results')}
We are implementing the module on a battery operated sensor, and in the DS it references the low voltage detect, but I cannot seem to locate any further details in the DS other than these entries:
page2
Programmable low voltage detect (LVD) from 1.8 V to 3.6 V
page 26 table 46 LVD monitor DC specifications
Is there really a voltage monitor block I can turn on, check the comparison and then turn off?
Show LessHi,
I wanted to create an application on the PC that does FOTA with PSOC 4 MCU.
I know that CySmart can do this but we are building an all-in-1 production tool and we need it for automation. We can't have a single person clicking everytime on the CySmart program to do FOTA.
I saw in the forums here that people had asked this in the past. But the questions I saw dated back to 2018.
I was wondering if now, near the end of 2020, Cypress has by chance provided such reference projects for PC (just as they have for Android)?
Thanks
Show LessThe datasheets seem to suggest that I can setup i2c on a udb but that option is not available in the component catalog. I'm using CY8C4245AXI-483.
Show LessHi All,
Is there an example source code for I2C master using Interrupt?
Please refer to below.
- IDE : PSoC Creator 4.2
- PSOC4200L
- I2C SCB
- I2C Master example using interrupt
a. transfer
When the Tx start interrrupt flag is triggered, then I2C ISR starts transferring rest of the data.
b. receive
If there is data in the I2C rx buffer, then the data is transferred from I2C Rx FIFO to the user defined buffer by the ISR.
Thanks and Regards,
YS
Show LessI used Cy8CKIT-040 and Cy8CKIT-024 for proximity induction, but since 024 is a hard PCB, I now want to make the sensor (including the shielded electrode) a flexible material so that it can be used in more applications.
Is this idea feasible?
Are there any other ways besides using FPC, a flexible circuit board?
best regards!
Show LessOur application ( Fast-mode : 400Khz) the measured fall time is only about 4ns - but I2C spec's the minimum allowed fall time according the spec would be 20 x (Vdd/5.5) = 20 x (3.3V / 5.5V) = 12ns .
1. Could it cause any problems(side effect) ?
2. How to increase the fall time to meet spec ?
訊息由此人編輯:ivan lee
Show LessHi,
I am trying to test a subjected project code with little modification(removed 3 channel MUX).
There is no changes in the output. Please help.
Attached project file for your reference.
Regards,
Ram
Show LessHi
This developer community site is a site where anyone can answer questions.
Is there a way to verify that the respondent is a Cypress's engineer?
Is the moderator icon to the right of the account name proof that you are a Cypress's engineer?
This is because I want to confirm that the questions and answers asked on this site are reliable in advancing development.
Hello,
I am considering error handling for I2C slave of PSoC4000S.
Please see the return value of SCB_I2CSlaveStatus() API.
[In case of write operation (master -> slave)]
1. Just program the error handling between /* your error handling here */ and /* your error handling end */.
if(0u != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_WR_CMPLT))
{
if(0u != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_WR_OVFL))
{
/* your error handling here */
/* your error handling end */
}
else if(0u != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_WR_ERR))
{
/* your error handling here */
/* your error handling end */
}
/* your write operation handling here */
/* your write operation handling end*/
}
2. Just progarm the timeout handling between /* your timeout handling here */ and /* your timeout handling end */.
for example:
while(0 != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_WR_BUSY))
{
/* your timeout handling here */
/* your timeout handling end */
}
[In case of read operation (master <- slave)]
3. Just program the error handling between /* your error handling here */ and /* your error handling end */.
if (0u != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_RD_CMPLT))
{
if(0u != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_RD_OVFL))
{
/* your error handling here */
/* your error handling end */
}
else if(0u != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_RD_ERR))
{
/* your error handling here */
/* your error handling end */
}
/* read operation handling here*/
/* read operation handling end*/
}
4. Just progarm the timeout handling between /* your timeout handling here */ and /* your timeout handling end */.
for example:
while(0 != (I2CS_I2CSlaveStatus() & I2CS_I2C_SSTAT_RD_BUSY))
{
/* your timeout handling here */
/* your timeout handling end */
}
Is there anything else I can prepare?
Best regards,
Yocchi
Show LessHi,
I think I found a memory overwrite issue, and would like to confirm my understanding of what is going on.
I have found something out about the automatic DMA buffer, and I would like to confirm my understanding. I had tried IN_BUFFER[8] and OUT_BUFFER[8],
and my program wasn't working correctly. A counting variable kept getting overridden at approximately the ### location. I then changed to IN_BUFFER[32] and OUT_BUFFER[32].
With these new buffer lengths the issue was resolved. Please see https://www.cypress.com/file/376416/download pg 63.
"The DMA reading from or writing into the endpoint buffer happens in 32 byte chunks per request".
I contrast that with the code definition of ReadOutEp: "Valid values are between 0 and 1023", in which it speaks about the third parameter.
I think that I was overriding the other variables, because my buffer sizes were too small. Can I get a confirmation of this please?
#include "project.h"
#include <stdio.h>
#define IN_ENDPOINT 0x01
#define OUT_ENDPOINT 0x02
#define MAX_NUM_BYTES 1
#define PACKET_OK 1
#define PACKET_BAD 0
#define maxLength 19 // 20 long -> array element 19
// These are for the keypads
#define Pin_DM_STRONG (0x06u)
#define Pin_DM_RES_UP (0x02u)
uint8 IN_Data_Buffer[8] = {0};
uint8 OUT_Data_Buffer[8] = {0} ;
uint8 PacketNum = 0;
uint8 packetOk = 0;
char textIn[20];
char textOut[20];
uint8 textInLength = 0;
uint8 textInIndex = 0;
uint8 textOutLength = 0;
uint8 textOutIndex = 0;
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
// Start the Screen
LCD_Start();
Timer_Start();
keyTimer_Start();
LCD_ISR_StartEx(LCD_Interrupt);
keyISR_StartEx(Keypad_ISR);
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
USB_Start(0,USB_DWR_VDDD_OPERATION);
#define UnassignedAddress 0
while(USB_deviceAddress == UnassignedAddress)
{
// Wait for device address to be assigned
}
while(!(USB_GetConfiguration()));
for(;;)
{
uint8 interruptState;
interruptState = CyEnterCriticalSection();
/* Place your application code here. */
// the primary USB send and receive function
OUT_COUNT = 0;
// ensure that device is configured
//if(USB_bGetConfiguration() )
//{
if(USB_IsConfigurationChanged()) //make happen every time
{
//USB_GetInterfaceSetting(0); // works without this line???
USB_LoadEP(IN_ENDPOINT, IN_Data_Buffer, 8);
USB_ReadOutEP(OUT_ENDPOINT, OUT_Data_Buffer, OUT_COUNT);
USB_EnableOutEP(OUT_ENDPOINT);
}
//CyDelay(1);
//############################################################################################################
if ((USB_GetEPState(IN_ENDPOINT) == USB_IN_BUFFER_EMPTY ) ) //Data to send
{
USB_LoadEP(IN_ENDPOINT, NULL, 8);
//USB_EnableOutEP(OUT_ENDPOINT);
}
//CyDelay(1);
if(USB_GetEPState(OUT_ENDPOINT) == USB_OUT_BUFFER_FULL) /// Data to Receive
{
//############################################################################################################
OUT_COUNT = USB_GetEPCount(OUT_ENDPOINT);
USB_EnableOutEP(OUT_ENDPOINT);
}
//}
if (OUT_COUNT != 0)
{
char tempChar = (char)OUT_Data_Buffer[0];
// this loop resets the OUT line on LCD
// once it is full and more text has arrived
if(textOutLength > maxLength)
{
textOutLength = 0;
//LCD_Position(1u,0u);
// this loop blanks the OUT line on LCD
// it is 21 elements long, even though the screen is 20
// b/c I append a \0 when sending the text from PC
for(int z = 0; z <= 20; z++)
{
textOut
}
int bob = 0;
}
if (tempChar != 0)
{
textOut[textOutLength] = tempChar;
textOutLength = textOutLength + 1;
IN_Data_Buffer[0] = OUT_Data_Buffer[0];
if(textInLength > maxLength)
{
textInLength = 0;
textInIndex = 0; // should I update this one here???
for(int i = 0; i < 20; i++)
{
textIn = ' ';
}
}
textIn[textInLength] = IN_Data_Buffer[0];
textInLength = textInLength + 1;
}
}
CyExitCriticalSection(interruptState);
}
}
Show Less