PSoC™ 4 Forum Discussions
text.format{('custom.tabs.no.results')}
Hi all,
We are facing one issue of hanging touch panel.
When capsense is not working, other ISR is working.
How can I detect a fault in cap sense ?
How to get an error code in this situation?
How to solve this issue ?
Show LessShould I use the api "CapSense_Stop()" before "CySysPmDeepSleep();" and after WDT wakeup use "CapSense_Start()"?
If I don't use these two api , CapSense_NOT_BUSY == CapSense_IsBusy() can't pass. When I use the api "CapSense_Start()" ,the current increase 200 ua.
Show LessHello,
I want to use the AN89056 Ram test in my project. I have copied all the required files from the AN89056_Ram test in my custom project. I have also compared the build settings of Project AN89056 Ram-test and make them equal but it is giving an error.
--undefined reference to MArch_Test_init
--undefined reference to MArch_Test_SRAM
this function is in "CyLib.h" and in assembly but the project does not find a reference. Could you please help me regarding????
Show Less
Hello Team,
Kindly let us know if CY8CKIT-042-BLE kit supports simultaneous multi keypress functionality. If yes you can share an example code with us.
We have a requirement wherein we have to press two keys (e.g. Menu up + Power on/off) simultaneously for 10 seconds to pair kit with the BT Device.
We have seen BLE HID keyboard example but it sends only one key at a time.
Show LessHello everyone,
I am developing at a very low level communication between the PSOC-4 and a SD card via SPI protocol. In this whole process I'm at the point where I need to transfer 514 bytes per SPI to the SD card (MOSI).
The concept is very simple but I have a lot of problems with increasing the data rate of the SPI block. The whole setup works fine below 1.5 Mbps, but when increasing to 4Mbps with oversampling at 16 (3Mbps real) the DMA transfer stops working properly. I have tried to narrow down the problem as much as possible and it seems that the problem is in the behaviour of the DMA block.
To rule out that there is no problem with the SPI block I have increased to 8Mbps data rate and used the CPU to communicate with the card and everything has been successful. I would like to remind you that at lower speeds of 1 and 1.5 Mbps everything works fine with the DMA. At first I have worked with these low frequencies to be able to analyse the communication with a logic analyser. My idea was, that once everything works fine, to simply increase to the maximum speed.
In order not to go into too much detail I can reduce the problem to a simple SPI transfer with DMA (forgetting that the communication is with an SD). I simply need to transmit 514 bytes of data over the MOSI line at over 3 Mbps.
The information flow is simple, once everything is ready, the DMA descriptor is validated and the channel is enabled to start the transfer to the FIFO register of the SPI module. The problem is that in the interrupt function that is indicated to the DMA it jumps with an error. The error produced is obtained with TxDMA_GetDescriptorStatus(0);. The normal behaviour is that the DMA generates an interrupt with that flag to CYDMA_DONE. Instead it generates two interrupts with the flag to CYDMA_INVALID_DESCR.
The weirdest thing is that it works at low data rates and doesn't work at high data rates. I think I'm missing something and I don't understand what.
The part of the code that involves this problem is first of all the initialisation:
struct DataPacket{
// char token;
char data[512];
char CRC[2];
}__attribute__((packed));
struct DataPacket multipleWriteBuffer;
int main()
{
TxDMA_Start((void *)&multipleWriteBuffer, (void *)SPI_TX_FIFO_WR_PTR);
TxDMA_SetInterruptCallback(TxDMA_Done_interrupt);
CyIntEnable(CYDMA_INTR_NUMBER);
CyGlobalIntEnable;
.....................
The function to be triggered by the DMA interrupt is:
void TxDMA_Done_interrupt()
{
descriptorStatus=TxDMA_GetDescriptorStatus(0);
descriptorStatus=descriptorStatus & 0x00070000U;
switch(descriptorStatus){
case CYDMA_DONE:
{
DMAFlags=1;
}; break;
....................................
case CYDMA_INVALID_DESCR:
{
DebugPin_Write(0);
InvalidDescriptor++;
DebugPin_Write(1);
}; break;
}
}
when I need the to start data transfer:
TxDMA_ValidateDescriptor(0);
TxDMA_ChEnable();
The DMA descriptor configuration is:
The SPI advanced tap configuration is :
And less relevant to the case is the spi basic tab:
Conection between SPI and DMA module:
I think including an image of the logic analyzer may help to notice when the InvalidDescriptor event occurs. Remember that I have a debug pin that throws a pulse when this event occurs so I can detect it in the logic analyzer.
General view of the transmission, without zoom:
A zoom in on the area where these events occur:
In summary: every time I start a transfer, the interrupt with the CYDMA_INVALID_DESCR error is raised.
Do you have any idea what is going on?
Thank you for your help.
Hello, I am new to PSOC, and is currently working in CY8C4245AXI-483
I am trying to make a simple project to read and write the data in external eeprom using i2c, untill now i have aquired the result but the data i stored is in "HEX" whereas the data i received on my serial is in ascii
EX: I am sending (0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49)
and receiving "B C D E F G H I
Why do i not get HEX in output and how to get it ???
My code is given below
#include <project.h>
void main()
{
uint16 read_val[8]; //Array to read data from EEprom
uint8 array[8] = {0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49}; //Array to write data to EEPROM
uint8 i;
uint32 status; //variable to read error/status of I2C
I2C_Start();
UART_Start();
for(;;)
{
status = I2C_I2CMasterSendStart(0x50, I2C_I2C_WRITE_XFER_MODE); //Send start with slaveID 80u & write/read transfer mode
if(I2C_I2C_MSTR_NO_ERROR == status) //Check status
{
status = I2C_I2CMasterWriteByte(0x00); //address of eeprom on which data needs to be written
if(I2C_I2C_MSTR_NO_ERROR == status) //Check status
{ //if valid write data to external eeprom
for(i=0; i<8; i++)
{
status = I2C_I2CMasterWriteByte(array[i]);
if(I2C_I2C_MSTR_NO_ERROR != status) //Check status
{ //if success come out of loop
break;
}
}
}
else
{
UART_PutString("error"); //else print error
}
}
I2C_I2CMasterSendStop(); //Send stop
/***************Read that same data from external EEPROM**************************/
CyDelay(500u);
status = I2C_I2CMasterSendStart(80u, I2C_I2C_WRITE_XFER_MODE); //Again send start
if(I2C_I2C_MSTR_NO_ERROR == status) //Check status
{
status = I2C_I2CMasterWriteByte(0x00); //address of eeprom to read data on it
if(I2C_I2C_MSTR_NO_ERROR == status) //Check status
{
CyDelay(50u);
status = I2C_I2CMasterSendRestart(80u, I2C_I2C_READ_XFER_MODE); //Send restart
if(I2C_I2C_MSTR_NO_ERROR == status) //Check status if no error
{
for(i=0; i<8; i++)
{
if(i<7u)
{
read_val[i] = I2C_I2CMasterReadByte(I2C_I2C_ACK_DATA); //receive data bytes with ack
}
else
{
read_val[i] = I2C_I2CMasterReadByte(I2C_I2C_NAK_DATA); //receive last byte with nack
}
}
}
}
}
I2C_I2CMasterSendStop(); //Send stop
for(i=0; i<8; i++)
{
UART_PutChar(read_val[i],); //display data on uart
UART_PutString(" ");
CyDelay(500u);
}
CyDelay(3000u);
}
}
/* [] END OF FILE */
Show LessHi, I am starting out from scratch and I am trying to figure out what I need to get started.
I have been proposed the:
CY8CKIT-046 PSoC 4 L Series development board.
I don't really know how to get started with this? Where do I download the compiler software "Psoc Creator"??? Is there any simple examples like blink a led to get me started????
Also I am reading the "Infineon Lit Prog" user guide". On page 8 of the guide (please view image below), they show an image with what seems to be a PCB board plugged into a strange socket on a PC.
And yet they describe this as "Connect USB cable to J6 (Prototyping kits)"???? Why do they call it a cable when its a PCB???? and where is J6???
Thank you for all help
r
Show Less
Hi,
We are trying to execute an application by using your “CY8C4014LQI-24-QFN“ processor. However we have an problem on programming this chip.
When we make a short search we can find in your site(https://www.cypress.com/products/psoc-programming-solutions) that can be done by using MiniProg4 and MiniProg3. In addition to this devices we also figured out that the programmer part of “CY8CKIT-147 PSoC® 4100PS Prototyping Kit” can also have ability to programme any kind of Cypress processor. But we could not achieved for programming our chip. So i have below question about this situation.
1-) Are MiniProg3-4 devices the only solutions to programme “CY8C4014LQI-24-QFN“ processor or like we found in internet this can be made by using programmer part of “CY8CKIT-147 PSoC® 4100PS Prototyping Kit” having “CY8C5868LTI-LP039” processor for controlling programming jobs.
Show LessHello,
I am trying to use the psoc 4 mcu as a timer that switches a GPIO between high (20 minutes) and low (10 minutes) states. I want the mcu to be in deepsleep most of the time and just toggle the GPIO every 20 / 10 minutes.
How can I do this and is there some sample code to refer to?
Thanks
Show Less