In order to change the frequency, spi mode, etc associated with component you would have to add these as parameters to the component.
To do so, go to the cysym file of the custom component you have created > Right click and Select Symbol parameters...
Add the desired parameters in the parameter definition dialog box as shown in the figure below:
Set the 'Hardware' flag to "True" in the Misc settings field. This exposes the parameter to the Verilog code so that the UDB hardware can use it.
Please refer to the Adding parameter section (on page 23) of the Designing PSoC Creator Components with UDB Datapaths: https://www.cypress.com/file/41531/download
for detailed steps to add parameter.
Please let me know if this resolves the issue.
Thanks for the fast reply. I have tried to set the 'Hardware' flag to "True" and it did not work for me. This is the case when I try to make my own component that is like in the CE204087 project. The parameters that are on symbol page are not changing anything on the schematic page of the component.
Further more, when deleting the parameter spi_frequency on the symbol page of the CE204087 project it gives me this on the schematic page of the component
which would mean that that SPI_CLK component, and SPIM component are somehow altered to take the values of the parameters that are defined on the symbol page(spi_mode and spi_frequency).
My question would be, how to connect the parameters on the symbol page with the components that are on the schematic page?
This looks like somehow the symbol of the clock component from CyPrimitives has modified parameters of desired_freq and desired_freq_unit. I assume desired_freq takes the value of the 2*spi_frequency, and that desired_freq_unit is set to 3 so it can be in kHz. Only I don't understand how to do this since CyPrimitives can't be edited, and this seems like a local instance of the component which I don't know how to make. I hope this didn't get more confusing then it already is
1 of 1 people found this helpful
Attached is demo project showing how to pass a parameter from custom component to internal component (e.g. clock). It is simple, but takes time to explain. Please follow steps below.
1. Custom component have simple parameter "Frequency" (1000 kHz), which we want to pass to internal Clock_1 (which has default setting 12 MHz):
2. Let's create a component "myComponent" and add parameter "Frequency".
3. Now we need some magic to be able to pass this Frequency parameter to Clock_1.
First we need to update Project->Options:
4. Now lets set Clock_1 parameters. Open Clock_1 settings:
5. First change MHz to kHz:
6. Now is the trick: Use Left-mouse button over Basic parameters and notice a drop-down menu. Now select "Show Expression View":
This is what shows up:
7. Replace "12" with parameter "$Frequency":
Done! Now Clock_1 in the myComponent set to 1000 kHz. Project attached.
1 of 1 people found this helpful
Yes, that is what I tried to figure out this whole time! I did read the PSoC Creator Component Author guide, but either I overlooked it or it's not there, and is in another document about PSoC Creator for example. This is fairly simple, yet I couldn't find it.
Thank you very much
P.S. I also have question about using custom NVRAM component and external memory interface address map but I'll open another topic about that.