Lab 5: PCB Design With Altium EECS 473 - Electrical Engineering And .

Transcription

Lab 5: PCB Design with AltiumEECS 473On the website is an Altium tutorial. Do it.1. Pre-LabQ1. Once you’ve finished the tutorial, get a screenshotof your board design. It should look similar to thefigure to the right.Q2. Do the following tutorials which cover how tocreate a device (a package and symbol combined together is a isplay/ADES/((A Look at Creating Library Component s)) ADComplete the sections on the webpage in the following order: Creating a New Library Package and Schematic LibraryCreating a New Schematic ComponentAdding Pins to the Schematic ComponentSetting the Schematic Component’s PropertiesCreating PCB Component FootprintsCreating A New PCB LibraryManually Creating a FootprintAdding Footprint Models to a Schematic ComponentChecking the Component and Generating ReportsAfter completing the sections above, provide screen captures of your completed device. Itshould look something like this:1

Lab 5: PCB Design with AltiumEECS 473Now look at the schematic found on the following page.Q3. Identify all the parts circled on the following page. For each part (A-H) find a part numberand provide a brief description (a sentence or so) of what the part is.2

Lab 5: PCB Design with Altium3EECS 473

Lab 5: PCB Design with AltiumEECS 4732. In-LabNote: The in-lab is based heavily on the Lab 5: PCB Design with EAGLE, which is based on the EAGLElessons from the Michigan Embedded Systems Hub.4

Lab 5: PCB Design with AltiumEECS 473IntroductionIn the prelab, you gained experience performing schematic capture and board layout with asimple board in Altium and looked at a much larger design. In this section, we will be exploringa mid-sized board featuring a simple microcontroller-based system, including a power supplyand supporting components such as LEDs.Part 1: Setting up AltiumThe first thing we need to do is setup Altium. Go to the labs site and download the lab5.zip fileand extract the LAB5 files folder. We will be using the EAGLE MESH library within Altium, so wewill need to import the files. Go to the top right corner and click on the person and choose Extensions and Updates. Next to the build information, you will see a button called Configure. Click on it. Nowlook under the Importers/Exporters section and make sure the checkbox next to EAGLEis marked.Now to go File Import Wizard and hit Next.Click on EAGLE Projects and Designs. In the description header, you will notice some fileextensions, e.g. *.SCH, *.BRD, *.LBR. These are the file types we will be importing.Hit Next.Hit Next.Click Add and browse for the file named MESH.lbr and add it.Hit Next until it finishes importing the library.You should see the following files in the Projects panel on the left side. 5

Lab 5: PCB Design with AltiumEECS 473We have now successfully imported the EAGLE MESH library into Altium. We can now startcreating our schematic.Part 2: Creating a New SchematicCreate a schematic by going to File New Schematic.The core components of a design are those that will affect the functionality. In our simpleexample project, the core components are the voltage regulator and the processor (MCU). Wewill design those now.2.1 Power Supply2.1.1 Place PartWe will start our design by adding our linear dropout regulator (LDO) and the supportcomponents that it requires. First, let’s check to make sure that our MESH library is properlyinstalled and that we are able to search parts from it. Click on Panels in the bottom right corner and click on Libraries.You will see a panel pop up on the right side. Click on Libraries near the top.Go to the Installed tab and check that the MESH.IntLib is activated. Close the box.6

Lab 5: PCB Design with AltiumEECS 473Now that we have ensured the MESH library is activated, we can search for the regulator. In the Libraries panel, click on Search near the top.Set the Field to Name, Operator to contains, and Value to LM340.In the Scope section, click on the radio button next to Available libraries.Hit Search. You should now see at least 1 component in the Libraries panel on the right side.We want the LM340MPX-5.0/NOPB from the MESH.SCHLIB.Double click on the component, or right click and hit Place.Add the part somewhere on the schematic sheet by left clicking. Hit escape to preventplacing the part multiple times.2.1.2 Add CapacitorsMost voltage regulators will require some capacitors to function. Information on how manycapacitors and of what size are required can be found in the voltage regulator’s datasheet. Let’stake a look at the LM340MPX-5.0 datasheet. The datasheet is included in the Lab5 files youdownloaded from the lab site. On the first page, find Figure 1 – “Fixed Output Regulation”.As we can see, we require one 220nF capacitor and one 100nF ceramic capacitor. For moreinformation on using capacitors in power supplies including capacitor type and ESR, ask yourinstructor or refer to the lecture presentation available online.7

Lab 5: PCB Design with AltiumEECS 473We will add the ceramic caps first. Go back to the Libraries panel and hit Search.Make sure the Operator is contains. Search Cap in Available Libraries.You should now see a few components in the Libraries panel.Right click on Cap and place this part twice within the schematic sheet on either side ofthe regulator.You can rotate the capacitor before placing by hitting the Space key.After placing the capacitors, right click on the ‘220nF’ text next to the left capacitor andselect Properties.Change the Value to ‘220nF’.Do the same for the other capacitor, setting its Value to ‘100nF’.Double click on “C?” next to each capacitor and change the Values to C1 and C2 for theleft and right capacitors, respectively.Now right click on the Power Port tool and add a GND.The last steps in creating our power supply are to add a power source and to label the 5V net. To add a DC jack, go to the Libraries panel and hit Search.As we did before, search with Value equal to PWR.You should now see a component called PWR2.5 in the Libraries panel. Right click andchoose Place. Before you place it down, hit the Space key twice and the X key once. TheSpace key will rotate the part 90 degrees, and the X key will mirror the part.This general power jack is sufficient for our purposes, but a specific jack design should beresearched and picked for an actual board.Now connect things as shown below adding a 5V line and a GND in addition to the DC jack.8

Lab 5: PCB Design with AltiumEECS 473Now save this schematic document as powersupply.SchDoc.2.2 ProcessorWith the power supply placed, the next item to place is the processor.2.2.1 Place Part and DecoupleWe will first begin by creating a new schematic sheet by going to File New Schematic. Go to the Libraries panel.Search for “ATMEGA” in the available libraries.Right click and place the component “ATMEGA328-AU32-TQFP” onto the schematicsheet.In order for the processor to function correctly, it needs a stable voltage. To achieve this, weplace capacitors between power and ground. In the layout (next lesson) we will talk more abouthow proximity affects the voltage stability. For now we can place all the capacitors in a group,off to the side. These capacitors will be used to buffer the voltage and improve transientresponse. Just like the LDO, the datasheet for the MCU usually defines how many and of whatvalue these capacitors should be. Although the datasheet for our MCU doesn’t explicitly ask fordecoupling capacitors, it is always a good idea. For more information on decoupling inprocessors, FPGAs, and other devices, ask your instructor.9

Lab 5: PCB Design with AltiumEECS 473We will be using 100nF capacitors for our decoupling network. Search the Libraries for a “Cap Semi” component.Place two capacitors on the same sheet as the MCU and use the Net tool to connectthem between the VCC and GND nets. (See figure below)Rename these capacitors C3 and C4, respectively. Note: The image below is incorrect.Change the values of both capacitors to “100nF”.Add 5V and GND power ports to the schematic sheet as shown below.Add another capacitor to the schematic sheet. Connect it between the AREF pin andGND as shown below. Assign this capacitor a value of “100nF”.Rename this capacitor C5. Note: The image below is incorrect.Connect AGND to GND and AVCC to 5V.Ask your instructor if you are unsure of what these pins are or why these capacitors areneeded.2.2.2 Place Crystal with CapacitorsThe processor’s clock generation hardware needs a crystal oscillator input in order to generatea state system clock. This crystal should be connected between XTAL1 and XTAL2. Additionally,each terminal of the crystal needs a 22pF capacitor connected to GND. Again, the datasheetsfor the MCU and the crystal define the electrical characteristics of these support components.10

Lab 5: PCB Design with Altium EECS 473Search the library for “Crystal”.Right click and place the component “CRYSTAL 16MHZ SMD” from the MESH library.Now add 2 “Cap Semi” capacitors and a GND port.Consider rotating some of these parts such that your schematic looks similar to theimage below.Change the values of the capacitors to 22pF and rename them like below.2.2.3 Reset Switch and Pull-Up ResistorThe reset pin on a microcontroller is used to restart the device. This is especially useful in anembedded design if the processor freezes or if the user wants to observe startup behavior. Fornormal operation, this pin must be high ( 5V), which shorting the reset pin to ground, or low,will result in a microcontroller reset. In our schematic we have a button to force that pin lowand a resistor to ‘pull’ it high during normal operation. For a more thorough explanation ofreset conditions or pull-up and pull-down resistors, ask your instructor.11

Lab 5: PCB Design with Altium EECS 473Search the libraries for a component called “SW-PB”.Add the component to the schematic sheet.Add a 5V and GND port.Search and add a component called “Res3”.Change the “R?” to “R1”, and change the resistor Value to 10K.Wire everything together using the image below as reference.When the switch is unpressed, the resistor will cause the reset line to be pulled to 5V. Whenthe switch is pressed, the reset net is forced to logic low, which activates the microcontroller’sreset. Some current does flow through the resistor, but it is only while the switch is closed.2.2.4 Programming InterfaceThe last component to add before this is a functional board is the programming interface. Thisinterface allows the user to load code to the processor. Information regarding the correct setupfor the programming interface is usually not found in the processor datasheet but instead in anapplication note or reference document. This particular processor programs via the SerialPeripheral Interface (SPI). For more information on SPI and other serial communication, askyour instructor.The processor’s manufacturer provides the programming hardware, usually a USB to serialconverter, and a termination header to connect to your board. In this case, the header is 3x212

Lab 5: PCB Design with AltiumEECS 4730.1”. For future reference, this is the programming interface for most, if not all, ATmega chips.For this tutorial, we will use a generic header. Search and find “Header 3x2A” component and add it to the schematic sheet.To keep the schematic clean and easy to read, we will not be connecting the new headerdirectly to the processor. Instead, we will use the “net label” tool to make symbolicconnections. Altium will automatically connect these for us in the PCB layout. Using the “net label” tool, make 6 nets that connect to the 6 pins on the header. Theyshould not appear to connect to anything, just let them terminate a few grid spacesaway.Rename each net label as shown below.Add 5V and GND ports and connect them to the header pins as shown below.Typically, the programming interface only uses the power pin as a reference. The programmercan use it to define the programming logic level, or just test to see if the voltage on the deviceside is adequate. Depending on your device/programmer, the programming interface cansometimes supply power to the board. This is useful for debugging – the battery doesn’t needto be connected while the debugging interface is connected provided power requirements forthe board are low.The last step is to make the other half of the symbolic connection for our programming header.As we can see, RESET is one of the programming lines, so we need to label our reset line as“RESET”. We also need to make connections to the SPI lines MISO, MOSI, and SCK. Use the “net label” tool and left click on the RESET line. Rename this net label to“RESET”.Do the same for the SCK, MISO, and MOSI lines as shown below.13

Lab 5: PCB Design with AltiumEECS 473Now let’s save our schematic. Save it as schematic.SchDoc.Now let’s compile our PCB project. Go to Project Compile PCB Project. Resolve any errors ifany.We have now created the schematic circuit that supplies power to the processor. The processorgets a clean power supply with the capacitors we added and we can program the processorusing the interface that we just made.Part 4: Support ComponentsThe last step in this board design will be to add support components. Support components canbe anything from LEDs, level converters, serial adapters, or even just pinout headers. For ourboard we will just be adding two LEDs and a header. For more information on level converters,serial adapters, etc ask your instructor.4.1 LEDsThe first LED is a power LED to indicate the user that the board has power. Although seeminglytrivial, this LED is a really important debugging tool and should be included on any board thathas the power budge to accommodate it.Go back to the powersupply schematic sheet.14

Lab 5: PCB Design with Altium EECS 473Find and add a “Res3” component to the sheet.Change the “R?” to “R2”.Find and add a “LED2” component to the sheet.Change the “D?” to “D1”.Add 5V and GND ports to the sheet.Use the wire tool to connect the 4 symbols in series. The path of conventional currentshould flow as follows: 5V - Resistor - LED - GND, as shown below.Now we need to decide what value to give the current limiting resistor. If the value of thecurrent limiting resistor is too high, the LED will be dim. If the value of the current limitingresistor is too low, the LED will draw too much current and burn out. To determine the correctvalue, we need to do some research and math. Let’s take a look at the datasheet for the LED(provided in the support files in the Lab5 files folder).We are looking for two pieces of data, forward voltage drop and forward current. On page 2 of5 in the table “Electrical / Optical Characteristics” note that the typical voltage drop is 2.1Vwhen forward current is 20mA.Now we have our data, let’s do the math. We know that the current through the LED is 20mA,so the current through the resistor must be the same. We know that the voltage for the entiresystem is 5V and the voltage drop across the LED is 2.1V, this means that the remaining voltagedrop must be over the resistor (2.9V). Now use Ohms Law to calculate the value of the resistor.15

Lab 5: PCB Design with AltiumEECS 473V I*R, or rearranged, R V/I 2.9 / 0.02 145 Ohms. 145 Ohms is not a standard resistorvalue, so we round up to the nearest standard value (150 Ohms).Another aspect to consider is the power dissipated by the current limiting resistor. Recall thatPower V*I. Our resistor will be dissipating 2.9 * 0.02 0.058 Watts. Typical 0603 resistors are0.1 W rated, so this design will work. If we wanted a smaller resistor (with lower power rating)or higher current (brighter LED), then we would have to choose components that matchspecifications. For more information about choosing components, current limiting resistors, orLED circuit design, ask your instructor. Give the “Res3” resistor a value of 150.The next LED that we place will be a debugging LED connected to one of the digital IO pins ofthe processor. The user will then be able to toggle this LED through software. We are going toplace our LED on the SCK line. This line is used during programming and then becomes user I/O.An LED on SCK, therefore, will indicate to the user that programming is happening and thenbecome available for other use. Switch back to the schematic with the processor.Add the same “Res3” and “LED2” components to the sheet.Change the “R?” to “R3”, and the “D?” to “D2”.Instead of using the 5V power port as we did earlier, we will use the SCK line as thehigh voltage. Use a GND port as well did before.Give the resistor a value of 150.Give the LED a value of RED.Note that the LED will be illuminated when SCK is high and off when SCK is low. The datasheetfor the MCU defines the “Absolute Maximum Rating” for each I/O pin to be 40mA. The 20mAdraw of the LED is well within this limit.16

Lab 5: PCB Design with AltiumEECS 4734.2 HeadersBecause this board is essentially a platform for numerous different applications, it is likely thatvarious processor IO pins will be needed in the future. The pins on the processor itself are fartoo tiny to solder directly to so we will provide a header to make this easier. If you are unsureof what a header is, ask your instructor. Search the libraries for a “Header 8” component. It will be in the MiscellaneousConnectors library.Place one header onto the schematic sheet.Connect the pins of the processor and the pins of the header using the wire tool.Part 5: Error CheckingThe last step in the schematic process is to run the error checker. This can be run at any timeand is a good way to check your work. Note that it will not catch all errors, just some, but atleast it is a good place to start.Go to Project Compile PCB Project. You should not see any errors. If you do, resolve them. Ifyou see any warnings, read them and determine if they are necessary to fix.G1. Have your GSI look over your schematic.17

Lab 5: PCB Design with AltiumEECS 473Part 6: Initialize and Outline BoardNow we will start working on the board. Go to File New PCB. Save this new PCB file asPCB.PcbDoc. You will now see a black grid. Zoom out using CTRL Mouse Wheel until the entire black box is visible.In the top left corner, select Edit Origin Set, and position the cursor over the bottomleft corner of the board shape and left click.Next, press CTRL SHIFT G to open the Snap Grid dialog and enter 5mm and click OK toclose.We want to resize the board to 2.6” x 1”, or about 70mm x 30mm. To do this, selectView Board Planning Mode. Then select Design Edit Board Shape.Drag the corners until the board is 70mm x 30mm.Exit the Board Planning Mode by clicking View 2D Layout Mode.Part 7: Disperse ComponentsWith the outline placed, the next step is to arrange the components within the board area. Thisstep, and subsequent rearranging, is pivotal to the success of the board. First, make sure all thefiles are saved by going to File Save All.Now go to either the schematic or powersupply files.18

Lab 5: PCB Design with AltiumEECS 473 Go to Design Update PCB Document.You will see a box like this: Click on Validate Changes. If everything goes smoothly, you will see a green check marknext to every component.Now click on Execute Changes. This will import all our components into the PCB file. Youshould now see this within the PCB.PcbDoc file: You can click on the red boxes and hit the Delete key.Rearrange and place the components onto the PCB grid. Start with the regulator,“LDO?”, and the processor, “IC?”. Group these items separately and with enough spacefor support components. Make sure that the decoupling capacitors for themicroprocessor and voltage regulator are as close to the ICs as possible. Place theconnectors, headers, and switch last.19

Lab 5: PCB Design with AltiumEECS 473This view is called the rat’s nest and the yellow lines are called airwires. These lines representconnections that you need to make by routing.Part 8: Connections and RoutingPolygons are widely used within PCB design to create a solid or hatched area on a PCB layer.Polygon pours are often referred to as copper pours, as the polygon area within a layer is filledwith copper. This is very useful if we want to create VCC and GND planes. Since there are manyconnections on a schematic where VCC and GND are connected to, using a VCC or GND planeallows very short traces of wire to the pads. This helps reduce the amount of traces used forpower and frees up area on the board that can otherwise be used for other traces. If you wantto learn more about Polygons and how to use them, go to the following play/ADES/PCB ObjPolygonPour((Polygon Pour)) AD. You can also reference the Lab 5 Eagle tutorial section “Part 8:Connections and Routing”. For this tutorial we will ignore Polygons and create the power tracesourselves.This is a multi-layer board, which allows us to create traces on both the Top and Bottom Layers.In order to go from the Top layer to the Bottom layer, you must use pads and vias.20

Lab 5: PCB Design with AltiumEECS 473As we learned in the Altium tutorial from the Pre-Lab, you can choose between InteractiveRouting and Active Routing. Interactive Routing involves manually wiring the traces together.This method allows for more control over the board design, as you can route traces to beefficient and clean. Active Routing involves automatically connecting some or all of the tracestogether. This is helpful for beginners, since Altium will create the traces optimally and veryquickly. However, the Active Routing tool is not perfect, and does not always create the tracesin the most efficient manner. If you do use the Active Routing tool, you may end up with a fewair wires that you will need to manually wire.When creating the traces, you can swap between the multiple layers on the bottom of thescreen. So if you want to create a trace on the top layer, make sure to click on Top Layer asshown below. You can see which layer is selected by looking at the color next to “LS”.If you click on the “LS” button, it will bring up the View Configuration panel. Here you canconfigure different parameters such as object visibility, transparency, etc. You can alsoenable/disable different layers, which can be very useful when trying to route traces ondifferent layers.21

Lab 5: PCB Design with AltiumEECS 473After routing everything together, we will compile and error check. Go to Project Compile PCB Project and resolve any errors.Go to Tools Design Rule Check and click on Run Design Rule Check. Resolve any errorsthat pop up.If everything goes well, you should now have a complete board design.Part 9: Gerber FilesNow that our board design is complete, we are ready to generate the files needed to send ourPCB to a fabrication house. Go to File Fabrication Outputs Gerber Files.On the General tab, choose Millimeters as the units.On the General tab, choose 4:3 as the format.On the Layers tab, click Plot Layers and select Used On.On the Layers tab, disable any mechanical layers.On the Advanced tab, confirm that the Position on Film is set to Reference to relativeorigin.Click OK. Save this file.G2. Show your board layout to your GSI. Be able to justify the decisions you’ve made.G3. Create a zipfile of your Gerber files and drill hole file you’d need for the manufacture ofyour board. Show your GSI.22

Lab 5: PCB Design with AltiumEECS 4733. Post-LabQ1. Read ADES/PCB DlgMatchedNetLengthsRule Frame((Matched Lengths)) AD. Write aexplaining what you learned.Q2. Read ADES/((Defining the Layer Stack)) ADWhat is a layer and layer stack? Why do so many exist?Q3. Go to https://resources.altium.com/pcb-design. Pick one article that interests you. Read it andWrite a paragraph explaining what you learned.23

Lab 5: PCB Design with Altium EECS 473 1 On the website is an Altium tutorial. Do it. 1. Pre-Lab_ Q1. Once you've finished the tutorial, get a screenshot of your board design. It should look similar to the figure to the right. Q2. Do the following tutorials which cover how to