PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
I'm developing a PCB based around the PSoC 3, and I'm very confused about an error I'm getting, because from everything I can see, I've done things right - perhaps I missed something obscure?
The error:
I included the warning I'm getting as well, since the two pertain to the same thing. As best I understand it, there needs to be a function prototype before the main(), specifically, "CY_ISR_PROTO(UART_ISR);", but it's definitely there. I don't understand what I'm missing.
Full code pasted below:
#include <project.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX_LENGTH 20
#define START_CHAR 'A' // Change this to the specific character you want to check
char received_string[MAX_LENGTH];
char buffer[20]; // Buffer to hold the integer in string format
int string_index = 0;
int start_flag = 0;
CY_ISR(UART_ISR)
{
while(UART_GetRxBufferSize() > 0 && string_index < MAX_LENGTH - 1)
{
char received_char = UART_GetChar();
if (!start_flag && received_char != START_CHAR) {
continue; // Ignore data if the first character does not match the specific character
}
start_flag = 1; // Set the start_flag after the specific character is received
received_string[string_index] = received_char;
if(received_string[string_index] == '\r') // Stop receiving at '\r'
{
received_string[string_index] = '\0'; // Null-terminate the string
start_flag = 0; // Reset the start_flag for the next string
UART_PutString("Received string: ");
UART_PutString(received_string);
UART_PutString("\r\n");
// Decode the received hexadecimal string
if (received_string[0] == START_CHAR) {
long int decoded_value = strtol(received_string + 1, NULL, 16); // Skip the first character
UART_PutString("Decoded value: ");
sprintf(buffer, "%ld", decoded_value);
UART_PutString(buffer);
UART_PutString("\r\n");
}
string_index = 0; // Reset the string index for the next reception
}
else
{
string_index++;
}
}
}
CY_ISR_PROTO(UART_ISR);
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
/* Start UART component */
UART_Start();
UART_ClearRxBuffer();
/* Start the ISR */
isr_UART_StartEx(UART_ISR);
for(;;)
{
//Paste system code here
}
}
I learn linker script recently and there are two commands which confused me. They are EXTERN and PROVIDE. In these article, it said EXTERN is force symbol to be entered in the output file as an undefined symbol. I try to add EXTERN(test) in the linker script and why can it compile and link successfully? I mean the test is undefined symbol, why can it link without any error? And for PROVIDE command, in my understanding, it is mainly avoid multiple definition and I try to add symbol test = .(without PROVIDE)in data section of linker script and declare variable int test in my source code, but why there is no error when linking? Shouldn't it be multiple definition error?
Show LessI experimented enough to use 2 pins as toggling analog input voltage to a PSOC5 Opamp without using external components or internal components.
You set them up to do both digital input and analog, with pull up/down resistors. You can then write a pattern to the 2 pins to get internally, 0v, 5v, 2.5v. Exactly 2.5v requires external resistor to +5v.
This can almost be done with a DAC, but you are limited to 4.08v.
See the following page for more info. I used a LooUpTable to correctly drive the pins in real time. Here is my blog about the psoc and other things: https://socmaker.com/?p=1598
Show Less
Explanation: (See TLDR if busy)
I am working on a rather complicated design. The UDB system is 82.5% full. I came across a warning, which in Xilinx world is devastating, but in PSOC5 world, not so much:
The bus clock must be the clock source when configuring a fixed-function timer/counter, "\POS_TIMER:CounterHW\", to run at a frequency equal to the bus clock (24 MHz).
(App=cydsfit)
There is no "Bus Clock" available in the selection of clock sources. There is no option I can choose that does not continue to give me either this warning, or an error like the following: (I tried various solutions and a 12mhz clock and a Sync component)
ADD: fit.M0031: error: Clock Error: (The MASTER_CLK's range '24 MHz +/- 0.25%, (23.94 MHz - 24.06 MHz)' intersects with clock_12mhz's range '24 MHz +/- 0.25%, (23.94 MHz - 24.06 MHz)'. A clock that does not derive directly from the MASTER_CLK cannot have its frequency intersect with that of the MASTER_CLK.).
Now, in my case, the Async nature of the clock is of no consequence. It is for two timers that count down for a blanking period, and the specs are extremely loose. It works without issues over a great temperature range. The Async error is not listed in the timing Web page until I drill deep into it, and it shows a lag of about 10ns, which not a problem for the job being done.
TLDR;
Bus clock must be used to run Timer Counter at Bus Clock frequency.
But, there is NO "bus clock" available in PSOC Creator, and if you choose the various clocks, you get another error that won't go away.
If you try to use the patented Sync function, you get an error that you can't use that clock, as it is not derived from the master clock.
How do you specify a bus clock when that selection is not available? How do you use a 24mhz clock from the selections that are available when the ones that *might* be a bus clock generate an error?
This is almost a rhetorical question, but I am curious as to how I should make this work in the future when I come across it in a critical situation.
I am stuck with a low speed bus clock for the moment, as this also has to run at 300 degrees F, which is way outside of the part specs. (Yes, I do understand. We replace the parts from time to time. Cost of doing business.)
Thanks!
P.S.
After 2 years + of I*n trying to put our company out of business, the Cypress created PSoC 5's are finally available again. I*n may have wanted our company to go away, since we are trash under their feet, but the company survived, and NOT through any help from I*n. Let's just say there are now alternatives out there, but none as good as the Cypress created PSOC3 & 5 family.
The I*n system also locked my old account due to the transition from Cypress killing my old password. Somehow info got lost inside I*n system, so I created a new login. Not a problem.
Show Less
I am using a Cy8CKIT-059 and am having an extremely difficult time trying to get a simple usb audio application to work. For a basic test, all I want to do is enumerate a USB Audio device with line-in and line-out , 2 channels, 16 bit, 48000 sps. I seem to have the descriptor correct. It shows up in Windows 10. When I set the component up for DMA with manual buffer management I am able to loop the audio packets from the out EP to the in EP.
I have now switched the USBFS to DMA with automatic buffer control. I have a simple initialization function that looks like this:
void USB_InitializeAudio(void)
{
USBFS_LoadInEP(AUDIO_IN_EP,&audio_in_buffer[0],AUDIO_BUFFER_SIZE);
USBFS_ReadOutEP(AUDIO_OUT_EP,&audio_out_buffer[0],AUDIO_BUFFER_SIZE);
USBFS_EnableOutEP(AUDIO_OUT_EP);
}
from what I understand, this initializes the USBFS internal DMAs to transfer data to/from my audio_in and audio_out buffers in RAM.
In my main loop then I look for the EP states to be either FULL for the Out EP or Empty for the IN EP and call a Servicing if either of these states occur. The servicing functions are simple also, for the OUT EP all it does is rearm with EnableEP () and for the IN EP I call the LoadInEP with the second argument NULL.
What I was expecting was the device to enumerate as desired, then when I go to play audio out it, nothing should happen as the device simply does nothing with the audio_out buffer and rearms. Furthermore, when the IN EP is Empty, it just fires the DMA to transfer the audio_in buffer contents to the IN EP.
What actually happens is that it enumerates and just hangs up the PC and cause windows to throw an error if you try to send any audio to it. Can one of the experts on this forum take a quick look at my project and tell me what key thing I'm missing? I feel like it's something stupidly simple, but I have been fighting this for a couple days now and am at a total loss.
What I'd really like is a simple project example that enumerates an audio device and just loops the audio back from output back to input using automatic DMAs. If anyone can provide that example I would greatly appreciate it. Why is it so difficult to find good USB audio examples for PSoC5, I would think this would be a common use for the device.
Thanks in advance, Kevin.
Show LessUsing a CY8C24423A, I am trying to multiplex seven different analog inputs to an ADCINC.
The documentation for analog in PSoC1 (relevant info that can be found) is confusing, or at least somewhat 'Greek to me'. Infineon's search engine is so close to being completely useless (no decent way to find multiple keywords and ignore any without all keywords, save typing 'AND' over and over).
I did get a step by step set of instruction from Bing AI that seemed promising until a step indicated adding a Ctrl_Reg from the digital tab and no such module exists... a digital tab or a Ctrl_Reg user module anywhere in user modules.
I'm using 7 pins on Port0 and what really does not compute is that the Chip Editor view of the analog section is schematic(-like) but certainly unclear as to routing these through the multiplexer (Amux8 x 2, one for inputs & one for refs).
The inputs are 4 differential voltages (one across each Cell in a 4 Cell battery), 1 voltage divided sense of the entire battery (P12V_Sense & 2 thermistor voltages for temperature sensing. I have set all these voltages such that they fall within the Vss-Vdd range (0-5V). The 4 Cell voltages use the series connection points between the cells as reference, i.e. +Cell1 uses +Cell2 as reference, +Cell2 uses +Cell3 etc. with Cell4 using Gnd as reference. The thermistors are referenced to Gnd as is the P12V_Sense line.
So, which user modules should I use, how do I place them, how do I route them and how are they configured?
I've been looking at Amux8, ADCINC, RefMux and with the AI's suggestions, the use of a Ctrl_Reg to synchronize switching of both the inputs but also the references. Not finding the Ctrl_Reg in the user modules was disconcerting and left me wondering how all this is supposed to work.
Any help would be appreciated!
Scott
Show LessHello,
The attached I2C_4_INT.c contains code created by the creator. I did not modify it.
When I'm trying to read from PSOC, after few times, I got an exception caused by line 509 (CYASSERT)
...
}
else
{
#if(I2C_4_TIMEOUT_ENABLED)
/* Exit interrupt to take chance for timeout timer to handle this case */
I2C_4_DisableInt();
I2C_4_ClearPendingInt();
#else
/* Block execution flow: unexpected condition */
CYASSERT(0u != 0u);
#endif /* (I2C_4_TIMEOUT_ENABLED) */
}
What can cause this undefined state ?
The attached I2c.c contains 2 routines to read I2C message from host (I2cSlaveRecieveMsg) and send I2C message to host (I2cSlaveSendMsg).
Can you please tell if this code is wrong ?
Thank you,
Zvika
Show LessHi Sir,
We have a question about the Cypress PSOC application and would like to inquire about it. We are currently using CY8C3246, and firmware uses Watchdog From the description of the library function, there are four timer periods We have already chosen the longest interval. CyWdtStart (3,0)// Enable WDT 2.048-3.072s Are there any ways we can use longer timer periods?
Thanks!
Alex.Wang
Show LessHello, around 4-5 years ago I used a component called "PSFB" or phase shifted full bridge, if I recall correctly. I recently started using PSOC Creator again and would like to use this component again but I cannot find a project example in Creator or online in a repository. I can find the documentation of using the component though. PSoC® 3 and PSoC 5LP - Phase-Shift Full-Bridge Modulation and Control (infineon.com)
Can anyone help me locate this project example.
Thanks,
Patrick
Show LessHi
I need to use sprintf function with float numbers. But it does not work.
val=1.2243;
sprintf(text,"Value=%f",(float)val);LCD_Position(0u,0u);
LCD_PrintString(text);
Is there a setting in this regard?
Show Less