10 Replies Latest reply on Oct 20, 2013 7:12 PM by christopher.keeser

    Automagically Assign Pin locations using the Pin Name!

    christopher.keeser

       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[0] 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[0] 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[4]!

         

      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

        • 1. Re: Automagically Assign Pin locations using the Pin Name!
          christopher.keeser

          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.

             
                
          • Px_y_your_name_here
          •     
          • your_name_here_Px_y
          •     
          • Px_y
          •    
             

           

             

          !!!!!   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

          • 3. Re: Automagically Assign Pin locations using the Pin Name!
            user_78878863

            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?

            • 4. Re: Automagically Assign Pin locations using the Pin Name!
              user_1377889

              Cool helper!

                 

              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.

                 

               

                 

              Bob

              • 5. Re: Automagically Assign Pin locations using the Pin Name!
                christopher.keeser

                 Hello Gents!

                   

                 

                   

                 

                   
                      
                • 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.     
                          
                  • Not True First and formost, the PinHelper component only works on unlocked pins.  If a pin is locked in theDWR, the PinHelper cannot and will not move it.  I guess I also dont see the problem with changing projects between boards, since you will have to move the pins anyway.  This component allows you to save one step, by allowing you to automiatically assign unlocked pins to the proper pin location by adding pin location information to instance name of the pin.  Its also much easier to read where the pin is located that way in the schematic.  Use of this component is purely optional, if you dont place it on your schematic, it wont help you with anything.
                  •      
                •     
                • Or does this plugin respect manual choices made there?
                       
                          
                  • It is not a plugin, its a component, and yes, any manually placed pins, or pins that are locked will not be touched by this component.  This component will only attempt to automatically place unlocked pins that follow the naming convention outlined above.  I also want to re-iterate, if you dont want to use, you dont have to place the component on your schematic.  If the component is not placed on the schematic, it cant do anything to assist you.
                  •      
                •    
                   
                      
                • When the given I/O name is specifying a pin already in use and locked, the original connection should not be broken up.     
                          
                  • I'm guessing neither of you downloaded and tried the component before offering your critiques.  The PinHelper component cannot place a pin on a location that is already consumed by some other locked pin.  It will generate an error and inform you of the conflict.
                  •      
                •     
                • When the original pin is not locked, at least a note of "Disconnecting..." should be issued.     
                          
                  • Sorry, the component wont be able to do that.  At its core, the component is just a control file that locates pins with names that follow the pattern and attempts to place them in the right place.  If you have an unlocked pin in some pre-defined location, its understood that it can be moved at any time by creator when you generate the application, and no warning is issued.  I didn't hack creator to do something crazy, I just used an existing tool (the control file) to provide a useful helper.  So if creator doesn't issue a warning when it moves an already assigned, but unlocked pin, thats not the fault of my component.
                  •      
                •    
                   

                I wish to re iterate my original post:

                   

                 

                   

                 

                   

                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 with "P0_0" in the instance name would automatically assign it to the pin location P0[0] 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.

                   


                   

                 

                   


                   

                The KEES_PinHelper component includes a control file that looks for pins that contain Px_y in the instance name 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 and it will not move.

                • 6. Re: Automagically Assign Pin locations using the Pin Name!
                  user_78878863

                  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 :)

                  • 7. Re: Automagically Assign Pin locations using the Pin Name!
                    muf

                     Suggestion on Pin Label Format Option.

                       

                    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?

                       

                    Regards

                       

                    Mark

                    • 8. Re: Automagically Assign Pin locations using the Pin Name!
                      user_1377889

                      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.

                         

                       

                         

                      Bob

                      • 9. Re: Automagically Assign Pin locations using the Pin Name!
                        user_14586677

                        @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.

                           

                         

                           

                        Regards, Dana.

                        • 10. Re: Automagically Assign Pin locations using the Pin Name!
                          christopher.keeser

                           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.