hey! Community.
I'm facing one issue while programming CY8CKIT-145-40xxS PSoC DevKit. I ordered CY8CKIT-145-40xxS PSoC now I'm playing with that kit I started following the User guide of that Kit.
I performed these steps
1) Download and installed PSoC 4 IDE
2) install Kit package from here
3) create a new blank project
4) Select kit as shown below
5) Compile/build project
6) insert kit to the USB port of the laptop
7) Select the programmer
8 ) Acquire the port
and that point I'm getting this error.
I'm waiting for few seconds and got this message pop-up.
Thank you 🙂
Show Less
We are using the Capsense CSD together with the Analog Mux.
For the capsense we are using 6 touch keys, and 5 ADC inputs for the multiplexer. We have a conflict between Analog Mux and CapSense CSD that causes the baseline to vary as a function of the ADC inputs.
We tried to manage them at different times, waiting for the end of the conversion of each procedure, but we couldn't solve the problem.
Is there any way to fix this without designing a new layout?
Attached screenshot of the Topdesign.cysch file.
best regards
Alessio
Show LessHi,
Regarding the GND electrode and the shield electrode, the mesh width and the distance between the meshes are described in the reference manual in a fixed manner.
What is the rationale for this value?
Also, what are the negative effects of using a solid pattern instead of a mesh for the shield electrode?
Regards,
Naoaki Morimoto
Show Less
Hello
I have a hw design where i use a CYBLE-222014 and some PWM controlled LED's.
My problem is that one of my LEDS is hw wired to pin 4.0, which is not routeble from PsoC Creater.
How can i from code make it posible to adjust PWM on PIN 4.0 ?
Show Less
Hello,
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
I use CY8C4247AZI-L485 internal reference (1uF at P1.7) free running 2 channels avarage 4(accululate). Voltage range on the analog pins is 0...1V.
Is there a pssibility to grab results when ever I like without using an interrupt. Having ADC free running sequencing and averaging in background. I could not find an example in free running mode and the datasheet does not tell much about free running mode and what capabilities I have. The block diagramm on page 26 show the structure of ADC block. It seems that every thing is done automatically and the avaraged results will always be avalibale in result regitser... so I can access asynchrounously access .... doing so the result I get is not as expected... please advice how to handle, thanks.
Show Less
Hello all,
I'm working on controlling LED with NEC remote control and Capsense(Using custom PCB with PSoC4 MCU cy8c4245axi-483). My Project which I have attached here is work fine with either through remote or Capsense button. As Problem is different from previous one, I have already opened thread regarding this issue. but problem has not been solved .https://community.cypress.com/t5/PSoC-4-MCU/IR-interfacing-with-Capsense-Button/m-p/273105/emcs_t/S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufEtOOU5IQ0I4UkVBUUkzfDI3MzEwNXxTVUJTQ1JJUFRJT05TfGhL#M39362 .
Please Note that I wanted to operate LED by both the ways. Here I am attaching my Project(in which it is working only with CapSense)
#include "project.h"
#include "stdio.h"
#define TIMER_FREQUENCY 1000000UL
#define ADDRESS_SIZE 16U
#define DATA_SIZE 16U
volatile uint16_t timeStart;
volatile uint16_t timeEnd;
uint32_t pulseWidth;
volatile uint16_t pulseReceived;
volatile uint16_t overflow;
uint32_t timeDiff;
/******************************/
uint8_t startFrameFlag = 0;
uint8_t addressCount = 0;
uint8_t dataCount = 0;
uint16_t address_temp;
uint8_t address_temp2;
uint8_t address;
uint8_t address_inv;
uint16_t data_temp;
uint8_t data;
uint8_t data_inv;
uint8_t frameReceived;
unsigned char status=0;
unsigned char prev_status=0;
unsigned char flag[10];
/*****************************/
typedef enum
{
IDLE,
ADDRESS_FRAME,
DATA_FRAME,
}state;
state nec_state;
volatile uint16_t countFlag;
uint16_t timerPeriod;
asm (".global _printf_float");
int _write(int file, char *ptr, int len)
{
(void) file;
int i;
for (i = 0; i < len; i++)
{
UART_UartPutChar(*ptr++);
}
return(len);
}
void Pin_ISR();
void Timer_ISR();
void DecodeProcotol(uint16_t pulseWidth);
CY_ISR(Pin_ISR)
{
uint8 intrSrc;
intrsrc=NEC_IN_ClearInterrupt();
if(intrSrc != 0u)
{
if(countFlag == 0)
{
timeStart = Timer_ReadCounter();
countFlag = 1;
}
else
{
timeEnd = Timer_ReadCounter();
pulseReceived = 1;
}
}
}
CY_ISR(Timer_ISR)
{
if((Timer_GetInterruptSourceMasked() & Timer_INTR_MASK_TC ) != 0)
{
if(countFlag != 0)
overflow++;
Timer_ClearInterrupt(Timer_INTR_MASK_TC);
}
}
void DecodeProcotol(uint16_t pulseWidth)
{
uint8_t bit = 0;
switch(nec_state)
{
case IDLE://Checks for start of frame
{
if(pulseWidth > 12000 && pulseWidth < 15000)
{
nec_state = ADDRESS_FRAME;
startFrameFlag = 1;
}
else
{
//Invalid Frame received
nec_state = IDLE;
}
break;
}
case ADDRESS_FRAME:
{
if(pulseWidth > 1100 && pulseWidth < 1160)
{
bit = 0;
}
else if(pulseWidth > 2200 && pulseWidth < 2300)
{
bit = 1;
}
address_temp |= ( bit << addressCount);
addressCount++;
if(addressCount >= ADDRESS_SIZE)
{
addressCount = 0;
nec_state = DATA_FRAME;
}
break;
}
case DATA_FRAME:
{
if(pulseWidth > 1100 && pulseWidth < 1160)
{
bit = 0;
}
else if(pulseWidth > 2200 && pulseWidth < 2300)
{
bit = 1;
}
data_temp |= ( bit << dataCount);
dataCount++;
if(dataCount >= DATA_SIZE)
{
dataCount = 0;
nec_state = IDLE;
frameReceived = 1;
}
break;
}
}
}
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
CapSense_Start();
CapSense_InitializeAllBaselines();
CapSense_ProcessAllWidgets();
CapSense_ScanAllWidgets();
Pin_Interrupt_StartEx(Pin_ISR);
Timer_Interrupt_StartEx(Timer_ISR);
UART_Start();
UART_UartPutString("Working\r\n");
nec_state = IDLE;
Timer_Start();
timerPeriod = Timer_ReadPeriod();
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
for(;;)
{
countFlag = 0;
timeEnd = 0;
timeStart = 0;
frameReceived = 0;
address_temp = 0;
data_temp = 0;
address_inv = 0;
address = 0;
data_inv = 0;
if(pulseReceived)
{
if(timeEnd > timeStart)
{
timeDiff = (overflow * timerPeriod) + (timeEnd - timeStart);
}
else
{
timeDiff = (overflow * timerPeriod) - (timeStart - timeEnd);
}
timeStart = timeEnd;
overflow = 0;
pulseReceived = 0;
pulseWidth = timeDiff; //in uS
//printf("%u uS\r\n", pulseWidth);
DecodeProcotol(pulseWidth);
}
if(frameReceived)
{
address_inv = address_temp >> 8;
address = address_temp & 0x00FF;
data_inv = data_temp >> 8;
data = data_temp & 0x00FF;
if((uint8_t)(~data) == data_inv)
{
//printf("Data received: %u\r\n", data_temp);
printf("Data received: %u\r\n", data);
}
else
{
printf("Data corrupted\n\r");
}
}
if (CapSense_NOT_BUSY == CapSense_IsBusy()) {
CapSense_ProcessAllWidgets();
status = CapSense_IsWidgetActive(CapSense_BUTTON08_WDGT_ID) || data==18;
if (status && !prev_status) {
if(flag[8]==0)// && (OF_1_Read()==1))
{flag[8]=1;OF_8_Write(0);
}
else
{flag[8]=0;OF_8_Write(1);
}
}
prev_status = status ;
CapSense_ScanAllWidgets(); }
}
}
. Please Have look. Your suggestions are always helpful for me.
Thanks & Regards,
Prem KB
@MotooTanaka @Hari @JoMe_264151 @BragadeeshV
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
In the datasheet for the PSOC4 timer component (TCPWM_P4_v2_10) There is a statement concerning the reload input:
"For all devices, except PSoC 4000, PSoC 4100, PSoC 4200, it should only be used when the counter is not running."
Does this exception apply to all of the 4000, 4100, and 4200 series? For example is the "4100S" series also included in this exception? What are the consequences of violating this condition? What is the recommended workaround for this?
Thanks
BoB
Show LessHello,
We have a PSOC 4 MCU with BLE 4.1 and mobile application like as CySmart.
Actual behaviour
The application cannot get a response from characteristic on ios device
Devices:
iPad Air 2 iOS 14.4.1
PSoC 4
Steps what I am doing on the app:
- connect to the device
- enable short and long notifications
- request MTU (Android only API 21+)
- write value
Description
According to Apple documentation - The MTU is negotiated during connection process. iOS will automatically use the largest value supported by both devices.
We set up attribute MTU size which equals 512 bytes on the PSoC side.
On the iOS device we used maximumWriteValueLengthForType (https://developer.apple.com/documentation/corebluetooth/cbperipheral/1620312-maximumwritevaluelengthfortype?language=objc). It has got 512 bytes. But unfortunately the app has not received a response from the peripheral.
However, we had the same issue when we have worked with Android. After a long search we found resolve. It was necessary to using requestMtu (https://developer.android.com/reference/android/bluetooth/BluetoothGatt#requestMtu(int)). When we added requestMtu, the android app started getting a response from characteristic.
Logs from Xcode (iOS):
2021-03-31 17:43:42.445821+0300 emeter_testing_environment[7235:730555] Get connected peripherals
2021-03-31 17:43:43.406298+0300 emeter_testing_environment[7235:730555] retrieveServices (null)
2021-03-31 17:43:43.410845+0300 emeter_testing_environment[7235:730235] Services Discover
2021-03-31 17:43:43.411516+0300 emeter_testing_environment[7235:730235] Service 12345633-0000-1000-8000-00805F9B24FB <CBService: 0x283b14b00, isPrimary = YES, UUID = 12345633-0000-1000-8000-00805F9B24FB >
2021-03-31 17:43:43.467310+0300 emeter_testing_environment[7235:730235] Characteristics For Service Discover
2021-03-31 17:43:43.473929+0300 emeter_testing_environment[7235:730555] startNotification
2021-03-31 17:43:43.474878+0300 emeter_testing_environment[7235:730555] Looking for FC27 with properties 16
2021-03-31 17:43:43.475536+0300 emeter_testing_environment[7235:730555] Found FC27
2021-03-31 17:43:43.597629+0300 emeter_testing_environment[7235:730235] Notification began on FC27
2021-03-31 17:43:43.636951+0300 emeter_testing_environment[7235:730618] startNotification
2021-03-31 17:43:43.637658+0300 emeter_testing_environment[7235:730618] Looking for AEF9 with properties 16
2021-03-31 17:43:43.638046+0300 emeter_testing_environment[7235:730618] Found AEF9
2021-03-31 17:43:43.755061+0300 emeter_testing_environment[7235:730235] Notification began on AEF9
2021-03-31 17:43:46.404088+0300 emeter_testing_environment[7235:730555] Write
2021-03-31 17:43:46.405077+0300 emeter_testing_environment[7235:730555] Looking for 8AA5 with properties 8
2021-03-31 17:43:46.405881+0300 emeter_testing_environment[7235:730555] Found 8AA5
2021-03-31 17:43:46.407011+0300 emeter_testing_environment[7235:730555] [native] Message to write(1): (
1
)
2021-03-31 17:43:46.407912+0300 emeter_testing_environment[7235:730555] [native] Message to write(1): 01
2021-03-31 17:43:46.408064+0300 emeter_testing_environment[7235:730555] MAX WRITE --> 512
2021-03-31 17:43:46.477202+0300 emeter_testing_environment[7235:730235] didWrite
2021-03-31 17:44:47.030206+0300 emeter_testing_environment[7235:730235] Peripheral Disconnected: 2D3F177A-15BE-0C3C-6729-EA6F779F5E67
Also I attached logs from CySmart.
Maybe we are missing something on the PSoC side.
Can we get a detailed description of the MTU installation?
Thank you and Best Regards,
Bohdan
Show Less
Expert II
Esteemed Contributor
Employee
Honored Contributor II
Employee
Employee
Honored Contributor II
Employee