15
A tutorial on EAGLE Mehul Tikekar July 13, 2009 Contents 1 Introduction 2 1.1 What is EAGLE? ......................... 2 1.2 The design flow .......................... 2 2 Making a schematic 4 2.1 Components and libraries .................... 4 2.2 Making connections ........................ 5 2.3 Changing names and values ................... 6 3 Making a board 7 3.1 The grid and the layers ...................... 7 3.2 Placing components ........................ 8 3.3 Routing and vias ......................... 10 3.4 Autorouting and ground planes ................. 11 4 What next? 13 4.1 Design Rule Check ........................ 13 4.2 Gerber files ............................ 13 5 Miscellaneous 14 5.1 Special considerations for prototyping boards .......... 14 5.2 Shortcuts and hotkeys ...................... 14 5.3 Backups .............................. 15 5.4 Check these out .......................... 15 1

Eagle Tutorial Tikekar

Embed Size (px)

Citation preview

Page 1: Eagle Tutorial Tikekar

A tutorial on EAGLE

Mehul Tikekar

July 13, 2009

Contents

1 Introduction 21.1 What is EAGLE? . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 The design flow . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Making a schematic 42.1 Components and libraries . . . . . . . . . . . . . . . . . . . . 42.2 Making connections . . . . . . . . . . . . . . . . . . . . . . . . 52.3 Changing names and values . . . . . . . . . . . . . . . . . . . 6

3 Making a board 73.1 The grid and the layers . . . . . . . . . . . . . . . . . . . . . . 73.2 Placing components . . . . . . . . . . . . . . . . . . . . . . . . 83.3 Routing and vias . . . . . . . . . . . . . . . . . . . . . . . . . 103.4 Autorouting and ground planes . . . . . . . . . . . . . . . . . 11

4 What next? 134.1 Design Rule Check . . . . . . . . . . . . . . . . . . . . . . . . 134.2 Gerber files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

5 Miscellaneous 145.1 Special considerations for prototyping boards . . . . . . . . . . 145.2 Shortcuts and hotkeys . . . . . . . . . . . . . . . . . . . . . . 145.3 Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155.4 Check these out . . . . . . . . . . . . . . . . . . . . . . . . . . 15

1

Page 2: Eagle Tutorial Tikekar

1 Introduction

1.1 What is EAGLE?

EAGLE stands for Easily Applicable Graphical Layout Editor. It is a veryconvenient software you can use for designing printed circuit boards (PCB).It has lots of nice features and using it is quite simple. A free version ofEAGLE can be downloaded from the CadSoft website. Although the freeversion has some limitations, they aren’t too restrictive and you should beable to get along with it, unless you have a really large and complicatedboard to design.

We shall learn to use EAGLE by way of an example : the USBasp. US-Basp is a USB programmer for the AVR microcontrollers and is a very usefulcircuit if you are using AVR microcontrollers in your projects. Through-out the tutorial, the technical terms used in pcb design are highlighted .These are standard terms and you should avoid using alternate words so asto prevent confusion while communicating with others.

1.2 The design flow

Designing in EAGLE starts with making a schematic. The schematic is onlya circuit diagram and contains no information about the size and placement ofthe components or the routing of connections i.e. no physical details. It onlytells how the components are electrically connected to each other. From theschematic, EAGLE generates an initial board which has all the componentsand indicators of the connections between them. You have to properly placethe components and convert the indicated connections to actual routes ason the pcb. The completed board file is, essentially, your pcb design.

The pictures below show the different stages of a typical pcb development.The first image is the schematic. The second one is the board with thecomponents properly laid out and the connections routed. The photographbeside it is the actual board made by a professional manufacturer.

2

Page 3: Eagle Tutorial Tikekar

Figure 1: An example schematic (not USBasp)

Figure 2: The board design and the actual board

Notice how the red routes in the board design correspond to the actuallight-green traces on the pcb. The white lines denote the outlines of thecomponents which are yet to be soldered on the board. Also note that thegreen pads become the tinned areas where the components get soldered.

3

Page 4: Eagle Tutorial Tikekar

2 Making a schematic

The best way to use this tutorial will be to actually carry out the instructionsas you read them. So, at this stage, you should download, install and runEAGLE if you haven’t already done so. To create a new schematic, go toFile > New > Schematic in the EAGLE Control Panel Window. This opensup a new Schematic window.

2.1 Components and libraries

A schematic is made by adding components and connecting them together.There are a lot of predefined components available in EAGLE. These com-ponents are grouped into libraries. For example, resistors, capacitors andinductors can be found in the rcl library. The ATmega8 microcontroller is inthe Atmel library. If a component is not available in the EAGLE libraries,you can download some more libraries from the web. If you are using ahighly customized component, you will have to make a new library and cre-ate the component. But more on this later. For now, rest assured that allthe components used in USBasp are available in the EAGLE libraries.

To add a component to the schematic, go to Edit > Add in the schematicwindow. An Add button is also available on the left pane. Then, select thecomponent from the appropriate library or use the search function. Somecomponents are available in many packages. In this case, you need to se-lect the package you have. For example, the ATmega8 has three variantsMEGA8-AI, MEGA8-MI and MEGA8-P corresponding to the MLF, TQFPand PDIP (or DIL) packages. See the ATmega8 datasheet for more infor-mation about these packages. In our example, we shall be using the PDIPpackage; hence choose MEGA8-P. The Add window also shows how the com-ponent looks on the schematic and on the board. In addition, there is someextra information about the component and the package. Note that it is notstrictly necessary to select the correct package at this stage. We are onlymaking a schematic which, as explained before, does not incorporate thesephysical details.

Resistors, capacitors and inductors are available in a huge variety of pack-ages. In this case, just select any package and add the component. We canchange to the correct package while designing the board. A list of com-ponents we need for the USBasp circuit is given below. Add them to theschematic.

4

Page 5: Eagle Tutorial Tikekar

Component Library Component name How manyATmega8 atmel MEGA8-P 1Crystal crystal CRYSTALHC49S 1

Resistors rcl R-EU 9Capacitors rcl C-EU 4

LEDs led LED3MM 2Zener diodes diode ZENER-DIODEZD-2.5 2

USB connector con-berg PN87520 12 pin header pinhead PINHD-1x2 24 pin header pinhead PINHD-1x4 1

6 pin connector con-amp-quick M06 1

Table 1: List of components in USBasp

Searching for the names should get you the component. In case the namesare different in your version of EAGLE, just look for it manually in thecorresponding library. After you search once, your next search will happenwithin your search results. To make a new search within all libraries, makean empty search and all the libraries will be listed for searching afresh. Youcan move components around by Edit > Move. Left-click on the componentyou want to move, move it to the right location and left-click again to placeit there.

You can rotate components with Edit > Rotate. You can also rotate thecomponent while moving it by right-clicking. This will rotate the componentby 90,◦ counter-clockwise and you can continue moving it around or rotatefurther. Note that the zoom commands are in the View menu. Using Zoomto fit will zoom and re-center your view so as to bring everything on theschematic in the screen.

2.2 Making connections

Once some components are added, you can begin connecting them. To makeconnections, use the Draw > Net button and connect the components as inthe schematic. You can quickly check the connection by moving the com-ponents around. If the net is connected to the component pin, it will movealong with the component. The connection between two overlapping nets isindicated by a junction dot. EAGLE places the dot at the junction auto-matically if the nets are connected, else you can manually put a dot usingDraw > Junction.

5

Page 6: Eagle Tutorial Tikekar

The symbols in the supply1 library can be used to make the power con-nections. Since a typical circuit has a lot of power connections, using thesymbols makes the schematic look a lot cleaner. For example, the two cir-cuits shown below are equivalent, but which one looks better is perfectlyclear.

Figure 3: Supply connections

The basic idea is that if two nets have the same name they are implicitlyconnected even if there is no net connecting them. When you connect a netto a +5V or a GND symbol, the net automatically gets named ‘+5V’ or‘GND’ respectively. Thus, all nets connected to the +5V symbols have thename ‘+5V’ and are implicitly connected together. You can check the namesof the nets by right-clicking on them and selecting Properties. Alternatively,you can use View > Show and select a net. All the nets and pins connectedto this net will get highlighted.

2.3 Changing names and values

Although this is not strictly necessary, it is a good practice to change thenames of components and nets to reflect their purpose in the circuit. Simi-larly, the component values should be set to the actual numbers we intend touse in the circuit. Nets and components can be renamed using Edit > Namewhile the component values can be set using Edit > Value.

The completed schematic for USBasp is in the RAR file. You should useit as a reference and make one yourself. Save your schematic as usbasp.sch

6

Page 7: Eagle Tutorial Tikekar

3 Making a board

Once your schematic is ready and saved, you can start making your board.To do so, go to File > Switch to board. A new board file with the nameusbasp.brd will be created and opened for editing in a Board window. Rightnow, you will see that the board has all the components you put on theschematic. The nets on the schematic are represented by yellow wires on theboard.

3.1 The grid and the layers

The first thing to do when designing a board is to set up the XY grid. Go toView > Grid in the Board window and turn the Display on. Make the Size0.05 inch and leave the other settings as they are. A grid with a unit lengthof 0.05 inch will become visible. The grid size and the current coordinatesof the cursor are shown near the top-left corner. EAGLE has an option ofsetting an alternate grid with a different grid size. This is the Alt setting inthe Grid dialog box. Although this grid is always invisible, it has a use whichwill be explained later. So just make a mental note of this at this point. Ifyou are using the free version of Eagle, you will see a white 3.95 inch x 3.15inch rectangle. That is the maximum sized board you can design in the freeversion.

Before you start routing the wires, you should understand that the pcbtracks can be laid on both sides of the board. In fact, for more complicateddesigns, the pcb is made of many layers stacked on each other, with tracks oneach layer. For the USBasp, we shall be using a single-sided board. Hence,only one layer, the Bottom layer, will be used for routing.

The complete list of layers can be checked at View > Display/hide layers.For the free version, only the Top and Bottom layers are available for routing.You will also notice many other layers like Unrouted, Dimension, tPlace,tNames, tValues, etc.. These layers can be used to view or hide groups offigures and shapes at a time. For example, the names of components on thetop layer are on the tNames layer. So, hiding that layer will cause all thenames of the top-side components to disappear. Similarly, if you want to seeonly the tracks on the bottom layer, you should hide all layers except theBottom layer. Find out which layer the white rectangle for the board size ison.

For now, keep the default layer settings. Group all the components to-gether using Edit > Group and dragging a rectangle around all the compo-

7

Page 8: Eagle Tutorial Tikekar

nents. Now go to Edit > Move and press Ctrl + right-click to move theentire group around. Bring the group into the white rectangle and left-clickto place it there. Your Board window should look something like this:

Figure 4: The board window

3.2 Placing components

Even though the components are grouped together now, you can move theindividual components . The group you defined earlier is valid even if youmove, rotate, delete, or do anything to its members.(you can try Ctrl+right-click to see that). Once a group is defined, it remains valid until you defineanother group. Only one group can remain valid at a time. Another thing is,you will notice that the components move only in steps of 0.05 inch in eitherdirection which is the grid size you have set. Sometimes you may want tomove the components by a smaller distance. For this, you can press Alt whilemoving them. This makes the components move according to the alternategrid size which is set smaller than the normal grid size. If you want to movea specific component with a really great precision, you can just specify itscoordinates in its properties by right-clicking on it. We will now look atplacing the components.

The basic idea of layout is to make the circuit as compact as possible.There are many reasons why a small circuit is desirable:

8

Page 9: Eagle Tutorial Tikekar

1. Cost of manufacturing a board is proportional to area of the board.

2. A large board means longer tracks than needed. This means that thetracks will have higher parasitic properties like resistance, capacitanceand inductance. This causes many problems. For example, a longpower supply track will have a significant voltage drop across it if it iscarrying large currents. The capacitance between two wires will reducethe maximum speed at which they can transmit digital signals. Besides,you have capacitive and inductive coupling of noise.

3. When designing pcbs for robots, space is often a constraint.

4. Small looks cool. After all, we are in the nano-age.

However, take care not to make the pcb so small as to cause problemswhile actually making the board. For example, you may end up with com-ponents fighting for space or solder pads so close that solder bridges the gapbetween them. Moreover, there are many important guidelines dependingon the specific circuit you are designing. Datasheets of components usuallymention the most important ones. Some common ones are listed here.

1. Keep decoupling capacitors (the capacitors used on power lines) closeto the components.

2. Keep high frequency signals like crystal clock signals short.

3. Keep analog components and digital components as far apart as possi-ble.

Typically, you do not get the layout right at the first try. When you startrouting the board, you will see that moving some components around willresult in shorter tracks. Hence, you will go through many iterations beforeyou arrive at the best layout. Always remember that it is worth the timeand effort you spend on improving your board design. The performance ofyour circuit is highly dependent on the layout and routing of the board.

Coming back to the board, take a look at the usbasp tut.brd file and placethe components on your board similarly. Right now, you don’t have to placethem at exactly the same locations, but the placement should be roughlythe same. If you find that the wires are getting all mixed up, try Tools >Ratsnest. This might clean things up by minimizing the wire lengths.

9

Page 10: Eagle Tutorial Tikekar

3.3 Routing and vias

Let us now begin routing the wires. Go to Edit > Route. You will see thefollowing menu bar near the top of the window. Each of the options is brieflydescribed below it.

Figure 5: Routing options

Since we are making our tracks on the bottom side of the board, choosethe Bottom layer. The width of the track is an important parameter. Thintracks are risky because some parts may not appear on your actual boarddue to over-etching. A professional manufacturer provides the value of thesmallest width you should use. If that is not known, 0.012 inch is the thinnestyou should go. Also, remember that power tracks should be thicker thansignals. I typically use 0.016 - 0.024 inch for signals and 0.032 - 0.05 inch forpower. Once you have the required settings, select a wire and route it. It isnot necessary to route it completely; you can partially route it and leave therest for later.

Since have only one layer for routing, we will not be using vias in thisboard. But it is a good idea to tell you more about vias are at this stage.Vias are connections between tracks on two different layers. For example,you may have a track on the bottom layer and you have to continue it onthe top one. So, you route the bottom part of the track, then you changethe layer to top and continue routing. When the routing is done, you willnotice a via at the point you jumped to the top layer. Now, depending onthe pcb manufacturer, the via may or may not connect the tracks. If the pcbis of the plated-through-hole (PTH) type, then the via will essentiallybe a hole with a metal coating on its walls. In this case, the metal coatingconnects the top and bottom tracks. If the pcb is not of the PTH type, thevia will just be a hole and you will have to insert a piece of wire and solderit on both ends to connect the tracks.

10

Page 11: Eagle Tutorial Tikekar

Figure 6: Vias

3.4 Autorouting and ground planes

For small pcbs like USBasp, you can easily route all the wires manually. Thisallows you to optimize your board very well. But routing a large board witha lot of signals takes a lot of time. For this, EAGLE has a powerful featurecalled Autorouter. All you need to do is to place the components and clicka button and voila, you have a routed board! OK, sometimes the autorouteris not all that great. It may take a lot of time to route large boards and maynot be able to route all the signals. But you can always use the result of theautorouter as a starting point for manual routing. The autorouter should beable to do most of the easy connections and you can then work on the morecomplicated ones.

The autorouter options are at Tools > Auto.... To disable routing onthe Top layer, choose ‘N/A’ as the preferred direction for it. You can setsome parameters which will affect choices the autorouter makes when routingyour board. For example, if you have a double-sided board but for somereason, you prefer tracks on the bottom than on the top, you can set ahigher layer cost for Top. The autorouter does a few iterations to optimizethe routing. You can use different cost settings for the iterations. Thus, thefirst optimization can be run with a top layer cost of, say, 10 and it could goon to, say, 50 for the last iteration. This is better than simply setting 50 forthe first one and keeping it 50 for the rest. You will notice that EAGLE’s

11

Page 12: Eagle Tutorial Tikekar

default settings for other costs are also graded in this fashion. You can alsoadd or delete iterations thus trading off between better routing and lesserrun-time. Your settings can be saved and used later for your other boardstoo.

Another nice feature of EAGLE is that it allows you fill up unused regionsof the board with a ground plane a.k.a. copper pour . To do this, go toDraw > Polygon and make a polygon in the bottom layer around the regionyou want to fill up. Then go to Edit > Name and change the name of thepolygon to ‘GND’. Now, right-click on the polygon to check its propertiesand change the value of Isolate to 0.024. Now, click on Tools > Ratsnest tofill up the polygon with a ground plane.

Figure 7: Creating a ground plane

12

Page 13: Eagle Tutorial Tikekar

The isolate parameter essentially tells EAGLE to keep a distance of 0.024inch between the ground plane and the other tracks. Also, you will noticethat the ground plane has gobbled up the ground tracks that existed before.This is natural since we named the polygon as ‘GND’. You could have namedthe polygon as ‘+5V’ or any other name and it would then gobble up thatnet and keep a distance from the other tracks including GND. You can lookup EAGLE help for more information on the other polygon options such asOrphan, Thermals, Pour, Rank, etc.

Now that we have gone through all the steps, you should be able tocomplete routing the board. Use the usbasp tut.brd as a reference.

4 What next?

4.1 Design Rule Check

After you have finished designing the board, it is time to check for any errors.Typical errors are overlapping tracks and components, tracks too close toeach other or component pads, holes too small and tracks too thin. EAGLEprovides a Design Rule Check function to look for these errors. Go to Tools> Drc... and click Check. EAGLE will then generate a list of DRC errorsand point them out when you when you select each instance of the error.Else if your design has no errors, it says so in the bottom-left corner.

Right now, EAGLE used some default rules for the DRC. You can modifysome parameters such as minimum clearance between two objects accordingto the manufacturers specifications and save your settings. The manufacturermay also provide you a file for the design rules which you can load intoEAGLE. The schematic also has an Electrical Rule Check function which Iencourage you to try out yourself.

4.2 Gerber files

Some manufacturers require the board files in the gerber format. You cangenerate the gerber files from the board in the following way.

1. Go to File > CAM processor in the Board window.

2. In the CAM processor window, go to File > Open > Job and open thefile gerb274x.cam.

13

Page 14: Eagle Tutorial Tikekar

3. Click on Process Job to generate the gerber files.

4. Now open excellon.cam and run Process Job again to generate one morefile.

You can view the Gerber files with a gerber viewer like Gerbv. This canbe downloaded from gerbv.sourceforge.net. A list of free gerber file viewerscan be found here.

Some manufacturers need only the images of the top and bottom tracks.This is the case when no solder-mask is applied. To take a print-out of thebottom tracks, keep only the Bottom, Pads and Vias layers visible. Then,go to File > Print. Amongst the options, enable just the Black and keep thescale factor as 1. You can also create a pdf file if you don’t have a printerconnected to your computer. In this case, make sure you use the appropriatescaling options when actually printing the pdf. To be sure, keep some actualcomponents on the the printout and verify if the pins match up with theprinted board. You could also keep all the components just to check if someare overlapping or if you have used the wrong package while designing. Toprint the top side, keep only the Top, Pads and Vias layers visible. The restof the steps remain the same.

5 Miscellaneous

5.1 Special considerations for prototyping boards

When you are designing pcbs not to be manufactured elsewhere but plan toassemble the circuit yourself on a prototyping board, you need to design theboard appropriately. Since the prototyping board has holes in a specific grid,you need to change your grid setting to match the prototyping board. Mostboards have a grid of 0.1 inch since the PDIP package has a pin pitch of 0.1inch. Now, the pads of all your components must necessarily be on the gridpoints. All the tracks must be routed along the grid lines as well. Checkout the file usbasp proto.brd for an example board design for a prototypingboard.

5.2 Shortcuts and hotkeys

Most of the commonly used functions are present in the panes on the left andright of both, the Schematic and Board windows. Using them is certainly

14

Page 15: Eagle Tutorial Tikekar

faster than going to the menubars on the top every time you want to movea component or add a wire. However, a more intelligent way is to assignhotkeys to these commands. EAGLE already has some default hotkeys suchas F3 for Zoom in, F7 for Move, etc. The complete list of hotkeys can beseen and modified at Options > Assign. Note that you can assign differenthotkeys for the Board and Schematic windows.

5.3 Backups

It is a good idea to periodically save your work. When you do so, EAGLEcreates a copy of your previous saved file as a back-up. For example, whenyou save usbasp.sch for the second time, your earlier saved version is nowsaved as usbasp.s#1. When you save the next time, usbasp.s#1 becomesusbasp.s#2, usbasp.sch becomes usbasp.s#1 and your current design getssaved as usbasp.sch. Thus, the .s#1 file has the most recent backup. In caseyou wish to revert back to an older back-up, just change the extension to.sch and open the file in EAGLE. A similar convention applies to the boardfiles too.

5.4 Check these out

- The EAGLE installer comes with a tutorial and a manual. There arethe first documents you should go to if you get stuck at anything. Thefiles are in the doc folder in your EAGLE installation directory. Alsocheck out the CadSoft website for new libraries and updated versionsof EAGLE.

- Instructables has a really nice tutorial on using EAGLE here. Theyalso touch upon creating new libraries in some related tutorials.

- Spark fun also has a good tutorial and a really awesome library witha huge number of components. The EAGLE tutorial starts from here.While at their site, also check out the other tutorials they have.

15