I'm in the habit of putting the pin location into the instance name of all my pin components. It makes it really easy to see where a signal is connected by looking at my schematic (that tiny text in the pin itself is just no good!).
But I have often wished that naming a pin "P0_0" would automatically assign it to the pin location P0 in the design wide resources tab. Well my friends, the wait is over! Place the KEES_PinHelper component into your design, and any pin named with the Px_y format will be automatically assigned to the proper location when you generate the application.
Name your pin P0_0 and the pin will be automatically assigned to P0 when you generate the application. If you rename the pin to P12_4, when you regenerate your project, it will automatically be reassigned to P12!
The KEES_PinHelper component includes a control file that looks for pins that are name Px_y and tries to assign them to the appropriate pin. In order for the control file to work, the component must be placed on your schematic. Multiple PinHelper components can be placed without conflict. If a pins position is locked in the pins tab of the cydwr, then you can rename the pin to whatever you like. The component will not work with pin names that have arbitrary text after the pin location information. i.e. "P4_7" will work, but "P4_7_foobar" will not work.
!!!!! The attached file is .CYCOMP archive of the component. To use the file, download the file and change the extension from .zip to .cycomp and import the component into your project or personal library
Attached is the long awaited version 1.1 of the insanely popular KEES_PinHelper component!
Version 1.1 adds even more flexibility by allowing you to add pin location information to your descriptive pin names while still providing automagic pin assignment. Just follow this simple naming convention and enjoy the benefits of automatic pin assignements and easy to read schematics.
This is cool stuff.
One drawback which I see is that it makes it more complicated to move projects between different boards. Or even just to change pins later on - for that I then need to search for the pin on the schematic, instead of doing that in the design wide ressources.
Or does this plugin respect manual choices made there?
I have a suggestion for improvement:
When the given I/O name is specifying a pin already in use and locked, the original connection should not be broken up.
When the original pin is not locked, at least a note of "Disconnecting..." should be issued.
I wish to re iterate my original post:
I did not want to belittle your work. I should just have asked the question about the locked pins (because anything else follows naturally from that).
Sorry for the confusion...
(Since I'm a software developer by day, I call anything extending the behaviour of software without modifying it a plugin 🙂
Nice component, NPS 10, Just a suggestion , I'm a little more time efficent with my typing and don't typically use the underscore for Port_Pin numbers but concantinate them.
So P4_2 would be P42. To much old 4 and 8 bit processors. Since with PSoC we have few wide external busses this still holds true for PSoC345. Could you consider also support for the pin labelling Pxy as well as Px_y?
I would not recommend doing that. Throughout the whole PSoC family starting from schematics to the documentation a pin is always named "P",PortNumber,Underscore;PinNumber. So I would consider it as creating misunderstandings when this scheme is broken or shortened.
@muf, I concur, that would be a nice option. I do that manually now. In fact
I generally name a pin with both a functional name and the board pin name
w/o all the underscores.
Just personal preferences. I do the same to other component names as well.
MUF, put your suggestion where you mouth is and try modifying the component yourself 😉
but seriously, I think you will have some problems getting what you want since the expression parsing is veeeery basic, and telling it to identify Pxxy may not be possible. The underscore allows the expression to be parsed into a Pxx_y where it has a clear separator between port and pin.