1 Reply Latest reply on Aug 15, 2019 12:26 PM by BoTa_264741

    Configuration expressions - define a compile-time constant?

    RoRo_3281831

      When configuring an item on the PSoC schematic in PSoC Creator, many of the parameters used to configure the item have a "f(x)" button off to the right that seems to be there to allow you to define the value based on other parameters.

       

      Clicking on it brings up a box that allows one to enter an expression, and on the right side there is tree full of sources from which one could pull various constants and operators.  For example, I can look at the device information and use that somehow.

       

      However, what I'd really like to do is set a constant parameter somewhere (i.e. perhaps in project settings somewhere) and use that to configure many components.  For example, I often end up changing the "Width" parameter on digital components based on whether I want to work with 8 bit, 12 bit, 16 bit values or whatever.  I end up having to hunt around my entire schematic and find every digital component and constant and set them all to the same constant value. It seems like I should be somehow able to use this "expression" functionality to set that value in one place and have my design updated.

       

      Is such a thing possible?  I've tried to find documentation on how to use these expressions, but I was only able to find this:  https://www.cypress.com/file/37371/download

      That document only described basic expression syntax, and is written for PSoC Express, not PSoC Creator.

        • 1. Re: Configuration expressions - define a compile-time constant?
          BoTa_264741

          RoRo,

          One way of sharing a parameter (e.g. BusWidth) across several components on the schematic is to encapsulate that entire schematic into a new component. For example, there is a Control_Reg and Status_Reg on the schematic. The top component should have parameter BusWidth. Inside the component, add a Schematic, copy-paste Control_Reg, Status_Reg (and all associated connections), and pass them $BusWidth parameter in their configuration dialogs.

           

          Some Creator components (created with C# customizer, like Control- and Status- Registers) have their parameters buried behind the configuration screen. Read this explanation provided by Bob Marlow, how to pass $BusWidth to them (memo attached).

          Re: Component creation. Part 1 of ?

           

          /odissey1