PSoC™ 5, 3 & 1 Forum Discussions
Hola buen dia.
Fui compilar mi proyecto en PSoC Creator 4.2 y me aparece el siguiente error. Ya cree nuevamente el proyecto y me sigue apareciendo lo mismo. Cambié la variable W por otra, le cambié el nombre al Status_Register y al Control_Register pero sigue igual. Ya no sé que mas hacer.
Show Less
I am working with CY8CKIT-059 and need help discerning the differences between my custom project and one of the projects provided under "Find code example..." dialogue.
I have a device that is acting as an I2C Master and is connected to the CY8CKIT-059 acting as an I2C slave.
If I use the sample project: "DelSig_I2CS" I can successfully perform a Write operation from the external device and the CY8CKIT-059 running the sample project can successfully ACK the address and receive the 2 bytes being written to it. No issues here, I2C slave is working as expected.
However when I generate a new project, and reuse the code from the sample I2C project and set up the I2C peripheral in the same way the sample project has it configured, the CY8CKIT-059 NACKs the address and no data is received.
Perhaps I am not setting up the custom project in the same way, but I think I have checked everything.
What are some probable causes as to why the CY8CKIT-059 would NACK when being addressed?
I will attach both projects: DelSig_I2CS is working just fine with no issues and "Roadrunner2_Eval which I believe is setup in the same way.
In general, both projects have the same code:
At this point Delays are being used to have a line of code to attach breakpoints to.
I2CS_Start();
/* Set up slave read data buffer */
I2CS_SlaveInitReadBuf((uint8 *) sample_segment, RD_BUFFER_SIZE);
I2CS_SlaveInitWriteBuf((uint8 *) sample_segment, RD_BUFFER_SIZE);
/* Enable global interrupts - needed for I2C operation */
CyGlobalIntEnable;
Enter Main Loop:
/* Check if the slave buffer has been Written */
if(I2CM_SlaveStatus() & I2CM_SSTAT_WR_CMPLT)
{
byteCount = I2CM_SlaveGetWriteBufSize();
I2CM_SlaveClearWriteStatus();
I2CM_SlaveClearWriteBuf();
/* If both bytes of the read buffer have been read */
if(byteCount == I2C_BUFFER_SIZE)
{
CyDelay(1);
return 1;
}
else /* Wrong number of bytes read - place error handling code here */
{
CyDelay(1);
}
/* Check if the slave buffer has been read */
if(I2CM_SlaveStatus() & I2CM_SSTAT_RD_CMPLT)
{
byteCount = I2CM_SlaveGetReadBufSize();
I2CM_SlaveClearReadStatus();
I2CM_SlaveClearReadBuf();
/* If both bytes of the read buffer have been read */
if(byteCount == I2C_BUFFER_SIZE)
{
CyDelay(1);
return 1;
}
else /* Wrong number of bytes read - place error handling code here */
{
CyDelay(1);
}
I'm trying to automate the programming of a CY8C3445AXI-104 device using the ppcli application, the problem I have is that I cannot find the ppcli command that will write the data to the PSoC from a hex file that has been read in. The following lines of code appear to work, but I'm at a loss as to what commands are used to program and verify the Hex file.
OpenPort MiniProg3/1636BB000190 .
HEX_ReadFile "C:\\PSOC_CLI_Programmer\\Application\\2001HPC_V_21_for_CY8C3445AXI-108.hex"
SetAcquireMode “Reset”
SetProtocol 1
SetProtocolClock 152
SetPowerVoltage 3.3
DAP_Acquire
PSoC3_EraseAll
I assume that the commands would be "PSoC3_ProgramRowFromHex" and "PSoC3_VerifyRowFromHex", but need further information on how to use these commands.
Am I also correct in thinking that the script would be completed with the following:
PSoC3_ProtectAll
PSoC3_VerifyProtect
DAP_ReleaseChip
ClosePort
Quit
Show Less
Hello Infineon community!
I finally received my CY8CKIT-059 PSOC5LP. I am a total beginner working with it but I'm looking forward to doing my project with it.
Accelerometer 832M1-0500: Supply: 3.3V Sensitivity@80Hz(mV/g) (X-Y-Z): 3.081-2.534-2.7 Bias Voltage(X-Y-Z): 1.636 1.628 1.659
I'm willing to use the SAR ADC with 12-bit resolution to sample the analog output (60KSPS/channel) of the 3 axes of the Accelerometer. Before the input, I have to filter the signal before with -30dB attenuation at half the sampling frequency.
Can I achieve simultaneous sampling for the 3 axes with the S/H? If not I have to have a minimum sampling of 180KSPS and divide it into 3 to achieve 60KSPS.
Then, I need to transfer the data of the Accelerometer to an ESP32 with SPI then transmit it wirelessly (UDP) (I think this will be another topic)
So I have multiple beginner questions. (I think I will receive some replies that I need to read the datasheet😅)
1) Can I use a power bank to power the PSOC using 5V USB? What about the Vref of the ADC (VDDA VSSA etc.) can they be powered internally? If my application is to be battery powered, do you advise me to use a battery instead of the USB powering?
2) Which ADC SAR inputs (pins) do you advise me to use? Can I use the kitprog's and work only with it? Or do I have to involve the target?
3) I have no idea about how can I filter internally the input. Can you give me some insights?
4) In the screenshot, I need to check if I forgot something, and ask you what should I put as configuration for the ADC if I power the MCU with USB. Vssa to Vdda?
The SPI connection and filtering are my next steps, just when I'm sure I'm on the right track
I am sorry for the beginner questions but I'm still learning so I rushed to post a thread to receive advice from experienced people in the field. Feel free to reply even if just to tell me go work on your datasheets or other constructive remarks😂
Thank you, People!
Jad
Hello @MotooTanaka san,
I have been trying to get this example as a base to implement a simple HMI menu system using PSOC 5LP and 4x4 keypad and LCD: https://community.cypress.com/t5/Code-Examples/4x4-Matrix-Keypad-Sample/m-p/96977#M370
In the example code provided, the dump_key_matrix() function dumps the key pressed at that instant into a string str which can be used to print, either over UART or onto the LCD using appropriate functions (WORKS as described).
But, in a menu system, there are different levels at which the key press is to be detected (need to call dump_key_matrix() multiple times) which would mean that the dump_key_matrix() function needs to have a return type and not be 'void'.
I have tried modifying the return type to char and int too, where the letter[row][col] string will be used for a switch case and i set a variable flag with appropriate value for the corresponding key press, but this isn't working as intended.
Can you please guide me on how to modify the code to enable a return type for the dump_key_matrix() function which can be used to call the function multiple times in the code ( at different menu levels)?
To give a better view of what i want to implement:
1.) Show the first menu screen with 2 options to choose from (Press1 for Emp details, Press2 for Comp details).
2.) Take the input from user using dump_key_matrix().
3.) Based on the input, give the second menu screen with 2 more options to choose from.
If Press1 in first menu: Press1 for Name, Press2 for Age
If Press2 in first menu: Press1 for Company Address
4.) Again taking input from dump_key_matrix().
5.) Showing the third menu screen.
If Press1 in Second menu: emp_name (string)
If Press2 in Second menu: emp_age (string)
If Press 2 in first menu: show_company_details and address as a Up scrolling menu.
This is what i want to implement, but sadly i am not able to figure out the first part of getting a parsable (either using switch case or if else ) input variable to implement any of it.
Please help.
Regards,
Yash
For the ones interested, I created a Visual Studio Code setup for PSoC5.
The setup makes use of PSoC Creator which is needed for the (one time) configuration of the schematic / system / UDB part (and needs Windows to run of course). Once the configuration is done, coding and debugging can be done with Visual Studio Code (which can run on the platform of your choice). The advantage as well is that the PSoC Creator is 'embedded'. Changing the schematic / system / UDB part can be done in the 'embedded PSoC Creator project' without having to export / copy the project.
The result is a very fast, transparent, smooth and stable IDE for use with PSoC5.
https://github.com/RolfNoot/PSoC5_VS_Creator
When there's enough interest I can provide PSoC3 and PSoC4 setups as well.
Edit: Added the post build executable C# project sources.
Need CY8CTMA768AS-33 datasheet, Pinout, Programing guide. THKS.
Hi all,
I got stuck trying to get sleep / wakeup running on a PSoC3.
It seems that the device goes to sleep correctly, as I do this:
- sleep components that have API functions to do so
- call CyPmSaveClocks();
- CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_PICU); // allow wake from PICU
I use a GPIO input pin as the wakeup source. I have set up an ISR routine associated to that GPIO. After a wakeup, I do the following:
- CyPmRestoreClocks()
- wake components
- clear GPIO pin interrupt (that caused the wakeup)
I implemented the GPIO and related interrupt as suggested in the example project "PowerManagement_Hibernate" provided in PSoC Creator (and also available as a download from the Infineon website as sample project CE95346), with the only difference that I do not put the device to Hibernate, but to Sleep.
I could successfully test the "PowerManagement_Hibernate" example project on my hardware, but only after removing the MiniProg3 debugger. When the MiniProg3 is connected, the example project does not seem to work. I'm wondering if removing the debugger is a requirement and why it is not clearly stated in the example's description??
In my project (that sends the PSoC to sleep instead as to hibernate) when I press the button connected to the GPIO pin, the device wakes up, but seems to become unresponsive (apparently executing some random code).
I have read various documents, such as the pdfs provided in AN77900, AN66083 and many more.
But still, I have a few unanswered questions:
- In the AN77900 example, there is no ISR associated to the GPIO pin connected to the button which is supposed to wake up the PSoC. How does the PSoC know which ISR it should run when the button is pressed, therefore issuing an interrupt? There seems to be a confusion with the fact that the pin properties (in the schematic) indicate that the GPIO input pin has its interrupt enabled. On the other hand, there is no ISR handler defined and associated to it.
- I read here that apparently, it is not possible to use the debugger (MiniProg3 in my case) when debugging a PSoC3 that goes into sleep mode. There seems to be an issue with the fact that the IMO clock needs to be kept active for debugging (?). I found it very strange that nowhere in the Community the question: "Can we use the MiniProg3 with projects that send the PSoC3 to sleep (or hibernate)?" is answered. At least, I couldn't find it.
Can anyone please give me a clear answer?
If the answer is "NO" (i.e. debugging not possible when entering low power modes), is there a workaround (e.g. a way to keep the IMO clock alive during sleep) to have the possibility to continue using the debugger (obviously at a greater current consumption) just to debug the code and make sure that everything works ? - Were can we find a complete documentation about the API functions provided in cyPm.c, CyLib.c, CyUtils.c, etc... and all other files provided in cy_boot in the project tree?
I found something (but not all) in the pdf provided with AN77900, but I'm not sure if there is a better place?
Thanks for all your suggestions!
Show Less
Hi,
I have a cy8ckit-059 and I would like to power it using a 3.7V battery previously used in a drone. I would like to have a button that turns the system on and off from the battery and also I would like the battery to be charged when the board is connected through the USB port. As I'm really a newbie to this world can you please guide to how can I make it work if it is at all possible?
The battery has all the required protections built in so if I connect it to a 5V 1A source (regular USB charger or PC) it can be charged without any trouble.
Thanks ahead for your help!
Show LessHello, @MotooTanaka san,
The new I2C implementation to configure the PCF 8563 RTC works as expected.😃
Based on our previous topics, keypad_buffering and configuring_RTC, I modified the last sample firmware of storing the keypad input buffering.
The modification is that if the keypad input is 1, which is '1' (ASCII representation) is converted to represent hex 0x1 and then the same is written to the RTC (using Byte() API's) using Write_RTC() function.
And then the time and date info is read back in the same Write_RTC() function, using RTC_Read() function.
So, now the problem that I notice is at lines 271 and 272, when I am again trying to call RTC_Read() function, the program directly starts reading and printing some random data onto the Terminal (No input is taken) when any button on the keypad is pressed.
When the data is read back in the Write_RTC() function (commenting lines 271 and 272), everything is working fine. But, when uncommenting lines 271 and 272 (reading the RTC at some other time, after configuring), there is no response and i am not able to reach any conclusion as to what might be causing the issue.
In order for you to test this, try entering "48592331011209" (SS MM HH Day Weekday Month YY) using the keypad in the firmware (attached) as is (commented 271 & 272) and you can see that the date and time are read back properly.
Then try the same after commenting lines 271 & 272, the firmware is struck.
Hope you got what I wanted to ask your help about.
PS: I am a novice programmer, so bear with me a bit please.😅
Regards,
Yash
Show Less