PCB Design with EAGLE Layout Editor

Motivation

This tutorial explains how to design a printed circuit board (PCB) for Microchip's PIC16F84 microcontroller using the EAGLE Layout Editor software. EAGLE is free and can be downloaded from the following web site: http://www.cadsoft.de/. This tutorial assumes the reader:

Constructing Your Circuit Schematic

Before creating the PCB, we must first draw up the circuit schematic. We will be working from a schematic shown on the Boondog web site. This schematic will be simplified by removing the push-button switch on MCLR and replacing it with 5V and removing SW1 from pin A0. Let's begin by starting the EAGLE Layout Editor and select File => New => Schematic. Now let's start adding components to our schematic by clicking the Add button from the toolbar on the left.

When the Add window pops up, navigate down to the Microchip library and expand it. Then move down to PIC16F8* and upon expanding it, you will find the PIC16F84AP microcontroller. Select this component and hit OK. Place the component somewhere in your schematic window by left clicking the mouse.

After the above component is placed, the Add window will pop back up. Repeat this process for the following parts:

After adding your last component click ESC, which will bring up the Add window again. Then select cancel to finish. Save your schematic when finished as pic16f84a.sch. Your window should now look like the one below.

The next step is to wire up all the parts based on the schematic from the boondog web site. To ensure that we are wiring to component pins and not leaving any wires suspended in midair, turn on the Pins layer. Go to View => Display/Hide Layers => Pins => OK. Next, select the Net function from the toolbar on the left and left-click on the OUT pin of the clock and then left-click on the OSC1 pin of the PIC16F84A. Note: be sure to click in the center of the green circle when connecting Nets. After making your first connection, your circuit should now look like the one below.

Repeat the above step to make all connections as shown on the schematic from Boondog's web site. Also, you can use the Name tool to label resistor and capacitor values. Upon completion, your schematic should look like the one below.

Routing Your PCB

Now that we have finished the schematic, we are ready to use the Board tool. From the schematic editor, click on the Board button in the top toolbar. Click Yes when prompted to create the board from the schematic. You should now see a window that shows the packages of all the parts from your schematic (with connections) and a large white rectangle (this is the outline of the PCB).

Before moving any parts onto the board, we must first set the grid size. This will ensure that all of our parts are placed on the grid when moved. A good rule of thumb is to locate the part with the smallest pitch (distance between pins) and set the grid size to half of that. For example, the part on our board with the smallest pitch is the microcontroller (pitch = 100 mil or 0.1"). Therefore, our grid size should be set to 50 mil. To do this, click on the grid button in the top left of the Board window. Modify the grid pop-up window to look like the one below.

Now that the grid is properly set, use the Move tool to place the parts inside the white outline. Once you have your parts neatly organized and in a confined area, you want to also shrink the size of the board. This can be done again with the Move tool by left-clicking on the edges of the PCB outline. When finished with this step, the board should look like the one below.

One main advantage with any recently developed layout software is the autorouter function. This tool is used to automatically route all of the connections shown on your board. Before we start the autorouter, we must specify some design rules. Select Edit => Design Rules and then click on Sizes. Specifying the minimum width of each route will help increase the chances of a fully routed board when using the autorouter tool. This is especially important if you are working with surface mounted packages. This also is dependent on your PCB manufactures (e.g AP Circuits can only fabricate boards with a route width of 7 mil). For now, let's keep this at 10 mil and click OK. Now we are ready to use the autorouter. Left-click on the autorouter button on the bottom of the toolbar at the left. You will be prompted with the window shown below. Be sure to match the Routing Grid selection with that specified earlier. Click on OK to begin the autorouting process.

Your finished board should resemble the one shown below.

With more complicated boards, the autorouter will not be able to complete every single connection. The remaining connections are left up to the user to finish manually. Also, the router will sometimes layout connections with 90 degree angles. A good rule of thumb in PCB design is to have all routes bending at 45 degrees. To practice manually routing a connection, let's first get rid of the connection that was created at 90 degrees. To do this, select the ripup button from the toolbar on the left and click on the two lines shown below with an arrow.

Your board should now look like the one below.

To route this connection manually, select the Route button from the toolbar on the left. To route at 45 degree angles, you must select the appropriate Wire Bend from the toolbar at the top (select the one that is second from the left _/). Also, you want to use a route that is the same width as the other traces on your board. Select the drop down bar next to Width and select 10 mil. Now, left-click on one end of the thin yellow wire on your board and move up to the other end of the yellow wire, while at the same time creating a connection of 45 degrees. Your new route should look like the one shown below.

One last piece of useful information for laying out and routing your PCB is using vias. Vias are through-holes which connect routes on the top and bottom layers. To demonstrate their usefulness, lets delete the route we just created using the ripup tool. Again with the simplicity of this board, there was no need for vias, but let's create a case where there would be. Suppose we want to create the connection shown below.

Start by selecting the Route button from the toolbar at the left. And if we started out with a route on the Bottom layer (left-click the drop down box at the top left and select Bottom), we would create a short when passing over the first trace. However, if we created two vias, we could bypass this trace and finish our route.

To finish this route we need to create two vias. While in the middle of manually routing on the bottom layer, select the layer drop down box at the top left and choose Top. This will automatically place a via at the specified location and will also change your route from the bottom to the top.

Once passing over the blue trace, change your layer again from Top to Bottom and make the connection with the appropriate trace. Your finished board should look like the one below.

Finally, one last step before generating your PCB gerber files is to check over everything. EAGLE PCB provides two nice tools for this: Electrical Rule Check (ERC) and Design Rule Check (DRC).

Generating Gerber Files

The final step in completing your PCB design is to generate the Gerber files. These are the files used by companies to fabricate your PCB. I order PCBs from AP Circuits so this part of the tutorial will be tailored towards their requirements. The first step to creating your Gerber files is to start the CAM Processor by clicking the CAM button in the top toolbar. You will see the following window pop up.

First, you want to change the Device to Gerber_RS274X. Next based on the table below, enter the file extension in the File box and make sure the corresponding layers are highlighted in the box at the right. Then select Process Job to generate the corresponding files. Repeat this 4 times for each file listed in the table below.

The final step is to create the NC drill file. Change the Device to Excellon and turn the Drills and Holes layers on and everything else off. Type in .ncd in the file box and select Process Job. This completes the last step of PCB design. You now have all the files necessary to send your board off to fabrication!!

This tutorial was created by B. Green: home page