PSoC™ 4 Forum Discussions
Background to the issue:
When customers use PSoC Creater, sometimes in order to fix bugs or find problems, they often need to add customized test programs to the code in Generated_Source, but if they add user-defined code directly to the code in Generated_Source, it will be overwritten once it is recompiled, is there a way to make the code in Generated_Source not be overwritten? Is there a way to make sure that the code in Generated_Source will not be overwritten by the customer's own additions?
Solution:
1Macro Callbacks
Macro Callbacks is a term defined in PSoC Creator to call user code from macros specified in a Component's generated code. These macros can be used by defining them in the user-defined header file named cyapicallbacks.h. This file will be included in all generated source files that offer callbacks.
A callback requires you to complete the following.
- Define a macro to signal the presence of a callback (in cyapicallbacks.h ).
- Write the function declaration (in cyapicallbacks.h ).
- Write the function implementation (in any user file).
To complete the example, the cyapicallbacks.h file would include this code.
#define SimpleComp_1_START_CALLBACK
void SimpleComp_1_Start_Callback( void ).
In any other user file, you could include cyapicallbacks.h and write the SimpleComp_1_Start_Callback() function.
For example.
2,
Merge Regions
Merge Regions provide another method to insert user code, through the use of specially marked sections in generated code, such as.
/* `#START isr_Interrupt` */
/* `#END` */
Anything you place in this region will be preserved in subsequent updates of the file. If a subsequent version of the file does not contain the same named region, the entire region from the previous file will be copied to the end of the file and placed in comments.
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/PSoC-4/PSoC-Creater-IDE-%E5%A6%82%E4%BD%95%E4%BF%AE%E6%94%B9-Generation-Code/td-p/492049
Show LessBackground to the issue:
When using the Em_EEPROM function module of PSoC ™ 4 and using PSoC Creator to simulate and debug, the customer found that once the program runs to the "Em_EEPROM_Write" function, the simulation will be interrupted, and the following error message appears:
Problem Analysis:
1, Em_EEPROM implementation mechanism is in the chip's internal Flash divided into a region as Em_EEPROM storage space, so the erase and write of the analog Em_EEPROM is ultimately called to the internal Flash erase and write operations.
2, the operation of the chip internal Flash must use the internal clock, if the customer project is using an external clock, and did not turn on the internal clock, when writing FLash operation must be switched to the internal clock, wait for the Flash write operation is completed in the re-switching bit internal clock. After the write operation is completed, the internal clock is turned off during the process of switching to the external clock, which leads to the above exception error.
3, the user outside the use of Flash operation regardless of the time when the system uses the external clock need to turn on the internal IMO:
This avoids the need to simulate the project with internal flash writing operations.
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/PSoC-4/PSoC-4-%E6%A8%A1%E6%8B%9FE2%E4%BB%BF%E7%9C%9F%E5%BC%82%E5%B8%B8%E4%B8%AD%E6%96%AD%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/td-p/492044
Show LessCould you provide a routine that can be used in the PSOC4100S PLUS and other similar demo boards?
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/PSoC-4/MTB-proximity-sensor-for-psoc4100S-Plus-example/td-p/489680
Show LessCY8C4045FNIを使っています。
Cypress PSoC Creator を使ってデバイスのタッチ センサーをデバッグしました。 デバッグが
終わったので、Arudino 環境の I2C でタッチセンサー認証データを読み出したいのですが
SlaveAddressとRegisterAddressでのAccessではなくBaseAddressにてアクセスするようなのですが
指定方法が表示されません。
どうすればよいのか教えてください。
Show LessCan non-Automotive PSOC4 support touch screens, and what is the maximum size or resolution that can be supported? Gen6 and Gen7 are not adopted due to their high prices。
Show Less
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/PSoC-4/mtb-v3-0-CY8CKIT-145-40XX-%E4%B8%8B%E8%BD%BD%E7%A8%8B%E5%BA%8F%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98-%E6%80%8E%E6%A0%B7%E5%8D%87%E7%BA%A7%E5%91%A2/td-p/481044
Show LessHi Infineon.
This thread is additional question regarding the content of the link below.
Could you please let us know about “IMO AC specifications” of table 32 in PSoC 4100S Max DS?
Both SID223 and SID223B values are ±2.0%.
Case1)
SID223 temperature range is from -40deg to 85deg.
In other words, IMO accuracy at -40deg can be considered to be ±2.0%.
Case2)
SID223B temperature range is from -30deg to 105deg.
In other words, IMO accuracy at 105deg can be considered to be ±2.0%.
In other words, when considering Case1) and Case2) together, IMO accuracy can be considered to be ±2.0% in the range of -40deg to 105deg.
However, IMO accuracy of SID223A with the same temperature range(-40deg to 105deg) is ±2.5%.
Even though the temperature range is the same, there is discordance in the spec value.
What should I think about this?
Because the word "parts" is purposely used in datasheet, device parts with a temperature range of SID223A cannot be referenced to values in other specifications(for example, SID223C, SID223D etc), even if the temperature range during actual use is narrower than the product specification.
=========================================================
At 0°C to 85°C, for enhanced IMO extended industrial temperature range parts
=========================================================
Is the above understanding more correct than the previous Infineon’s answer(below link)?
(When asked about IMO accuracy of device parts with temperature range of -40deg to 105deg(SID223A), the only answer is “IMO accuracy is ±2.5%.”, regardless of the actual temperature conditions?)
Best Regards.
YuMa
Show LessHello. I have an IRQ for my serial device that looks similar this:
CY_ISR(uart_isr) {
if (h_UART_CHECK_INTR_RX_MASKED(h_UART_INTR_RX_NOT_EMPTY))
{
uint32_t data = h_UART_UartGetByte();
uint8_t byte = data & 0xFF;
// Ignore any errors.
if ((data & 0xFFFFFF00) != 0) {
return;
}
queue_data(&queue, byte);
h_UART_ClearRxInterruptSource(h_UART_INTR_RX_NOT_EMPTY);
}
}
But I get an issue where I will occasionally get an underflow error. Which is to say on the `((data & 0xFFFFFF00) != 0` will be true. It is not a framing or parity error, but the underflow error. But I don't understand how that could happen since I am specifically checking for the FIFO not being empty. Alright, so I made an alternative.
CY_ISR(uart_isr) {
if (h_UART_CHECK_INTR_RX_MASKED(h_UART_INTR_RX_NOT_EMPTY))
{
for (uint32_t count = h_UART_SpiUartGetRxBufferSize; count > 0; count--) {
uint32_t data = h_UART_UartGetByte();
uint8_t byte = data & 0xFF;
// Skip errors
if ((data & 0xFFFFFF00) != 0) {
continue;
}
queue_data(&queue, byte);
}
h_UART_ClearRxInterruptSource(h_UART_INTR_RX_NOT_EMPTY);
}
}
And this ends up being even worse somehow. Count will be a positive number, but then it will skip each byte received.
Basically what I'm asking if, how can it be possible for
h_UART_CHECK_INTR_RX_MASKED(h_UART_INTR_RX_NOT_EMPTY)
to be true, but then there be an underflow error in the byte read? I did a test and every error it received was an underflow. If I inspect the values that get received upon this underflow, some are actual data sent (aka not an underflow) and some are just junk.
This has been a thorn in my side for months but so far my solution has been "about one in fifty messages fail for some reason," but that is getting old.
Show LessFor PSOC4,we will design touch buttons.
As for the touch button, we are thinking of using transparent electrodes such asITOfilm to pass light.
We believe that it will be a one-sided pattern design from the viewpoint of cost.
If you look at the manufacturer's materials,
└ 3.8.15 CAPSENSEsystem design for single-layer printed circuit boards
Please contact us for details.
Regarding the above, could you send us any design guidelines for touch switches on single-layer boards?
Show Less