10 Replies Latest reply on Dec 11, 2019 3:41 PM by dar303

    Create library device to use board as component?

    gwideman

      What's the best way to create a device from an existing Eagle schematic/board design?

       

      That is, you have an existing board, for which you have the Eagle project, and you now want to make a library component so you can use that board as a component on another board.

       

      Example, picked at random:

      https://www.adafruit.com/products/269

      https://github.com/adafruit/Adafruit-MAX31855-breakout-board

       

      ... and you want to use that board as a component on a new board.

       

      Obviously the existing Eagle board project contains a lot of data that could be used in the library component, but I am not seeing a straightforward path to making that happen.

       

      I've tried two approaches, neither of which worked well. (Using the example board.)

       

      1. I tried copying salient layers from the Board editor to the Library package editor: Layers Pads, Dimension, tPlace, tOrigins, bOrigins, Drills, Holes

       

      • During the group Copy process (Board editor viewing the source board) I got error message: "Can't backannotate this operation. Please do this in the schematic!". This seems bogus, since Copy shouldn't change anything in the source data. Nonetheless, something did appear to get copied to the clipboard ...
      • During the Paste operation (into the destination library component Package), the initial movable visualization showed the entire board data seemingly about to be pasted (not just the layers I'd selected), but then when I went to actually paste, I got message "Skipped unsuitable objects", and the only things that actually pasted were items on the Dimension and tPlace layers. So, no pads or holes.

       

      2. An alternate approach I tried was to use an image of the board as an underlay in the Package editor, over which to stick all new pads, holes, text and so on.

       

      • I made an image of the board's package, either using Eagle layout editor Export > Image, or just a screen shot of the layout
      • I used import-bmp.ulp, to get this background into the Package editor.  This "works", though it converts the bitmap into a huge mess of rectangles and/or lines, on separate layers per color. It's good that they are on separate layers, but to use this background of course it must be visible, in which this proliferation of shapes makes it difficult to pick and move the actual useful new pads, text and so on.
      • This seems very manual and crude, failing as it does to take advantage of the exact pad positioning, outline, holes, pad and pin names and so on that's already in the existing board project.

       

      Is there a better way to go about this?

       

      -- Graham

        • Re: Create library device to use board as component?
          gwideman

          Additional note:

           

          If creating the new component mostly manual, one time-saver is to find the library components that the original board used (for example, its headers), and copy that component's package into the new library component.  For this purpose, it can be useful to open the original board file and export its library using exp-lbrs.ulp.

           

          Still laborious, but saves having to recreate individual pads and their silkscreens.

           

          -- Graham

            • Re: Create library device to use board as component?
              Autodesk Guest

              On 8/7/2015 7:47 PM, Graham Wideman wrote:

              Additional note:

               

              If creating the new component mostly manual, one time-saver is to find

              the library components that the original board used (for example, its

              headers), and copy that component's package into the new library

              component.  For this purpose, it can be useful to open the original

              board file and export its library using exp-lbrs.ulp.

               

              Still laborious, but saves having to recreate individual pads and their

              silkscreens.

               

               

              Hi Graham,

               

              I think the best way to handle this is to use the EXTERNAL attribute

              to to create a symbol representing that board.

               

              Check out the libraries that Newark distributes for Arduino, BeagleBone,

              and Raspberry Pi.

               

              They use this method to indicate on the schematic that an external board

              needs to be plugged into.

               

              I think this is what you need from reading the rest of the posts.

               

              Let me know if there's anything else I can do for you.

               

              Best Regards,

              Jorge Garcia

               

               

                • Re: Create library device to use board as component?
                  gwideman

                  Hi Jorge: Thanks for the reply.

                   

                  I am pretty sure you misunderstood this question.  In a separate thread I asked how to represent an off-board component, for which you suggested using the [underscore]EXTERNAL[underscore] attribute, and that was great (-ish... still requires separate library part -- sniff).

                   

                  Here I'm asking how to start with schematic/board "A", (one that probably has headers on it that can plug into another board), and use that existing project "A" to create a device/package/symbol ("A-As-Component") that can be used on schematics/boards ("B"..."Z") that can receive A-As-Component.

                   

                  I don't see how EXTERNAL helps at all with that.

                   

                  > Check out the libraries that Newark distributes for Arduino, BeagleBone, and Raspberry Pi.

                  > They use this method to indicate on the schematic that an external board needs to be plugged into.

                   

                  Actually, I just used the Arduino library in another project. It doesn't involved indicating EXTERNAL anywhere. It provides an Arduino symbol/package/device which gets *included* on the new PCB -- that's kind of the point.

                   

                  But since you bring it up, the process I'm asking about is the process for producing such a library component (like Arduino) when you already have the schematic and footprint of the Arduino.

                   

                  -- Graham

                • Re: Create library device to use board as component?
                  gwideman

                  Hi Morosh, thanks for the suggestion.

                   

                  I see how this collection of scripts and ULPs address hierarchical design (presumably less needed with Eagle 7?), but I don't see how it relate to my problem.

                   

                  Bear in mind, I'm not trying to do hierarchical design where I am revising the smaller module so its schematic can become part of a larger schematic, from which to make a single integrated board.

                   

                  I actually want to use the already existing physical product as a plug-in (or solder-on) component on a new board.

                   

                  I don't need to include the existing board's schematic in my own hierarchical schematic, nor do I want the existing board's circuitry to be "reprinted" onto my new board. I just want to use the existing board, as is, as a component. Hence I need a library part for that existing board.

                   

                  I hope I didn't misunderstand your scripts and ulps -- but I think they don't help for my task (except perhaps as sample code if I need to write this from scratch).

                   

                  -- Graham

                    • Re: Create library device to use board as component?
                      Morosh

                      these collection of scripts and ulps serve two goals: hierarchical designs and transforming a couple schematic/board to a device in a library so it can be used as a normal component, simply don't use ulps for hierarchical designs

                      HTH

                        • Re: Create library device to use board as component?
                          gwideman

                          Hi Morosh -- I messed around with this for an hour in hopes of understanding what it does but got stuck.

                           

                          First, my guess was to do this:

                           

                           

                          I ran into several problems, and finally got to one I don't know how to solve, so I stopped.

                           

                          1. The generated toto.scr file includes lines to rem existing dev and sym. This causes error dialogs to appear. I modified code to avoid those dialogs, but later discovered that was unnecessary, it's possible to just OK the error dialogs and continue.

                           

                          2. I ran into further errors attributable to there being a space in the file name of the schematic and board which the code didn't handle. I fixed that by renaming the board and schematic.

                           

                          3. Now the code hits an error at:

                           

                          create_package.ulp   "Reference to uninitialized object variable"

                           

                                E.package.contacts(c) {

                                    dia = c.pad.diameter[1]/GRID_DIV;   <---- error

                                    xx1= c.pad.x/GRID_DIV;

                           

                          It looks like c should be initialized by contacts(), so I'm not sure what's going on, and I'm not familiar with what debugging strategies are available for eagle ulps.

                           

                          -- Graham